Behaviour for ADK tools.
Tools are functions that agents can call during execution. Each tool
provides a declaration (JSON Schema) for the LLM, and a run/3 function
for actual execution.
Summary
Callbacks
Returns the tool's function declaration for the LLM.
Returns a human-readable description of the tool.
Returns whether this tool is long-running (async).
Returns the tool's unique name.
Executes the tool with the given context and arguments.
Functions
Calls declaration/1 on any tool struct via its implementing module.
Calls description/1 on any tool struct via its implementing module.
Returns whether a tool is long-running.
Calls name/1 on any tool struct via its implementing module.
Calls run/3 on any tool struct via its implementing module.
Callbacks
Returns the tool's function declaration for the LLM.
Returns a map with "name", "description", and "parameters" (JSON Schema).
Returns a human-readable description of the tool.
Returns whether this tool is long-running (async).
Returns the tool's unique name.
@callback run(tool :: struct(), context :: ADK.Tool.Context.t(), args :: map()) :: {:ok, map()} | {:error, term()}
Executes the tool with the given context and arguments.
Returns {:ok, result_map} on success or {:error, reason} on failure.
Functions
Calls declaration/1 on any tool struct via its implementing module.
Calls description/1 on any tool struct via its implementing module.
Returns whether a tool is long-running.
Calls name/1 on any tool struct via its implementing module.
@spec run(struct(), ADK.Tool.Context.t(), map()) :: {:ok, map()} | {:error, term()}
Calls run/3 on any tool struct via its implementing module.