pub struct DynamicToolRegistry { /* private fields */ }Expand description
A thread-safe, cloneable handle for runtime tool management.
Obtained from McpRouter::with_dynamic_tools().
Tools registered here are merged with the router’s static tools when
handling tools/list and tools/call requests.
When a tool is registered or unregistered, all connected sessions receive a
notifications/tools/list_changed notification.
Implementations§
Source§impl DynamicToolRegistry
impl DynamicToolRegistry
Sourcepub fn register(&self, tool: Tool)
pub fn register(&self, tool: Tool)
Register a tool, replacing any existing tool with the same name.
Broadcasts ToolsListChanged to all connected sessions.
Sourcepub fn unregister(&self, name: &str) -> bool
pub fn unregister(&self, name: &str) -> bool
Unregister a tool by name.
Returns true if the tool existed and was removed.
Broadcasts ToolsListChanged only if the tool was actually removed.
Trait Implementations§
Source§impl Clone for DynamicToolRegistry
impl Clone for DynamicToolRegistry
Source§fn clone(&self) -> DynamicToolRegistry
fn clone(&self) -> DynamicToolRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicToolRegistry
impl RefUnwindSafe for DynamicToolRegistry
impl Send for DynamicToolRegistry
impl Sync for DynamicToolRegistry
impl Unpin for DynamicToolRegistry
impl UnsafeUnpin for DynamicToolRegistry
impl UnwindSafe for DynamicToolRegistry
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