Interface AsyncToolFn
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Asynchronous tool function. Unlike
ToolFn, apply(dev.tachyonmcp.api.runtime.InteractionContext, dev.tachyonmcp.api.server.features.tools.ToolRequest) does not throw checked
exceptions — failures propagate through the returned CompletionStage, matching
AsyncResourceFn and AsyncPromptFn.
Receives the full ToolRequest — call ToolRequest.arguments() for parsed
Args, or read ToolRequest.progressToken()
or ToolRequest.task() directly when needed.
- Author:
- Konstantin Pavlov
-
Method Summary
Modifier and TypeMethodDescriptionCompletionStage<? extends ToolResult> apply(InteractionContext ctx, ToolRequest request) Executes the tool function asynchronously with the given request.
-
Method Details
-
apply
Executes the tool function asynchronously with the given request.- Parameters:
ctx- the interaction contextrequest- the tool request containing arguments and metadata- Returns:
- a future that completes with the tool result
-