pub trait ToolHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
args: Value,
extra: RequestHandlerExtra,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn metadata(&self) -> Option<ToolInfo> { ... }
}Expand description
Handler for tool execution.
Required Methods§
Provided Methods§
Implementors§
impl<F> ToolHandler for SimpleTool<F>
Available on non-WebAssembly only.
impl<F> ToolHandler for SyncTool<F>
Available on non-WebAssembly only.
impl<T, F> ToolHandler for TypedSyncTool<T, F>where
T: DeserializeOwned + Send + Sync + 'static,
F: Fn(T, RequestHandlerExtra) -> Result<Value> + Send + Sync,
Available on non-WebAssembly only.
impl<T, F> ToolHandler for TypedTool<T, F>
Available on non-WebAssembly only.
impl<TIn, TOut, F> ToolHandler for TypedToolWithOutput<TIn, TOut, F>
Available on non-WebAssembly only.