pub trait ToolProvider: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn schema(&self) -> &ToolSchema;
fn call(&self, input: Value) -> Result<Value, ToolError>;
// Provided methods
fn call_async<'a>(&'a self, input: Value) -> ToolFuture<'a, Value> { ... }
fn effects(&self) -> Vec<String> { ... }
fn capabilities(&self) -> Vec<Capability> { ... }
}Expand description
A pluggable tool provider. Implementations live in separate crates (e.g. an HTTP provider, an MCP provider, a mock provider).
Required Methods§
Sourcefn schema(&self) -> &ToolSchema
fn schema(&self) -> &ToolSchema
Schema describing the tool this provider exposes.
Provided Methods§
Sourcefn call_async<'a>(&'a self, input: Value) -> ToolFuture<'a, Value>
fn call_async<'a>(&'a self, input: Value) -> ToolFuture<'a, Value>
Async execution hook.
Default implementation preserves backwards compatibility by delegating
to sync call.
Sourcefn capabilities(&self) -> Vec<Capability>
fn capabilities(&self) -> Vec<Capability>
Capabilities supported by this provider (default: empty).