typescript-sdk/.changeset/fix-unknown-tool-protocol-error.md
Anthony 108f2f3ab6
fix: correct error handling for unknown tools and resources (#1389)
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
2026-03-09 18:17:09 +00:00

578 B

@modelcontextprotocol/core @modelcontextprotocol/server
minor major

Fix error handling for unknown tools and resources per MCP spec.

Tools: Unknown or disabled tool calls now return JSON-RPC protocol errors with code -32602 (InvalidParams) instead of CallToolResult with isError: true. Callers who checked result.isError for unknown tools should catch rejected promises instead.

Resources: Unknown resource reads now return error code -32002 (ResourceNotFound) instead of -32602 (InvalidParams).

Added ProtocolErrorCode.ResourceNotFound.