pub struct TransformedTool { /* private fields */ }Expand description
A transformed tool that wraps another tool and applies transformations.
Transformations can include:
- Renaming the tool
- Modifying the description
- Transforming arguments (rename, add defaults, hide, etc.)
- Applying a custom transformation function
Implementations§
Source§impl TransformedTool
impl TransformedTool
Sourcepub fn from_tool<H: ToolHandler + 'static>(tool: H) -> TransformedToolBuilder
pub fn from_tool<H: ToolHandler + 'static>(tool: H) -> TransformedToolBuilder
Creates a builder for transforming an existing tool.
Sourcepub fn from_boxed(tool: Box<dyn ToolHandler>) -> TransformedToolBuilder
pub fn from_boxed(tool: Box<dyn ToolHandler>) -> TransformedToolBuilder
Creates a builder from a boxed tool handler.
Sourcepub fn parent_definition(&self) -> Tool
pub fn parent_definition(&self) -> Tool
Returns the parent tool’s definition.
Sourcepub fn arg_transforms(&self) -> &HashMap<String, ArgTransform>
pub fn arg_transforms(&self) -> &HashMap<String, ArgTransform>
Returns the argument transforms.
Trait Implementations§
Source§impl Debug for TransformedTool
impl Debug for TransformedTool
Source§impl ToolHandler for TransformedTool
impl ToolHandler for TransformedTool
Source§fn definition(&self) -> Tool
fn definition(&self) -> Tool
Returns the tool definition.
Source§fn call(&self, ctx: &McpContext, arguments: Value) -> McpResult<Vec<Content>>
fn call(&self, ctx: &McpContext, arguments: Value) -> McpResult<Vec<Content>>
Calls the tool synchronously with the given arguments. Read more
Source§fn call_async<'a>(
&'a self,
ctx: &'a McpContext,
arguments: Value,
) -> BoxFuture<'a, McpOutcome<Vec<Content>>>
fn call_async<'a>( &'a self, ctx: &'a McpContext, arguments: Value, ) -> BoxFuture<'a, McpOutcome<Vec<Content>>>
Calls the tool asynchronously with the given arguments. Read more
Returns the tool’s tags for filtering and organization. Read more
Source§fn annotations(&self) -> Option<&ToolAnnotations>
fn annotations(&self) -> Option<&ToolAnnotations>
Returns the tool’s annotations providing behavioral hints. Read more
Auto Trait Implementations§
impl Freeze for TransformedTool
impl !RefUnwindSafe for TransformedTool
impl Send for TransformedTool
impl Sync for TransformedTool
impl Unpin for TransformedTool
impl !UnwindSafe for TransformedTool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).