docs(client): ClientSession documents only the input-required kwargs, not its mandatory parameters
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 84/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- documentation
Rechercherichtung
Lies die Args-Blöcke für ClientSession.send_request, call_tool, get_prompt und read_resource in src/mcp/client/session.py und vergleiche ihre Signaturen mit den dokumentierten Parametern in src/mcp/client/client.py. Ergänze Beschreibungen für die fehlenden Parameter und übernimm, wo verfügbar, die Formulierungen aus der Client-Ebene. Erledigt ist die Aufgabe, wenn alle vier Args-Blöcke die Parameter dokumentieren, die jede Methode akzeptiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 25k
- Forks
- 4.2k
- Ø Merge
- 10 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/python-sdk
-
v2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
modelcontextprotocol/python-sdk#3978 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Client serves cached tools after its context exits with an exceptionEvtl. vergeben @jonxsong hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
modelcontextprotocol/python-sdk#3968 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
modelcontextprotocol/python-sdk#3957 ·
Maintainer antworten meist innerhalb von 1 Tag
-
v2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
modelcontextprotocol/python-sdk#3934 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug v1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
modelcontextprotocol/python-sdk#3929 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in modelcontextprotocol/python-sdk
Ähnliche Issues
-
auto-reported bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
backend bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
nolte/kamerplanter#3193 ·
Maintainer antworten meist innerhalb von 1 Tag
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwiseEvtl. vergeben @abdulwaarith0 hat das heute übernommen. Offenneeds-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
MakazhanAlpamys/Soup#3690 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag