`ClientSessionGroup` has no routed `read_resource` / `get_prompt` (only `call_tool`)
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Look at the ClientSessionGroup class to understand how call_tool works and the existing reverse indexes for tools. Identify where resources and prompts are aggregated. The new methods read_resource and get_prompt should follow the same routing pattern, using the component_name_hook. Check the disconnect_from_server method to ensure cleanup. Start by examining the session aggregation logic and the existing indexes.
索引モデルが issue の本文から書いたものです。
説明
Description
### What I ran into
`ClientSessionGroup` aggregates tools, resources, and prompts into one view, and
`call_tool(name, ...)` routes to the session that owns the tool. But that routing
exists only for tools. There's no equivalent way to read an aggregated resource
or fetch an aggregated prompt through the group.
### Why it matters
To read a resource or get a prompt, a caller has to track the owning
`ClientSession` themselves and bypass the group, which defeats the "one object,
one view" purpose of the abstraction. The asymmetry is surprising given
`call_tool` is already there.
### Proposed change
Add `read_resource(name, ...)` and `get_prompt(name, arguments, ...)` mirroring
`call_tool`: resolve the aggregate key (honoring `component_name_hook`) to the
owning session via resource/prompt reverse indexes, forward the real wire
URI/name, carry the same `allow_input_required` overloads, and clean the indexes
up on `disconnect_from_server`.
### Example
```python
result = await group.read_resource("Library.hours")
prompt = await group.get_prompt("Greeter.greet", {"name": "Ada"})
- 主要言語
- Python
- スター
- 24.3k
- フォーク
- 4k
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 25
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/python-sdk のほかの issue
-
v1 v2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
modelcontextprotocol/python-sdk#3578 · コメント 1 件 ·
-
v1 v2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
modelcontextprotocol/python-sdk#3573 · コメント 2 件 ·
-
v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/python-sdk#3566 ·
-
v1 v2
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
modelcontextprotocol/python-sdk#3546 · コメント 5 件 ·
-
v1 v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/python-sdk#3545 · コメント 2 件 ·
modelcontextprotocol/python-sdk の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·