docs(client): ClientSession documents only the input-required kwargs, not its mandatory parameters
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 84/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
閱讀 src/mcp/client/session.py 中 ClientSession.send_request、call_tool、get_prompt 和 read_resource 的 Args 區塊,然後將它們的簽章與 src/mcp/client/client.py 中文件記載的參數進行比較。為缺少的參數新增描述,並在適用時沿用 Client 層的措辭。四個 Args 區塊都記錄了各自方法接受的參數後,即告完成。
由索引模型根據 Issue 內容生成。
描述
What is wrong
ClientSession.read_resource (src/mcp/client/session.py, docstring at 933) has a Google-style Args: block that lists only the three optional input-required kwargs:
documented in Args: ['input_responses', 'request_state', 'allow_input_required']
real parameters : ['uri', 'input_responses', 'request_state', 'meta', 'allow_input_required']
UNDOCUMENTED : ['uri', 'meta']
uri is the only parameter without a default, so the rendered API reference documents the optional arguments and hides the mandatory one. meta is undocumented as well.
The higher-level Client.read_resource (src/mcp/client/client.py:662,666) documents both correctly, so this looks like drift confined to the session layer rather than an intentional omission.
Minimal reproduction
import inspect
from mcp.client.session import ClientSession
print(inspect.signature(ClientSession.read_resource))
# (uri: AnyUrl, input_responses: ... = None, request_state: ... = None,
# meta: ... = None, allow_input_required: bool = False) -> ReadResourceResult
Scope of the drift
The same pattern appears on three neighbouring methods in the same class, measured the same way on main — every one of them documents the input-required kwargs and nothing else, which suggests the block was written once and copied:
| Method | Documented in Args: |
Actually accepted |
|---|---|---|
send_request (l. 540) |
metadata |
request, result_type, request_read_timeout_seconds, metadata, progress_callback |
call_tool (l. 1052) |
input_responses, request_state, allow_input_required, allow_claimed |
name, arguments, read_timeout_seconds, progress_callback, input_responses, request_state, meta, allow_input_required, allow_claimed |
get_prompt (l. 1217) |
input_responses, request_state, allow_input_required |
name, arguments, input_responses, request_state, meta, allow_input_required |
call_tool is the most visible case: name and arguments are the two parameters every caller passes and neither is documented.
Proposed fix
Add the undocumented parameters to each Args: block, reusing the wording already used in the Client layer where the same parameter appears. Docstring-only, one file, no behaviour change; ruff check and ruff format --check pass on the file.
I am proposing this as one issue, because the four blocks share a cause and the fix is one file. Say the word if you would rather take read_resource alone and file the rest separately, and I will split it.
Willing to open a PR?
Yes — assign this to me (or label it help wanted) and I'll send it. I've read the intake gate and will include Fixes #<this> plus the AI-assistance disclosure the contributing guide asks for.
- 主要語言
- Python
- 星號
- 25k
- 分支
- 4.2k
- 平均合併
- 10 分鐘
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
modelcontextprotocol/python-sdk 的其他 Issue
-
v2
難度 1/5 1 小時以內 新手友好度 86/100
modelcontextprotocol/python-sdk#3978 · 2 則留言 ·
維護者通常 1 天內回覆
-
Client serves cached tools after its context exits with an exception可能已有人在做 @jonxsong 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
modelcontextprotocol/python-sdk#3968 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
modelcontextprotocol/python-sdk#3957 ·
維護者通常 1 天內回覆
-
v2
難度 1/5 1 小時以內 新手友好度 91/100
modelcontextprotocol/python-sdk#3934 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug v1
難度 2/5 1-3 小時 新手友好度 79/100
modelcontextprotocol/python-sdk#3929 · 2 則留言 ·
維護者通常 1 天內回覆
查看 modelcontextprotocol/python-sdk 的全部 Issue
相似的 Issue
-
auto-reported bug
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
-
backend bug
難度 2/5 1-3 小時 新手友好度 86/100
nolte/kamerplanter#3193 ·
維護者通常 1 天內回覆
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwise可能已有人在做 @abdulwaarith0 今天認領。 未關閉needs-triage
難度 2/5 1-3 小時 新手友好度 84/100
MakazhanAlpamys/Soup#3690 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆