pub trait ToolExecutor<Invocation>: Send + Sync {
// Required methods
fn tool_name(&self) -> ToolName;
fn spec(&self) -> ToolSpec;
fn handle(
&self,
invocation: Invocation,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ToolOutput>, FunctionCallError>> + Send + '_>>;
// Provided methods
fn exposure(&self) -> ToolExposure { ... }
fn search_info(&self) -> Option<ToolSearchInfo> { ... }
fn supports_parallel_tool_calls(&self) -> bool { ... }
}Expand description
Shared runtime contract for model-visible tools.
Implementations keep the model-visible spec tied to the executable runtime. Host crates can layer routing, hooks, telemetry, or other orchestration on top without reopening the spec/runtime split.
Required Methods§
fn spec(&self) -> ToolSpec
fn handle( &self, invocation: Invocation, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ToolOutput>, FunctionCallError>> + Send + '_>>
Provided Methods§
fn exposure(&self) -> ToolExposure
fn search_info(&self) -> Option<ToolSearchInfo>
fn supports_parallel_tool_calls(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".