pub struct ToolRegistry { /* private fields */ }Expand description
Registry for plugin-provided tools
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub async fn register_plugin_tool(
&mut self,
plugin_id: String,
plugin: Arc<RwLock<Box<dyn ToolPlugin>>>,
) -> PluginResult<()>
pub async fn register_plugin_tool( &mut self, plugin_id: String, plugin: Arc<RwLock<Box<dyn ToolPlugin>>>, ) -> PluginResult<()>
Register a plugin and its tool
Sourcepub async fn unregister_plugin(&mut self, plugin_id: &str) -> PluginResult<()>
pub async fn unregister_plugin(&mut self, plugin_id: &str) -> PluginResult<()>
Unregister a plugin and its tools
Sourcepub async fn execute_tool(
&self,
tool_name: &str,
arguments: Value,
) -> McpResult<ToolResult>
pub async fn execute_tool( &self, tool_name: &str, arguments: Value, ) -> McpResult<ToolResult>
Execute a tool
Sourcepub fn list_tools(&self) -> Vec<Tool>
pub fn list_tools(&self) -> Vec<Tool>
List all registered tools
Sourcepub fn find_plugin_for_tool(&self, tool_name: &str) -> Option<String>
pub fn find_plugin_for_tool(&self, tool_name: &str) -> Option<String>
Find which plugin provides a tool
Sourcepub fn stats(&self) -> RegistryStats
pub fn stats(&self) -> RegistryStats
Get registry statistics
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ToolRegistry
impl !UnwindSafe for ToolRegistry
impl Freeze for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin for ToolRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].