Unknown tool error always says "Unknown tool: invalid_tool_name" instead of the name that was called
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
在 McpAsyncServer.java 和 McpStatelessAsyncServer.java 中查找 tools/call 处理器,该处理器构造 McpError,并带有固定的 "Unknown tool: invalid_tool_name" 消息。将占位符替换为已在作用域中作为 callToolRequest.name() 的所请求名称,保持 data 字段不变。运行现有服务器测试,确认 async 和 stateless 两种变体现在都返回例如 Unknown tool: delete_order。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Java
- 星标
- 3.8k
- 派生
- 1.1k
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/java-sdk 的其他 Issue
-
Modern `HttpServletMcpTransport` does not check `Mcp-Name` when `params.name` or `params.uri` is not a JSON string可能已有人在做 @starryeye 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/java-sdk#1352 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
modelcontextprotocol/java-sdk#1345 · 1 条评论 ·
维护者通常 1 天内回复
-
area/server legacy P3
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/java-sdk#1330 · 1 条评论 ·
维护者通常 1 天内回复
-
Client request handlers that complete empty send no JSON-RPC response可能已有人在做 @1fanwang 于 83 天前认领。 未关闭area/client bug P2
难度 2/5 1-3 小时 新手友好度 84/100
modelcontextprotocol/java-sdk#1124 · 6 条评论 ·
维护者通常 1 天内回复
-
ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilities可能已有人在做 @1yuxiangJ 于 98 天前认领。 未关闭bug P2 ready for work
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/java-sdk#1086 · 2 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/java-sdk 的全部 Issue
相似的 Issue
-
crash
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 74/100
-
account bug course exam iris lecture
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100