pub trait ToolLifecycleContributor: Send + Sync {
// Provided methods
fn on_tool_start<'a>(
&'a self,
_input: ToolStartInput<'a>,
) -> ToolLifecycleFuture<'a> { ... }
fn on_tool_finish<'a>(
&'a self,
_input: ToolFinishInput<'a>,
) -> ToolLifecycleFuture<'a> { ... }
}Expand description
Contributor for host-owned tool lifecycle gates.
Implementations should use these callbacks to observe tool execution without
inspecting or rewriting tool input/output. Use ToolContributor for owning a
tool implementation and hooks for policy that needs tool payloads.
Provided Methods§
Sourcefn on_tool_start<'a>(
&'a self,
_input: ToolStartInput<'a>,
) -> ToolLifecycleFuture<'a>
fn on_tool_start<'a>( &'a self, _input: ToolStartInput<'a>, ) -> ToolLifecycleFuture<'a>
Called once the host has accepted a tool call for execution.
Sourcefn on_tool_finish<'a>(
&'a self,
_input: ToolFinishInput<'a>,
) -> ToolLifecycleFuture<'a>
fn on_tool_finish<'a>( &'a self, _input: ToolFinishInput<'a>, ) -> ToolLifecycleFuture<'a>
Called after the tool call returns, is blocked, fails, or is cancelled.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".