Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

A known method whose params do not deserialize is answered with -32601 Method not found

未關閉
#1,347 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

@talhayme 已經在處理了。

開始於 2026年10月17日。

  • #1375 來自 @talhayme —— 未關閉

評估

難度
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 內容生成。

描述

bug P1 ready for work T-handler T-model

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 天 13 小時
30 天內合併 PR
35

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

modelcontextprotocol/rust-sdk 的其他 Issue

查看 modelcontextprotocol/rust-sdk 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。