Unknown tool error always says "Unknown tool: invalid_tool_name" instead of the name that was called
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 85/100
Hướng nghiên cứu
Tìm trong McpAsyncServer.java và McpStatelessAsyncServer.java handler tools/call xây dựng McpError với thông báo cố định "Unknown tool: invalid_tool_name". Thay placeholder bằng tên được yêu cầu đã có trong phạm vi dưới dạng callToolRequest.name(), giữ nguyên trường data. Chạy các bài kiểm thử máy chủ hiện có để xác nhận cả hai biến thể async và stateless giờ đây trả về ví dụ Unknown tool: delete_order.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 3.8k
- Fork
- 1.1k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/java-sdk
-
Modern `HttpServletMcpTransport` does not check `Mcp-Name` when `params.name` or `params.uri` is not a JSON stringCó thể đã có người làm @starryeye đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/java-sdk#1352 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
modelcontextprotocol/java-sdk#1345 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tool result _meta is lost when the server automatically adds text content for structured outputĐang mởarea/server legacy P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/java-sdk#1330 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Client request handlers that complete empty send no JSON-RPC responseCó thể đã có người làm @1fanwang đã nhận 83 ngày trước. Đang mởarea/client bug P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/java-sdk#1124 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilitiesCó thể đã có người làm @1yuxiangJ đã nhận 98 ngày trước. Đang mởbug P2 ready for work
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/java-sdk#1086 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/java-sdk
Issue tương tự
-
crash
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
account bug course exam iris lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100