Skip to main content

ToolRegistry

Trait ToolRegistry 

Source
pub trait ToolRegistry: Send + Sync {
    // Required methods
    fn schemas(&self) -> Vec<ToolSchema>;
    fn get(&self, name: &str) -> Option<Arc<dyn Tool>>;
}
Expand description

Abstraction for a tool registry.

Both the process-level registry (owned by AgentCore, for built-in tools) and the session-level registry (owned by Session, for MCP tools) share the same shape; the turn main loop looks up tools through the composite registry exposed by Session.

Required Methods§

Source

fn schemas(&self) -> Vec<ToolSchema>

Return the schemas of all tools in the registry, used to populate the tools field of an LLM request.

Source

fn get(&self, name: &str) -> Option<Arc<dyn Tool>>

Looks up a tool by name.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§