Skip to content

tools/list failed with Error Code: -32602 Invalid request parameters #1

@BobDickinson

Description

@BobDickinson

Note: I've tested this dozens (hundreds?) of times and I've only seen it once so far.

When tsh was invoked by Claude Code calling the fetch server through the gateway, it generated an error in the tools/list call:

Error Code: -32602
Invalid request parameters

A resources/list call that immediately followed succeeded, as did later initialization of subsequent fetch servers via tsh in the same Claude Code session.

Log contained:

WARNING:root:Failed to validate request: Received request before initialization was complete

The above message comes from the python SDK (used by fetch)

https://github.com/modelcontextprotocol/python-sdk/blob/c2ca8e03e046908935d089a2ceed4e80b0c29a24/src/mcp/server/session.py#L164

Here's a bug that may be related:

modelcontextprotocol/python-sdk#423

It's not really clear what we can do about this. Maybe we have the session track to timestamp of the notifications/initialized
messages and if another message comes in within some small window, we induce a small delay in forwarding it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions