pub struct McpToolAdapter { /* private fields */ }Expand description
Adapter exposing an MCP tool as an agentkit Tool.
Implementations§
Source§impl McpToolAdapter
impl McpToolAdapter
Sourcepub fn new(
server_id: &McpServerId,
connection: Arc<McpConnection>,
tool: McpTool,
) -> Self
pub fn new( server_id: &McpServerId, connection: Arc<McpConnection>, tool: McpTool, ) -> Self
Creates a new tool adapter for the given MCP tool, using the
McpToolNamespace::Default naming strategy.
Sourcepub fn with_namespace(
server_id: &McpServerId,
connection: Arc<McpConnection>,
tool: McpTool,
namespace: &McpToolNamespace,
) -> Self
pub fn with_namespace( server_id: &McpServerId, connection: Arc<McpConnection>, tool: McpTool, namespace: &McpToolNamespace, ) -> Self
Creates a new tool adapter with a custom name-namespacing strategy.
Trait Implementations§
Source§impl Tool for McpToolAdapter
impl Tool for McpToolAdapter
Source§fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: ToolRequest,
_ctx: &'life1 mut ToolContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: ToolRequest,
_ctx: &'life1 mut ToolContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Executes the tool and returns a result or error. Read more
Source§fn current_spec(&self) -> Option<ToolSpec>
fn current_spec(&self) -> Option<ToolSpec>
Returns the current specification for this tool, if it should be
advertised right now. Read more
Source§fn proposed_requests(
&self,
_request: &ToolRequest,
) -> Result<Vec<Box<dyn PermissionRequest>>, ToolError>
fn proposed_requests( &self, _request: &ToolRequest, ) -> Result<Vec<Box<dyn PermissionRequest>>, ToolError>
Source§fn invoke_outcome<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: ToolRequest,
ctx: &'life1 mut ToolContext<'life2>,
) -> Pin<Box<dyn Future<Output = ToolExecutionOutcome> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn invoke_outcome<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: ToolRequest,
ctx: &'life1 mut ToolContext<'life2>,
) -> Pin<Box<dyn Future<Output = ToolExecutionOutcome> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Executes the tool and may return an interruption directly. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for McpToolAdapter
impl !UnwindSafe for McpToolAdapter
impl Freeze for McpToolAdapter
impl Send for McpToolAdapter
impl Sync for McpToolAdapter
impl Unpin for McpToolAdapter
impl UnsafeUnpin for McpToolAdapter
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