Interface HumanConfirmer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
ServerContext.confirmWithHuman(String)),
so replacing the delivery mechanism is a change to one implementation of this interface.
Protocol revisions
The default, elicitation(), sends a server-to-client elicitation/create form
request and blocks the tool call until the answer arrives. That is how every protocol revision the
bundled MCP Java SDK (2.1.0) negotiates works: 2024-11-05, 2025-03-26, 2025-06-18 and 2025-11-25
(form elicitation exists from 2025-06-18; an older client simply declares no elicitation and the
broker fails closed).
Revision 2026-07-28 is stateless and replaces elicitation/create with multi-round-trip
requests: the tool call returns an InputRequiredResult carrying the form and a sealed
requestState, and the client retries the same tools/call with
inputResponses. No GA release of the Java SDK implements it (2.1.0 is the latest GA on
2026-11-12; 2.2.0-M2 carries an experimental io.modelcontextprotocol.modern server). When
a GA SDK does, the swap is:
- an implementation of this interface that, on the first call, returns a "pending" outcome
carrying the form, and on the retry reads the answer from
inputResponses; - in
fabric_confirm_change, the token is consumed on the retry that carries the answer (not on the first round trip), and the compiled-request hash is sealed intorequestStateso the retry is bound to the same request; - the server is built on the SDK's stateless server for clients that negotiate 2026-07-28, keeping this blocking implementation for older clients.
-
Method Summary
Modifier and TypeMethodDescriptionconfirm(ServerContext context, String message, CancellationSignal cancellation) Asks for approval of one action.static HumanConfirmer
-
Method Details
-
confirm
Asks for approval of one action.- Parameters:
context- the server context of the current call (bound exchange, timeouts)message- the prompt: what will be executed and what each answer doescancellation- the current call's signal; a cancel abandons the prompt- Returns:
- what the client reported; never
null. OnlyHumanConfirmation.Status.ACCEPTEDis an approval.
-
elicitation
- Returns:
- the default confirmer: an MCP form elicitation (
elicitation/create) over the exchange bound to the current call, bounded byServerContext.elicitTimeoutMillis()
-