multi_round_trip

command
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL