AbstractBase constructor for a tool.
The parameters for BaseTool.
Readonly[A unique symbol to identify ADK base tool class.
Readonly[Marks this tool as one the model runs itself.
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.
Protected AbstractapplyAdds this tool's configuration to the request.
The request to process the LLM request.
Whether this tool needs a human to approve args before it runs.
The gate itself lives in the tool that owns it (see FunctionTool), but
the resume path has to ask the same question a turn later, to check that an
approval it is about to honour belongs to a tool that gates at all. A tool
that never gates returns false here, which is the safe default: an approval
naming it is meaningless and gets rejected rather than executed. Mirrors
Python's BaseTool.check_require_confirmation.
The arguments the tool would run with.
Optional_toolContext: ContextThe context of the call, when there is one.
Whether the call requires confirmation.
Processes the outgoing LLM request for this tool.
Use cases:
The request to process the LLM request.
Answers a function call the model should not have made. The tool is already configured on the request and its results arrive as grounding metadata, so the model is told to use those rather than call again.
A tool the model runs itself. It is switched on through request parameters — Google Search, URL context, the grounding and retrieval tools — and never executes here.
Such a tool has no function declaration, so
BaseTool.processLlmRequestreturns before the line that registers it inllmRequest.toolsDict. That left the model primed with a name the framework could not route: a model that returns one as an explicit function call, rather than running it, produced a call that failed to resolve even though the user had registered the tool. Registering the name here keeps the call resolvable, andrunAsyncanswers it by telling the model the tool is not callable.A tool whose
applyBuiltInConfigreturns without configuring anything — every one of them does when the request carries no model — still claims its name. That request never reaches a model, so no function call can come back for it and the registration is inert.