Interface McpCompleteToolHandler<A,R>

Type Parameters:
A - bound argument type
R - structured result type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Programmatic handler for a tool that always completes with a structured Java result.

Soklet derives the output schema and intrinsic conversion plan from the result type declared by McpToolRegistration.ArgumentTypeStage.argumentAndOutputTypes(Class, Class). A bare String result type is rejected; return prose through an advanced McpToolHandler and McpCompleteResult.fromToolText(String) instead.

For an operation that creates a durable task while retaining its eventual typed output contract, use McpToolRegistration.CompleteHandlerStage.operationHandler(McpToolHandler). For an inline operation that needs explicit content or an isError result while retaining the typed output contract, use McpToolRegistration.CompleteHandlerStage.inlineOperationHandler(McpToolHandler).

Implementations must be safe for concurrent invocation.

Author:
Mark Allen