typescript-sdk/.changeset/fix-unknown-tool-protocol-error.md
Konstantin Konstantinov 0fb8406d83
v2: codemod iterations, canonical zod schema exports from sdk-shared (#2354)
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
2026-06-25 19:42:44 +01:00

587 B

@modelcontextprotocol/core-internal @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.