A known method whose params do not deserialize is answered with -32601 Method not found
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
Start by reading the ClientRequest untagged enum and the default on_custom_request handler described in the issue; compare how typed request deserialization failures reach that handler with how unknown methods are handled. Check the existing request error tests and add cases for the malformed tools/call, prompts/get, and resources/read params. Done means known methods with invalid params return -32602, while an unknown method still returns -32601.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When a request names a standard method but its params do not fit that method's type, the server answers -32601 with the method name as the message. The client is told the server has no tools/call, when the problem is in its own arguments.
To Reproduce (main at 808124b, also 3.5.1; stdio, after a 2025-11-25 handshake, server built with #[tool_router] / #[prompt_router])
| request | response |
|---|---|
tools/call, no params |
-32601 tools/call |
tools/call, params: {} |
-32601 tools/call |
tools/call, params: {"name": 7, "arguments": {}} |
-32601 tools/call |
tools/call, params: {"name": "ok", "arguments": "x"} |
-32601 tools/call |
prompts/get, params: {"name": 7} |
-32601 prompts/get |
resources/read, params: {"uri": 7} |
-32601 resources/read |
fixture/unknown (control) |
-32601 fixture/unknown |
On 2026-07-28 the rows that carry params behave the same; the row without params is correctly answered with -32602 for the missing _meta.
Why
ClientRequest is #[serde(untagged)]. When the typed variant for the method fails, the message falls through to CustomRequest, and the default on_custom_request returns METHOD_NOT_FOUND. Same shape as #1345, one level down.
Expected behavior
-32602 Invalid params when the method is one the SDK defines and its params do not deserialize. The tools page lists "Malformed requests (requests that fail to satisfy CallToolRequest schema)" under protocol errors, and the Go, Python and TypeScript 2.x SDKs answer these requests with -32602.
Related, smaller
A request whose params is not an object ("params": []) is answered with {"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid request"}}. The response has no id member, although the request's id was readable, so the sender cannot match it. I can split this into its own issue if you prefer.
I can send a PR for the first part.
AI disclosure: investigated and drafted with Claude Code; I reviewed it.
- 主要语言
- Rust
- 星标
- 4k
- 派生
- 662
- 平均合并
- 3 天 19 小时
- 30 天内合并 PR
- 35
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/rust-sdk 的其他 Issue
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP status可能已有人在做 @aton-of-data 于 3 天前认领。 未关闭bug P2 ready for work T-security T-transport
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/rust-sdk#1339 ·
维护者通常 3 天内回复
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scope可能已有人在做 @jstar0 于 5 天前认领。 未关闭bug P1 ready for work T-security T-transport
难度 2/5 1-3 小时 新手友好度 65/100
modelcontextprotocol/rust-sdk#1330 ·
维护者通常 3 天内回复
-
P3 question Stale T-documentation T-enhancement
难度 1/5 1 小时以内 新手友好度 86/100
modelcontextprotocol/rust-sdk#1155 · 1 条评论 ·
维护者通常 3 天内回复
-
Clean up sessions after legacy initialize parsing fails可能已有人在做 @bolinfest 今天认领。 未关闭bug P2 ready for work T-transport
modelcontextprotocol/rust-sdk#1357 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
Expose body-free HTTP status and Retry-After metadata可能已有人在做 @bolinfest 今天认领。 未关闭
modelcontextprotocol/rust-sdk#1356 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
查看 modelcontextprotocol/rust-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
bytecodealliance/rustix#1703 ·
维护者通常 3 天内回复
-
bug discussion
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
farion1231/cc-switch#8298 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ajeetdsouza/zoxide#1323 ·
维护者通常 1 天内回复