pub struct AgentToolCapabilities { /* private fields */ }Expand description
Agent tool capabilities
This struct provides agents with access to MCP tools through a unified interface. It combines tool invocation and discovery capabilities.
Implementations§
Source§impl AgentToolCapabilities
impl AgentToolCapabilities
Sourcepub fn new(registry: Arc<ToolRegistry>, invoker: Arc<dyn ToolInvoker>) -> Self
pub fn new(registry: Arc<ToolRegistry>, invoker: Arc<dyn ToolInvoker>) -> Self
Creates a new agent tool capabilities instance
§Arguments
registry- The tool registryinvoker- The tool invoker
Sourcepub fn invoke_tool(
&self,
tool_id: &str,
parameters: HashMap<String, Value>,
) -> Result<Value>
pub fn invoke_tool( &self, tool_id: &str, parameters: HashMap<String, Value>, ) -> Result<Value>
Sourcepub fn get_all_tools(&self) -> Vec<ToolMetadata>
pub fn get_all_tools(&self) -> Vec<ToolMetadata>
Gets all available tools
Sourcepub fn get_tools_by_category(&self, category: &str) -> Vec<ToolMetadata>
pub fn get_tools_by_category(&self, category: &str) -> Vec<ToolMetadata>
Gets tools by category
Sourcepub fn get_tools_by_server(&self, server_id: &str) -> Vec<ToolMetadata>
pub fn get_tools_by_server(&self, server_id: &str) -> Vec<ToolMetadata>
Gets tools by server
Sourcepub fn get_tool(&self, tool_id: &str) -> Option<ToolMetadata>
pub fn get_tool(&self, tool_id: &str) -> Option<ToolMetadata>
Gets a specific tool by ID
Sourcepub fn search_tools(&self, query: &str) -> Vec<ToolMetadata>
pub fn search_tools(&self, query: &str) -> Vec<ToolMetadata>
Searches for tools by name or description
Sourcepub fn tool_count(&self) -> usize
pub fn tool_count(&self) -> usize
Gets the number of available tools
Sourcepub fn get_tool_documentation(&self, tool_id: &str) -> Option<String>
pub fn get_tool_documentation(&self, tool_id: &str) -> Option<String>
Gets tool documentation
Auto Trait Implementations§
impl Freeze for AgentToolCapabilities
impl !RefUnwindSafe for AgentToolCapabilities
impl Send for AgentToolCapabilities
impl Sync for AgentToolCapabilities
impl Unpin for AgentToolCapabilities
impl !UnwindSafe for AgentToolCapabilities
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more