ReadonlydescriptionReadonlyisReadonlynameThe Google API LLM variant to use.
Gets the OpenAPI specification of this tool in the form of a FunctionDeclaration.
NOTE
processLlmRequest to add function declaration to LLM request.The FunctionDeclaration of this tool, or undefined if it doesn't need to be added to LlmRequest.config.
Processes the outgoing LLM request for this tool.
Use cases:
The request to process the LLM request.
Runs the tool with the given arguments and context.
NOTE
The request to run the tool.
A promise that resolves to the tool response.
Represents a tool exposed via the Model Context Protocol (MCP).
This class acts as a wrapper around a tool definition received from an MCP server. It translates the MCP tool's schema into a format compatible with the Gemini AI platform (FunctionDeclaration) and handles the remote execution of the tool by communicating with the MCP server through an MCPSessionManager.
When an LLM decides to call this tool, the
runAsyncmethod will be invoked, which in turn establishes an MCP session, sends acallToolrequest with the provided arguments, and returns the result from the remote tool.