`ClientSessionGroup` has no routed `read_resource` / `get_prompt` (only `call_tool`)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 65/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- backend-api-design
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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"})
- Linguagem predominante
- Python
- Estrelas
- 24.3k
- Forks
- 4k
- Merge médio
- 1d 16h
- PRs com merge (30d)
- 25
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de modelcontextprotocol/python-sdk
-
v1 v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
modelcontextprotocol/python-sdk#3578 · 1 comentário ·
-
v1 v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
modelcontextprotocol/python-sdk#3573 · 2 comentários ·
-
v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
modelcontextprotocol/python-sdk#3566 ·
-
v1 v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
modelcontextprotocol/python-sdk#3546 · 5 comentários ·
-
v1 v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
modelcontextprotocol/python-sdk#3545 · 2 comentários ·
Todas as issues de modelcontextprotocol/python-sdk
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
stephrobert/dsoxlab#238 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
sublimehq/package_control#1780 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
nwg-piotr/nwg-displays#145 ·