pub struct MCPToolExecutor { /* private fields */ }Expand description
Tool executor that delegates to MCP servers
Implementations§
Source§impl MCPToolExecutor
impl MCPToolExecutor
pub fn new() -> Self
Sourcepub async fn add_server(&self, client: MCPClient) -> Result<()>
pub async fn add_server(&self, client: MCPClient) -> Result<()>
Add an MCP server
Sourcepub async fn list_all_tools(&self) -> Result<Vec<(String, Vec<ToolInfo>)>>
pub async fn list_all_tools(&self) -> Result<Vec<(String, Vec<ToolInfo>)>>
List all available tools from all connected MCP servers
Sourcepub async fn get_llm_tools(&self) -> Result<Vec<Tool>>
pub async fn get_llm_tools(&self) -> Result<Vec<Tool>>
Get all tools from all connected MCP servers in LLM format
Sourcepub async fn execute_tool(
&self,
tool_name: &str,
arguments: Value,
) -> Result<Vec<ToolResponse>>
pub async fn execute_tool( &self, tool_name: &str, arguments: Value, ) -> Result<Vec<ToolResponse>>
Execute a tool by finding the right MCP server
Auto Trait Implementations§
impl Freeze for MCPToolExecutor
impl !RefUnwindSafe for MCPToolExecutor
impl Send for MCPToolExecutor
impl Sync for MCPToolExecutor
impl Unpin for MCPToolExecutor
impl !UnwindSafe for MCPToolExecutor
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