Documentation
¶
Overview ¶
Command multi_round_trip demonstrates the multi round-trip request pattern introduced in MCP protocol version 2026-07-28 (SEP-2322).
A tool that needs something from the user mid-call cannot send the client a request on a stateless protocol, so it returns the requests it needs answered instead. The client fulfils them and retries the original call with the answers attached, and an opaque request state echoed back so the handler can resume where it left off.
The handler below is written once and serves clients of either protocol era: against a client predating this revision, mcp-go issues the elicitation/create that client understands and re-invokes the handler with the answer.
Run it with:
go run ./examples/multi_round_trip