Skip to content

List tools fails when there are tools without parameters #445

@Paul-E

Description

@Paul-E

Describe the bug
The list tools MCP json RPC fails, returning errors like this

  {
    "code": "invalid_literal",
    "expected": "object",
    "path": [
      "tools",
      0,
      "inputSchema",
      "type"
    ],
    "message": "Invalid literal value, expected \"object\""
  }

To Reproduce

Start the example counter streamable HTTP server by navigating into the examples/servers directory and run cargo run --example servers_counter_streamhttp

Start up the MCP inspector with npx @modelcontextprotocol/inspector.

It will open your browser, or navigate in your browser to the URL given on the command line. Look for the text MCP Inspector is up and running at: http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=...

Enter http://localhost:8000/mcp into the "URL" on the inspector webpage. Navigage to "tools" and click "list tools". In the history, you will see an error response.

Expected behavior

I expect to see a list of valid tools. In this case it should be the tools in the counter example: increment, decrement, get_value, say_hello, echo, and sum.

Additional Note

The tests against the examples do not compile when run with cargo test --examples at the top level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions