pub struct McpTool { /* private fields */ }Expand description
A supercode Tool backed by a remote MCP tool. The name is namespaced
mcp__<server>__<tool> to match the convention seen in the corpus.
Implementations§
Source§impl McpTool
impl McpTool
Sourcepub async fn from_client(
server: &str,
client: McpClient,
) -> Result<Vec<McpTool>, Error>
pub async fn from_client( server: &str, client: McpClient, ) -> Result<Vec<McpTool>, Error>
Wrap every tool from client (already connected) under server
prefix. Kept for API/test back-compat (P5-1 baseline signature); new
callers that also want resources/prompts/instructions should use
McpServerHandle directly.
Trait Implementations§
Source§impl Tool for McpTool
impl Tool for McpTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
The built-in description. May be overridden via
crate::Config.Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema describing the tool’s input object.
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
McpTool: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
McpTool: 'async_trait,
Run the tool. Returns text to feed back to the model.
Auto Trait Implementations§
impl !RefUnwindSafe for McpTool
impl !UnwindSafe for McpTool
impl Freeze for McpTool
impl Send for McpTool
impl Sync for McpTool
impl Unpin for McpTool
impl UnsafeUnpin for McpTool
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