Class McpInputRequiredSignal

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.rest.server.mcp.v20260728.McpInputRequiredSignal
All Implemented Interfaces:
Serializable

Thrown by a handler's ordinary call/get/read body to signal that it needs more input before it can complete (MCP 2026-07-28 SEP-2322 Multi-Round-Trip Requests).

Caught (and turned into an input_required result) only on the three MRTR-wired in-scope paths: McpRevision's callTool/getPrompt/readResource-exact-resource branches. Any other handler path is not MRTR-wired — the resource-template handler, a completion/complete completer, and the list/discover/ping paths all run outside those try/catch blocks. A signal thrown from one of them is not caught here; it propagates to McpRevision.dispatch(org.apache.juneau.rest.server.mcp.McpExchange, org.apache.juneau.rest.server.mcp.McpServerConfig, org.apache.juneau.commons.inject.BeanStore)'s generic error branch and surfaces as the -32603 internal-error fail-safe (a misuse outcome, not an input_required result). This is the spec's Open item #4: MRTR engages by construction only for the three scoped seams, so an out-of-scope pause is a handler bug the fail-safe contains rather than a supported flow.

Deliberately not an McpException: it is not itself a JSON-RPC error, it is an internal dispatch-control signal that gets turned into a successful input_required result.

See Also:
  • Constructor Details

    • McpInputRequiredSignal

      public McpInputRequiredSignal(Map<String,Object> inputRequests, Object continuation)
      Constructor.
      Parameters:
      inputRequests - Server-assigned-id-keyed map of requested inputs. Must not be null or empty. Each value must be a sub-request object (Map, per the pinned schema); it is carried to the wire byte-for-byte (a non-map value is a handler bug the dispatcher's -32603 fail-safe contains).
      continuation - Handler-opaque continuation value. Can be null if the handler needs no state carried between rounds beyond the original request itself.
      Throws:
      IllegalArgumentException - If inputRequests is null or empty.
  • Method Details

    • getInputRequests

      The requested inputs.
      Returns:
      The map. Never null or empty.
    • getContinuation

      The handler-opaque continuation.
      Returns:
      The continuation, or null if the handler supplied none.