-
Notifications
You must be signed in to change notification settings - Fork 3k
fix: correct unknown tool/prompt/resource error handling #1872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DePasqualeOrg
wants to merge
1
commit into
modelcontextprotocol:main
from
DePasqualeOrg:fix/unknown-tool-protocol-error
Open
fix: correct unknown tool/prompt/resource error handling #1872
DePasqualeOrg
wants to merge
1
commit into
modelcontextprotocol:main
from
DePasqualeOrg:fix/unknown-tool-protocol-error
+77
−31
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DePasqualeOrg
DePasqualeOrg
changed the title
(削除) Fix unknown tool/prompt/resource error handling (削除ここまで)
(追記) fix: correct unknown tool/prompt/resource error handling (追記ここまで)
Jan 15, 2026
Member
Kludex
commented
Jan 21, 2026
@claude can you resolve the conflicts here?
@maxisbey
maxisbey
force-pushed
the
fix/unknown-tool-protocol-error
branch
2 times, most recently
from
January 21, 2026 18:18
c46e5b0 to
86d3037
Compare
@DePasqualeOrg
DePasqualeOrg
force-pushed
the
fix/unknown-tool-protocol-error
branch
from
January 23, 2026 10:35
86d3037 to
1f1e2ad
Compare
Author
DePasqualeOrg
commented
Jan 23, 2026
I resolved the conflicts. The failing Claude Code Review appears to be due to a permissions issue in this repository's GitHub Actions workflow configuration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While developing my Swift SDK for MCP, I encountered the following MCP spec compliance issue in the Python SDK:
When an unknown tool is called, it throws a
ToolError, which is caught by the server's exception handler and converted to a response withisError: true.The spec distinguishes between protocol errors and tool execution errors:
Protocol Errors:
Tool Execution Errors:
Protocol error example for unknown tool:
{ "jsonrpc": "2.0", "id": 3, "error": { "code": -32602, "message": "Unknown tool: invalid_tool_name" } }The same issue applies to prompts and resources. Per the spec:
-32602(INVALID_PARAMS): spec reference-32002(RESOURCE_NOT_FOUND): spec referenceChanges
McpErrorwithINVALID_PARAMS(-32602) for unknown toolsMcpErrorwithINVALID_PARAMS(-32602) for unknown promptsMcpErrorwithRESOURCE_NOT_FOUND(-32002) for unknown resourcesRESOURCE_NOT_FOUNDconstant tomcp.typesHow Has This Been Tested?
I updated the tests to check for the correct error handling.
Breaking Changes
Users who expected the incorrect error handling may need to change their code.
Types of changes
Checklist