Skip to main content

OnToolErrorCallback

Type Alias OnToolErrorCallback 

Source
pub type OnToolErrorCallback = Box<dyn Fn(Arc<dyn CallbackContext>, Arc<dyn Tool>, Value, String) -> Pin<Box<dyn Future<Output = Result<Option<Value>, AdkError>> + Send>> + Send + Sync>;
Expand description

Core traits and types.

Always available regardless of feature flags. Includes:

  • Agent - The fundamental trait for all agents
  • Tool / Toolset - For extending agents with capabilities
  • Session / State - For managing conversation context
  • Event - For streaming agent responses
  • AdkError / Result - Unified error handling Callback invoked when a tool execution fails (after retries are exhausted).

This is the canonical, framework-level tool-error callback type shared by adk-agent (builder registration) and adk-plugin (plugin hooks).

Returns Ok(Some(value)) to substitute a fallback result as the function response to the LLM, or Ok(None) to let the next callback (or the original error) propagate.

Aliased Typeยง

pub struct OnToolErrorCallback(/* private fields */);