Multi-round input and legacy sampling
medium 6 minSometimes a tool cannot finish with its initial arguments.
The server sends a request slip. The host holds the phone.
In the November 2025 protocol, a researcher passes a request slip across a counter. The host checks what may be shared, calls the expert and returns the approved reply.
Video lesson · Chapter 1 of 4
A notebook quote waits for a size
Theory
Read or listen first. About 2 min.
What it is
Sometimes a tool cannot finish with its initial arguments. In July 2026 a multi-round request can return input_required, describing the input it needs. The client handles that request under host policy and retries the original call with inputResponses. The UI might ask the person a question, and the next HTTP request may reach a different replica.
Why it exists
Treat a continuation as a continuation of one business operation. Persist the pending input or provide the applicable state handle, bind it to its owner and revalidate answered fields when resuming. Distinguish collecting information, granting approval and executing an effect. The older server-requested sampling capability let the client obtain a model completion under host control. Sampling is deprecated in the July revision and is taught here as compatibility behavior.
Resume a quote after the buyer chooses a size
Inside this chapter
Chapter sources- Provisional state and multi-round input
- The first result explains what is missing. The host can collect an answer, decline or terminate the interaction. A retry carries the input responses with the original operation. The application decides how pending business data survives process changes.
The tool cannot finish, so instead of guessing it returns input_required and describes what it needs. The client, under host policy, asks the person, then retries the original call with the answers attached as inputResponses. Because the retry may reach a different replica, the server must either keep the pending operation in shared storage or receive enough state with the retry, and it must check the answer again rather than trusting it.
Example. A quote needs a size. Return input_required, ask the buyer once and resume using the answered input. Do not manufacture a default size while waiting.
Another example. A travel booking tool needs a passport country before quoting a fare. It returns input_required, the traveller picks a country, and the retried call quotes the fare; if the traveller closes the dialog, no booking exists.
A quote that waits for one answer
Nothing is committed while the quote waits. Declining ends the flow without a guessed size. - Client-side sampling in compatibility mode
- A November 2025 server could request a completion from a client with negotiated sampling capability. The host controlled model access, shared context and approval. July 2026 deprecates sampling, and reworks the message exchange around multi-round requests.
Sampling let a server borrow the host's model instead of holding its own model credentials. The host stayed in control: it could show the request to the person, cut down what context was shared, pick the model, or refuse. Under the July 2026 revision sampling is deprecated, so treat it as a path for older peers. New tools that only need a missing field should ask for that field directly through multi-round input.
Example. An older peer requests a summary. The host may decline or limit the document sent. A new quote tool can collect a missing size directly without asking a model.
Legacy sampling with the host in charge
November 2025 behaviour with negotiated sampling capability. July 2026 deprecates it. - Retry and effect identity
- Correlate the answered input with the pending operation and the same authorized principal. A network retry or new protocol request ID must not create a second reservation in the business service.
A protocol request ID only correlates one message with its reply. To make retries safe, the business service needs its own idempotency key tied to the operation and the authorised principal. On a repeat, it looks the key up and returns the stored result instead of acting again. Notice the bug in production as duplicate holds or orders that cluster around network blips.
Example. If the quote response is lost after recording Q9, an idempotent retry should recover the recorded outcome, not generate a second stock hold.
A lost reply must not create a second hold
Attempt Protocol request ID Operation key Business result First call 51 quote-op-buyerA-0042 Q9 recorded, 1 stock hold Reply lost none client cannot tell if it worked Retry 52 quote-op-buyerA-0042 Q9 returned, still 1 hold The request ID changes per exchange. The operation key stays with the business operation and its owner. - Collecting, approving and executing
- Gathering a missing input, getting a person's approval and performing an effect are three separate steps. Supplying a size is not consent to buy, and approving a price is not the reservation itself; each step has its own check.
Merging these steps is a common design mistake: a form submission gets treated as permission, or an approval screen silently triggers the effect before the details are final. Keeping them apart makes each one auditable and lets the person decline at the right point.
Example. The buyer answers medium (collection), confirms the quoted price (approval), and only then does the service place the stock hold (execution).
Three steps that do not imply each other
Collect
Ask for the missing size. The answer fills a field and nothing else.
Approve
The buyer confirms price and quantity. This is consent for one specific effect.
Execute
The service places the hold once, under the operation key, after rechecking authority.
November 2025 protocol notes
A server asks the host to summarize two documents
Sampling reverses the direction of a model request. A server asks a capable client to obtain a completion under host control. The connection, the individual request and the business task each require a distinct identity and lifetime.
A server must handle unsupported capability, user refusal and interrupted connections. Treat proposed context as a request to disclose data that the host can restrict, rather than assuming every piece of server-supplied context reaches a provider.
- State Management
- Application state, a transport session and a JSON-RPC request ID serve different purposes. A session can carry multiple requests; it is not proof of user identity. Persist business records separately and re-establish capabilities when a connection is reinitialized. A reconnect changes transport session identity while order 42 remains the same business record. Keep both identifiers separate in logs and storage.
- The Sampling Capability
- With a negotiated sampling capability, a server can ask the client to obtain a model completion. The host retains control over model access, context and approval. A server must handle a declined or unsupported request, and must not assume the client will forward all proposed context. Have a server request a summary of two permitted excerpts. Simulate a host decline and check that the server reports it without disclosing the text elsewhere.
How it works
Step through the idea, or press Play.
Pending quote. Size is missing
Understand it
Worked example
Resume a quote after the buyer chooses a size
- 1
Size is missing
The tool validates the request and returns input_required. The order is still uncommitted.
- 2
Buyer chooses medium
The host asks for the missing field and records the buyer’s answer. Declining the prompt can end the flow.
- 3
Retry includes inputResponses
Another replica verifies the operation and the answer against the same buyer and pending request.
- 4
Commit Q9 once
The service binds the answer to the correct quote and stores one result that can be recovered after a lost reply.
Follow the handoffs
Where each piece of state lives
| Item | Held by | Lifetime |
|---|---|---|
| Pending quote, size missing | business store or a state handle | until answered, declined or expired |
| Buyer's answer, medium | client, sent with the retry as inputResponses | one retry |
| Protocol request IDs | each exchange | one request and its reply |
| Quote Q9 | business store, keyed to the buyer | until it expires or is used |
Summary
The whole topic in one minute.
A request for missing information has produced neither a supplied size nor consent to substitute one.
Treat a continuation as a continuation of one business operation. Persist the pending input or provide the applicable state handle, bind it to its owner and revalidate answered fields when resuming. Distinguish collecting information, granting approval and executing an effect. The older server-requested sampling capability let the client obtain a model completion under host control. Sampling is deprecated in the July revision and is taught here as compatibility behavior.