Class ElicitationResponses
2026-07-28 SEP-2322
elicitation requests back into the raw inputResponses wire shape a resume call expects (MRTR,
the Multi-Round-Trip Requests loop, client side).
Paired with ElicitationRequests, which reads the server's questions out of a paused
McpClient.callRaw(java.lang.String, org.apache.juneau.bean.mcp.v20260728.RequestParams<?>) result — the same ElicitationRequests/ElicitationResponses
split the server side already uses (server ElicitationRequests builds the pause signal; server
ElicitationResponses reads the resumed answers).
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptiontoInputResponse(String id, ElicitResult result) Encodes a single typedElicitResultinto the rawinputResponsespayload shape.toInputResponses(Map<String, ElicitResult> results) Encodes several typedElicitResults into the rawinputResponsespayload shape a resume call's request bean expects (e.g.
-
Method Details
-
toInputResponse
Encodes a single typedElicitResultinto the rawinputResponsespayload shape.- Parameters:
id- The server-assigned id this answer responds to. Must not benull .result- The typed answer. Must not benull .- Returns:
- A single-entry map ready to pass to
toInputResponses(Map)'s multi-answer form, or to hand directly to a concrete request bean'ssetInputResponses(...)after merging with other answers. - Throws:
IllegalArgumentException- Ifidorresultisnull .
-
toInputResponses
Encodes several typedElicitResults into the rawinputResponsespayload shape a resume call's request bean expects (e.g.CallToolRequest.setInputResponses(...)).Unlike
ElicitationRequests.of(Map,Object)(server side), an emptyresultsmap is accepted (returning an empty map), not rejected — deliberately asymmetric, since a caller may legitimately resume with zero elicitation answers if a round only carried non-elicitation MRTR pauses, whereas building a signal with zero questions server-side would be a pointless pause.- Parameters:
results- Server-assigned-id-keyed typed answers. Must not benull , and no value may benull . Output iteration order mirrors this map's order, so a caller wanting deterministic ordering should pass aLinkedHashMap.- Returns:
- A keyed map of raw, wire-shaped answers. Never
null (empty ifresultswas empty). - Throws:
IllegalArgumentException- Ifresultsisnull , or any value in it isnull .
-