Class McpToolRegistration.CompleteHandlerStage<A,R>
- Type Parameters:
A- argument typeR- structured output type
- Enclosing class:
McpToolRegistration<A>
handler(McpCompleteToolHandler) selects an operation that
always completes inline with a typed value.
inlineOperationHandler(McpToolHandler) selects an inline advanced
operation that may return explicit content or an isError tool
result. operationHandler(McpToolHandler) selects an advanced
operation that retains the same eventual output schema and is statically
known to require Tasks.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionSupplies the required complete handler.inlineOperationHandler(@NonNull McpToolHandler<@NonNull A> handler) Supplies an inline advanced handler while retaining the typed output schema.operationHandler(@NonNull McpToolHandler<@NonNull A> handler) Supplies the required advanced handler for a task-required operation whose eventual structured output has typeR.
-
Method Details
-
handler
-
inlineOperationHandler
public @NonNull McpToolRegistration.OperationBuilder<@NonNull A> inlineOperationHandler(@NonNull McpToolHandler<@NonNull A> handler) Supplies an inline advanced handler while retaining the typed output schema.The handler returns the
McpOperationResultspine directly, which permits explicit content andisErrortool results. This path is not statically task-required; a successful result must include structured content satisfying the retained output schema.- Parameters:
handler- inline advanced handler- Returns:
- optional-metadata builder
-
operationHandler
public @NonNull McpToolRegistration.OperationBuilder<@NonNull A> operationHandler(@NonNull McpToolHandler<@NonNull A> handler) Supplies the required advanced handler for a task-required operation whose eventual structured output has typeR.Unlike
handler(McpCompleteToolHandler), this handler returns theMcpOperationResultspine directly, includingMcpTaskCreatedResult. Soklet retains the selected output type and schema for deferred completed-result validation and treats this as a task-required registration. A client that did not negotiate the Tasks extension is rejected before the application handler is invoked.- Parameters:
handler- advanced task-required handler- Returns:
- optional-metadata builder
-