pub trait ToolBox:
Send
+ Sync
+ DynClone {
// Required method
fn available_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<dyn Tool>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn name(&self) -> Cow<'_, str> { ... }
fn boxed<'a>(self) -> Box<dyn ToolBox + 'a>
where Self: Sized + 'a { ... }
}
Expand description
A toolbox is a collection of tools
It can be a list, an mcp client, or anything else we can think of.
This allows agents to not know their tools when they are created, and to get them at runtime.
It also allows for tools to be dynamically loaded and unloaded, etc.