Context passed to tool execution.
Wraps a CallbackContext and adds function_call_id and its own
Actions. Each tool call gets its own ToolContext with independent
actions that are merged after all tool calls complete.
Summary
Functions
Returns the agent name from the underlying callback context.
Gets a value from session state, checking tool actions then callback actions then session.
Lists artifact filenames for the current session.
Loads an artifact by filename. Version 0 (default) loads the latest.
Creates a new tool context from a callback context and function call ID.
Saves an artifact and tracks it in the tool's artifact_delta.
Searches memory for entries matching the query.
Sets a value in the tool actions state_delta.
Types
@type t() :: %ADK.Tool.Context{ actions: ADK.Event.Actions.t(), callback_context: ADK.Agent.CallbackContext.t(), function_call_id: String.t() | nil }
Functions
Returns the agent name from the underlying callback context.
Gets a value from session state, checking tool actions then callback actions then session.
Lists artifact filenames for the current session.
@spec load_artifact(t(), String.t(), non_neg_integer()) :: {:ok, ADK.Types.Part.t()} | {:error, term()}
Loads an artifact by filename. Version 0 (default) loads the latest.
@spec new(ADK.Agent.CallbackContext.t(), String.t() | nil) :: t()
Creates a new tool context from a callback context and function call ID.
@spec save_artifact(t(), String.t(), ADK.Types.Part.t()) :: {:ok, non_neg_integer(), t()} | {:error, term()}
Saves an artifact and tracks it in the tool's artifact_delta.
Returns {:ok, version, updated_context} or {:error, reason}.
@spec search_memory(t(), String.t()) :: {:ok, [ADK.Memory.Entry.t()]}
Searches memory for entries matching the query.
Sets a value in the tool actions state_delta.