[Client] `callTool()` cannot defer `input_required` or send a later retry (MRTR)

Aberta
#767 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@xixi-box já está trabalhando nisso.

Desde 22/11/2026.

  • #769 de @xixi-box — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
30/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
php
Domínio
api

Direção de pesquisa

Read src/Client/Protocol.php around lines 560-627 and MAX_ROUND_TRIPS at line 69 to see how rounds are resolved through the elicitation handlers, then InputRequestResolver.php:145,163 for the message-only exception thrown from the callback. Check the callTool() signature and the linked pull request #769 before starting, since work may already be under way. Done means an opt-out that returns the raw InputRequiredResult plus a retry path accepting inputResponses and requestState, covered by a test against a tool that returns InputRequiredResult.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Package: mcp/sdk 0.9.0; still present in v0.10.0 and main (7155eae)

Repro: $client->callTool('x', [...]) against a tool that returns InputRequiredResult, from a client that wants
to park the request until a human answers hours later.

Actual: Client\Protocol::request() always resolves rounds through the elicitation handlers
(src/Client/Protocol.php:560-627, MAX_ROUND_TRIPS at line 69). requestState is never exposed, and callTool()
takes no inputResponses / requestState. Throwing from the callback gives a message-only RuntimeException
(InputRequestResolver.php:145,163).

Expected: an option to return the raw InputRequiredResult, and a way to send the retry with inputResponses
and requestState. Deferral is what multi-round-trip requests are designed for. I understand automatic resolution
is deliberate (#456); this asks for an opt-out next to it. The Tasks extension (#428) covers task-augmented
requests, not plain MRTR.

Found while building Leash for the Symfony AI & PHP MCP SDK hackathon.

Linguagem predominante
PHP
Estrelas
1.7k
Forks
206
Merge médio
1d 19h
PRs com merge (30d)
100

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de modelcontextprotocol/php-sdk

Todas as issues de modelcontextprotocol/php-sdk

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.