Skip to main content

NativeToolPort

Trait NativeToolPort 

Source
pub trait NativeToolPort: Send + Sync {
    // Required methods
    fn list_tools(
        &self,
    ) -> impl Future<Output = Result<Vec<ToolDescriptor>, ToolError>> + Send;
    fn call_tool(
        &self,
        call: ToolCall,
    ) -> impl Future<Output = Result<ToolResult, ToolError>> + Send;
}
Expand description

Native async tool port — implement this for the cleanest developer experience.

The framework provides a blanket implementation that bridges any NativeToolPort to the dyn-compatible ToolPort.

Required Methods§

Source

fn list_tools( &self, ) -> impl Future<Output = Result<Vec<ToolDescriptor>, ToolError>> + Send

List all available tools.

Source

fn call_tool( &self, call: ToolCall, ) -> impl Future<Output = Result<ToolResult, ToolError>> + Send

Execute a tool call.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§