pub trait CallbackContext: ReadonlyContext {
// Required method
fn artifacts(&self) -> Option<Arc<dyn Artifacts>>;
// Provided methods
fn tool_outcome(&self) -> Option<ToolOutcome> { ... }
fn tool_name(&self) -> Option<&str> { ... }
fn tool_input(&self) -> Option<&Value> { ... }
fn shared_state(&self) -> Option<Arc<SharedState>> { ... }
}Required Methods§
Provided Methods§
Sourcefn tool_outcome(&self) -> Option<ToolOutcome>
fn tool_outcome(&self) -> Option<ToolOutcome>
Returns structured metadata about the most recent tool execution.
Available in after-tool callbacks and plugin hooks.
Returns None when not in a tool execution context.
Sourcefn tool_name(&self) -> Option<&str>
fn tool_name(&self) -> Option<&str>
Returns the name of the tool about to be executed. Available in before-tool and after-tool callback contexts.
Sourcefn tool_input(&self) -> Option<&Value>
fn tool_input(&self) -> Option<&Value>
Returns the input arguments for the tool about to be executed. Available in before-tool and after-tool callback contexts.
Returns the shared state for parallel agent coordination.
Returns None when not running inside a ParallelAgent with shared state enabled.