Skip to content

[Server] Point a refused gateway request at InputRequiredResult - #606

Merged
chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:server-initiated-request-hint
Oct 18, 2026
Merged

chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:server-initiated-request-hint

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

On 2026-07-28 a handler calling ClientGateway::sample() or listRoots() is told that sampling and roots "were removed" and to take what it needs through tool arguments instead. That's not what the SDK does tho - InputRequiredResult carries both, the client's InputRequestResolver answers them and InputContext has samplingResult()/rootsResult(). The 0.9.0 changelog says the same.

The message now names the request and points at InputRequiredResult.

Ran into it with symfony/mcp-bundle's demo app, which took the message at face value and stopped testing sampling & roots on 2026-07-28.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused guidance correction matches existing SDK APIs and includes regression assertions, with no identified blocking issues.

No open issues 🎉

What changed in this PR

Corrects stateless gateway refusal guidance to point handlers to the SDK’s existing input-resolution flow.

Changes:

  • Names the refused request and recommends InputRequiredResult and RequestContext::getInputContext().
  • Adds assertions checking the request name and replacement guidance.
File Description
tests/​Unit/​Server/​Stateless/​StatelessProtocolTest.php Verifies the updated refusal message.
src/​Server/​Stateless/​StatelessProtocol.php Corrects the exception message and explanatory comment.

Review effort: Balanced

@chr-hertel
chr-hertel merged commit 2d3dc79 into modelcontextprotocol:main Oct 18, 2026
28 checks passed
@chr-hertel
chr-hertel deleted the server-initiated-request-hint branch October 18, 2026 13:24
@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants