Skip to main content

ToolHandler

Trait ToolHandler 

Source
pub trait ToolHandler: Send + Sync {
    // Required methods
    fn side_effect_class(&self) -> SideEffectClass;
    fn call(&self, args: &Value) -> Result<Value>;
}
Expand description

A dispatchable tool. Synchronous for the v1 proxy; the SDKs wrap this in tokio::task::spawn_blocking for async use.

Required Methods§

Source

fn side_effect_class(&self) -> SideEffectClass

The tool’s declared side-effect class. Misclassification is a contract violation by the tool author, not a ledger bug.

Source

fn call(&self, args: &Value) -> Result<Value>

Invoke the tool. Args and result are arbitrary JSON.

Implementors§