Unknown tool error always says "Unknown tool: invalid_tool_name" instead of the name that was called
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
Research direction
Look in McpAsyncServer.java and McpStatelessAsyncServer.java for the tools/call handler that builds McpError with the fixed "Unknown tool: invalid_tool_name" message. Replace the placeholder with the requested name already in scope as callToolRequest.name(), leaving the data field unchanged. Run the existing server tests to confirm both async and stateless variants now return e.g. Unknown tool: delete_order.
Written by the indexing model from the issue text.
Description
The error for a tools/call with an unknown tool name has a fixed message, Unknown tool: invalid_tool_name, whatever name was called:
// McpAsyncServer.java (and McpStatelessAsyncServer.java)
return Mono.error(McpError.builder(McpSchema.ErrorCodes.INVALID_PARAMS)
.message("Unknown tool: invalid_tool_name")
.data("Tool not found: " + callToolRequest.name())
.build());
A call to delete_order, which the server does not have, gets:
{"code": -32602, "message": "Unknown tool: invalid_tool_name", "data": "Tool not found: delete_order"}
The text looks like it was taken from the error example in the MCP specification, where invalid_tool_name is a placeholder. Clients and logs usually show only message, so the name of the tool is lost, and it looks as if the tool were called invalid_tool_name.
Expected: the message names the tool that was called, such as Unknown tool: delete_order, in both McpAsyncServer and McpStatelessAsyncServer. data can stay as it is.
Seen with mcp-core 2.2.0, and still in main (779893c).
Claude Code on behalf of Claus Ibsen
- Dominant language
- Java
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 38
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/java-sdk
-
Modern `HttpServletMcpTransport` does not check `Mcp-Name` when `params.name` or `params.uri` is not a JSON stringPossibly taken @starryeye claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/java-sdk#1352 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/java-sdk#1345 · 1 comment ·
Maintainers usually reply within 1 day
-
Tool result _meta is lost when the server automatically adds text content for structured outputOpenarea/server legacy P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelcontextprotocol/java-sdk#1330 · 1 comment ·
Maintainers usually reply within 1 day
-
Client request handlers that complete empty send no JSON-RPC responsePossibly taken @1fanwang claimed this 83 days ago. Openarea/client bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/java-sdk#1124 · 6 comments ·
Maintainers usually reply within 1 day
-
ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilitiesPossibly taken @1yuxiangJ claimed this 98 days ago. Openbug P2 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/java-sdk#1086 · 2 comments ·
Maintainers usually reply within 1 day
All issues in modelcontextprotocol/java-sdk
Similar issues
-
crash
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
account bug course exam iris lecture
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100