Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
ToolRegistry
Defined in the tools module.
Rust AI Agent SDK
Registry for managing tools
Fields
| Name | Type | Description |
|---|
tools | HashMap<String | - |
Methods
new
Create a new empty registry
register
fn register(&mut self, tool: impl Tool + 'static) -> ()
Register a tool
Parameters:
| Name | Type |
|---|
tool | impl Tool + 'static |
get
fn get(&self, name: &str) -> Option<Arc<dyn Tool>>
Get a tool by name
Parameters:
has
fn has(&self, name: &str) -> bool
Check if a tool exists
Parameters:
list
fn list(&self) -> Vec<&str>
List all tool names
definitions
fn definitions(&self) -> Vec<ToolDefinition>
Get all tool definitions
execute
async fn execute(&self, name: &str, args: Value) -> Result<ToolResult>
Execute a tool by name
Parameters:
| Name | Type |
|---|
name | &str |
args | Value |
len
Get the number of registered tools
is_empty
fn is_empty(&self) -> bool
Check if the registry is empty
Source
View on GitHub
praisonai/src/tools/mod.rs at line 101