You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The SDK's error handling does not provide sufficient error details when encountering complex error types. Notably, when an AggregateError is thrown (e.g., from pg.Pool.connect()), users only see "MCP error -32603" without any underlying error information that could help diagnose the issue.
To Reproduce
Use any MCP server that may throw complex errors (e.g., @modelcontextprotocol/server-postgres with invalid connection)
Observe that error messages lack important details
Example: Database connection errors only show "MCP error -32603" instead of the actual connection error details stored in AggregateError.errors[]
Expected behavior
The error handling system should:
Deeply inspect error objects to extract meaningful information
Handle common error types appropriately (including but not limited to AggregateError)
Present error information in a way that helps users diagnose issues
Additional context
The AggregateError case highlights a broader need for better error inspection
Different error types may store their important details in different properties
A more robust error inspection system would improve the debugging experience across all MCP servers
This could be designed as a general error handling enhancement, with AggregateError support being one of the initial use cases
The text was updated successfully, but these errors were encountered:
The callTool, as described in the Zod schema here, takes as the first parameter the name of the tool you want to call. Check your server configuration to get the name of the tool.
The code should look like:
const result = await client.callTool("get-forecast", {"latitude": 34.0522, "longitude": -118.2437});
This is not the same issue as the one described by the OP, the exception you receive is a Zod error describing what is missing in the payload (see schema linked above): it expects a name property in the params object : this property would contain the name of the tool
Describe the bug
The SDK's error handling does not provide sufficient error details when encountering complex error types. Notably, when an AggregateError is thrown (e.g., from pg.Pool.connect()), users only see "MCP error -32603" without any underlying error information that could help diagnose the issue.
To Reproduce
Expected behavior
The error handling system should:
Additional context
The text was updated successfully, but these errors were encountered: