Interface ToolHandler
- All Superinterfaces:
ServerFeature<ToolDescriptor>
- All Known Implementing Classes:
AbstractToolHandler,EchoToolHandler,YouComSearchTool
Experimental class-based tool handler escape hatch.
Prefer Tools.register(ToolDescriptor, ToolFn) or Tools.registerAsync(ToolDescriptor, AsyncToolFn). Implement this interface only when a
class-based handler is required.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.tachyonmcp.api.server.ServerFeature
ServerFeature.Descriptor, ServerFeature.Request -
Method Summary
Modifier and TypeMethodDescriptionReturns the tool descriptor.CompletionStage<? extends ToolResult> handleAsync(InteractionContext context, ToolRequest request) Handles a tool request asynchronously.
-
Method Details
-
descriptor
ToolDescriptor descriptor()Returns the tool descriptor.- Specified by:
descriptorin interfaceServerFeature<ToolDescriptor>- Returns:
- the tool descriptor
-
handleAsync
Handles a tool request asynchronously.- Parameters:
context- the interaction contextrequest- the tool request- Returns:
- the pending tool result
-