McpTool

Initializes an MCP tool.

This wraps an MCP Tool interface and an active MCP Session. It invokes the MCP Tool through executing the tool from remote MCP Session.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val annotations: McpSchema.ToolAnnotations?
Link copied to clipboard

The custom metadata of the tool.

Link copied to clipboard

The description of the tool.

Link copied to clipboard
val isLongRunning: Boolean = false

Whether the tool's final result will be delivered out-of-band. When true, the framework marks the call as long-running and uses the tool's return value as the function-response payload (or suppresses the response entirely if the tool returns Unit).

Link copied to clipboard
val mcpSessionClient: McpAsyncClient
Link copied to clipboard
val meta: Map<String, Any>?
Link copied to clipboard

The name of the tool.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun declaration(): FunctionDeclaration?

Returns the underlying function declaration.

Link copied to clipboard
open suspend fun processLlmRequest(toolContext: ToolContext, llmRequest: LlmRequest): LlmRequest

Processes the LLM request before it is sent.

Link copied to clipboard
open suspend override fun run(context: ToolContext, args: Map<String, Any>): Any

Executes the tool.