pub struct ProxyManager { /* private fields */ }Expand description
Manages multiple upstream MCP proxy connections.
Implementations§
Source§impl ProxyManager
impl ProxyManager
pub fn new() -> Self
pub fn add_client(&mut self, client: McpProxyClient)
pub fn is_empty(&self) -> bool
Sourcepub async fn fetch_all_tools(&mut self) -> Result<()>
pub async fn fetch_all_tools(&mut self) -> Result<()>
Fetch tool lists from all upstream servers.
Sourcepub fn all_tools(&self) -> Vec<ToolDefinition>
pub fn all_tools(&self) -> Vec<ToolDefinition>
Get all proxied tools (with prefixes) from all upstreams.
Sourcepub fn has_tool(&self, tool_name: &str) -> bool
pub fn has_tool(&self, tool_name: &str) -> bool
Check whether a tool name belongs to a proxied upstream.
Sourcepub async fn try_call(
&self,
tool_name: &str,
arguments: Option<Value>,
) -> Option<ToolCallResult>
pub async fn try_call( &self, tool_name: &str, arguments: Option<Value>, ) -> Option<ToolCallResult>
Try to route a tool call to the matching upstream. Returns None if no upstream matches the tool name prefix.
Sourcepub async fn call_by_prefix(
&self,
prefix: &str,
unprefixed_tool_name: &str,
arguments: Option<Value>,
) -> Option<ToolCallResult>
pub async fn call_by_prefix( &self, prefix: &str, unprefixed_tool_name: &str, arguments: Option<Value>, ) -> Option<ToolCallResult>
Call a specific upstream by prefix using the unprefixed tool name. Used by the routing engine when it has already decided the remote executor is the right target for a matched tool (and therefore doesn’t need to rely on the prefixed alias).
Sourcepub fn raw_upstream_catalogue(&self) -> Vec<(String, &[ToolDefinition])>
pub fn raw_upstream_catalogue(&self) -> Vec<(String, &[ToolDefinition])>
Return every upstream’s raw (unprefixed) tool catalogue tagged by prefix. Consumers use this to feed the signature matcher.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyManager
impl !RefUnwindSafe for ProxyManager
impl Send for ProxyManager
impl Sync for ProxyManager
impl Unpin for ProxyManager
impl UnsafeUnpin for ProxyManager
impl !UnwindSafe for ProxyManager
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