Class AbstractMcpTool<T>
java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.tools.mcp.AbstractMcpTool<T>
- Type Parameters:
T- The type of the MCP session client.
- Direct Known Subclasses:
McpAsyncTool, McpTool
Base class for MCP tools.
-
Nested Class Summary
Nested classes/interfaces inherited from class BaseTool
BaseTool.ToolArgsConfig, BaseTool.ToolConfig -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Tprotected final McpSessionManagerprotected final io.modelcontextprotocol.spec.McpSchema.Toolprotected final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMcpTool(io.modelcontextprotocol.spec.McpSchema.Tool mcpTool, T mcpSession, McpSessionManager mcpSessionManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionio.modelcontextprotocol.spec.McpSchema.ToolAnnotationsOptional<com.google.genai.types.FunctionDeclaration> Gets theFunctionDeclarationrepresentation of this tool.meta()wrapCallResult(com.fasterxml.jackson.databind.ObjectMapper objectMapper, String mcpToolName, io.modelcontextprotocol.spec.McpSchema.CallToolResult callResult) Methods inherited from class BaseTool
customMetadata, description, fromConfig, longRunning, name, processLlmRequest, runAsync, setCustomMetadata
-
Field Details
-
mcpTool
protected final io.modelcontextprotocol.spec.McpSchema.Tool mcpTool -
mcpSessionManager
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
mcpSession
-
-
Constructor Details
-
AbstractMcpTool
protected AbstractMcpTool(io.modelcontextprotocol.spec.McpSchema.Tool mcpTool, T mcpSession, McpSessionManager mcpSessionManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
annotations
public io.modelcontextprotocol.spec.McpSchema.ToolAnnotations annotations() -
meta
-
getMcpSession
-
declaration
Description copied from class:BaseToolGets theFunctionDeclarationrepresentation of this tool.- Overrides:
declarationin classBaseTool
-
wrapCallResult
-