pub struct McpToolWrapper { /* private fields */ }Expand description
MCP tool wrapper that implements the Tool trait
Implementations§
Source§impl McpToolWrapper
impl McpToolWrapper
Sourcepub fn new(
server_name: String,
mcp_tool: McpTool,
manager: Arc<McpManager>,
) -> Self
pub fn new( server_name: String, mcp_tool: McpTool, manager: Arc<McpManager>, ) -> Self
Create a new MCP tool wrapper
Sourcepub fn server_name(&self) -> &str
pub fn server_name(&self) -> &str
Get the server name
Sourcepub fn mcp_tool_name(&self) -> &str
pub fn mcp_tool_name(&self) -> &str
Get the original MCP tool name
Trait Implementations§
Source§impl Tool for McpToolWrapper
impl Tool for McpToolWrapper
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description for LLM
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for tool parameters
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 Value,
_ctx: &'life2 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 Value,
_ctx: &'life2 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute the tool with given arguments
Auto Trait Implementations§
impl Freeze for McpToolWrapper
impl !RefUnwindSafe for McpToolWrapper
impl Send for McpToolWrapper
impl Sync for McpToolWrapper
impl Unpin for McpToolWrapper
impl UnsafeUnpin for McpToolWrapper
impl !UnwindSafe for McpToolWrapper
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