The constructor acts as the user-friendly factory.
The configuration for the tool.
Readonly[A unique symbol to identify ADK base tool class.
Readonly[A unique symbol to identify ADK function tool class.
ReadonlydescriptionReadonlyisReadonlynameThe Google API LLM variant to use.
Returns the function declaration derived from the tool's name, description, and parameter schema.
Whether this call is gated on human approval — the static flag, or the predicate evaluated against the validated arguments.
The arguments the tool would run with.
OptionaltoolContext: 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.
Invokes the user-defined execute function with the model-provided
arguments, after parsing them when parameters is a Zod object schema.
Any other parameters value is passed through unchecked.
The tool request containing arguments and tool context.
A promise resolving to the function's return value.
A tool that wraps a user-defined function, making it callable by an LLM.
The tool's name, description, and parameter schema are exposed to the model as a function declaration. When the model requests a call, the framework invokes the user-provided
executecallback with the arguments the model produced.Those arguments are checked only when
parametersis a Zod object schema: it is applied withparse(), so a call that does not match is rejected andexecutereceives the parsed value. Keys the schema does not declare are handled however that schema says: a plainz.object()drops them,.passthrough()forwards them,.strict()rejects the call. A plain genaiSchema, or noparametersat all, is shown to the model but is not a runtime guard — the arguments reachexecuteexactly as the model produced them, wrong types and extra keys included. Validate them insideexecuteon that path.