pub struct McpToolRouter { /* private fields */ }Expand description
A mapping from tool name prefix to MCP server name.
When the agent issues a tool_call, the routing layer checks this
mapping to determine which MCP server should handle the call. Tools
that don’t match any prefix are treated as native (non-MCP) tools
and are handled by the local ToolRegistry.
Implementations§
Source§impl McpToolRouter
impl McpToolRouter
Sourcepub fn register_server(&mut self, server_name: &str, tool_names: &[String])
pub fn register_server(&mut self, server_name: &str, tool_names: &[String])
Register tools from a server. The tool_names are the raw tool names
(without the mcp__server__ prefix), and they are stored as-is for
exact-match routing. Callers should also register prefixed names
(e.g. mcp__server__tool_name) for MCP-prefixed dispatch.
Trait Implementations§
Source§impl Clone for McpToolRouter
impl Clone for McpToolRouter
Source§impl Debug for McpToolRouter
impl Debug for McpToolRouter
Auto Trait Implementations§
impl Freeze for McpToolRouter
impl RefUnwindSafe for McpToolRouter
impl Send for McpToolRouter
impl Sync for McpToolRouter
impl Unpin for McpToolRouter
impl UnsafeUnpin for McpToolRouter
impl UnwindSafe for McpToolRouter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.