pub struct McpManagerClient { /* private fields */ }Expand description
Manages MCP servers and provides a unified interface for tool discovery and invocation.
Implementations§
Source§impl McpManagerClient
impl McpManagerClient
pub fn new() -> Self
Sourcepub async fn add_server(
&self,
id: &str,
transport: McpTransport,
) -> Result<(), Box<dyn Error>>
pub async fn add_server( &self, id: &str, transport: McpTransport, ) -> Result<(), Box<dyn Error>>
Registers a new MCP server in the registry, and discovers tools from the server.
pub fn set_dangerous_mode_enabled(&self, enabled: bool)
pub fn get_dangerous_mode_enabled(&self) -> bool
Sourcepub async fn list_tools(&self) -> Result<Vec<Tool>, Box<dyn Error>>
pub async fn list_tools(&self) -> Result<Vec<Tool>, Box<dyn Error>>
Lists and caches tools from all connected MCP servers.
pub fn get_latest_tools(&self) -> Vec<Tool>
pub fn get_all_namespaced_tools(&self) -> Vec<Tool>
pub async fn remove_server(&self, id: &str) -> Result<(), Box<dyn Error>>
Sourcepub async fn execute_tool_call(
&self,
tool_name: &str,
tool_call_id: &str,
arguments: Map<String, Value>,
) -> ToolResult
pub async fn execute_tool_call( &self, tool_name: &str, tool_call_id: &str, arguments: Map<String, Value>, ) -> ToolResult
Executes a tool call and returns the result
Sourcepub async fn execute_tool_calls(
&self,
tool_calls: Vec<ToolCall>,
) -> Vec<ToolResult>
pub async fn execute_tool_calls( &self, tool_calls: Vec<ToolCall>, ) -> Vec<ToolResult>
Executes multiple tool calls sequentially and returns the results
Trait Implementations§
Auto Trait Implementations§
impl Freeze for McpManagerClient
impl RefUnwindSafe for McpManagerClient
impl Send for McpManagerClient
impl Sync for McpManagerClient
impl Unpin for McpManagerClient
impl UnwindSafe for McpManagerClient
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