Skip to main content

ToolExecutor

Trait ToolExecutor 

Source
pub trait ToolExecutor: Send + Sync {
    // Required method
    fn call<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        arguments: Value,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Executes an MCP tool call on behalf of the host agentic loop (MCP_SKILLS.md §6). The trait seam keeps the worker adapters MCP-agnostic: an API worker holds a dyn ToolExecutor and calls it when the model emits a tool call; the concrete implementation (over a warm MCP connection pool) lives in the wiring layer.

Required Methods§

Source

fn call<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, arguments: Value, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invoke a tool by its qualified id (server.tool) with JSON arguments, returning the result rendered as text for the model to read. An error is returned as a string the loop feeds back so the model can recover.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§