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
Source§fn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
Returns the tool’s output schema (JSON Schema). Read more
Source§fn final_title(&self) -> Option<&str>
fn final_title(&self) -> Option<&str>
Returns the final display title for this tool. Read more
Source§fn final_icons(&self) -> Option<&[RawIcon]>
fn final_icons(&self) -> Option<&[RawIcon]>
Returns the validated final icon set for this tool. Read more
Source§fn final_metadata(&self) -> Option<&OpenMetadata>
fn final_metadata(&self) -> Option<&OpenMetadata>
Returns final open metadata for this tool’s catalog entry.
Source§fn final_definition(&self) -> Option<FinalTool>
fn final_definition(&self) -> Option<FinalTool>
Returns an exact final catalog definition when this handler owns one. Read more
Returns the legacy diagnostic label for this handler’s exact-final schemas. Read more
Source§fn upstream_final_tool_schema_registration(
&self,
) -> Option<UpstreamFinalToolSchemaRegistration>
fn upstream_final_tool_schema_registration( &self, ) -> Option<UpstreamFinalToolSchemaRegistration>
Returns a sealed upstream-schema registration for an exact proxy. Read more
Source§fn final_tool_error_structured_content(
&self,
_kind: ToolErrorKind,
) -> Option<Value>
fn final_tool_error_structured_content( &self, _kind: ToolErrorKind, ) -> Option<Value>
Maps a framework-authored tool error into this tool’s structured output. Read more
Source§fn call_final(
&self,
ctx: &McpContext,
arguments: Value,
) -> McpResult<CompleteResult<FinalCallToolResult>>
fn call_final( &self, ctx: &McpContext, arguments: Value, ) -> McpResult<CompleteResult<FinalCallToolResult>>
Calls the tool through the final MCP 2026-07-28 result surface. Read more
Source§fn call_final_async<'a>(
&'a self,
ctx: &'a McpContext,
arguments: Value,
) -> BoxFuture<'a, McpOutcome<CompleteResult<FinalCallToolResult>>>
fn call_final_async<'a>( &'a self, ctx: &'a McpContext, arguments: Value, ) -> BoxFuture<'a, McpOutcome<CompleteResult<FinalCallToolResult>>>
Asynchronously calls the tool through the final result surface. Read more
Source§fn call_async_in_request<'a>(
&'a self,
ctx: &'a McpContext,
_request_cx: &'a Cx,
arguments: Value,
) -> BoxFuture<'a, McpOutcome<Vec<Content>>>
fn call_async_in_request<'a>( &'a self, ctx: &'a McpContext, _request_cx: &'a Cx, arguments: Value, ) -> BoxFuture<'a, McpOutcome<Vec<Content>>>
Calls the tool from a request-owned structured child. Read more
Source§fn call_final_async_in_request<'a>(
&'a self,
ctx: &'a McpContext,
_request_cx: &'a Cx,
arguments: Value,
) -> BoxFuture<'a, McpOutcome<CompleteResult<FinalCallToolResult>>>
fn call_final_async_in_request<'a>( &'a self, ctx: &'a McpContext, _request_cx: &'a Cx, arguments: Value, ) -> BoxFuture<'a, McpOutcome<CompleteResult<FinalCallToolResult>>>
Calls the tool’s final result hook from a request-owned child. Read more
Source§fn declares_final_tasks(&self) -> bool
fn declares_final_tasks(&self) -> bool
Declares whether this handler can return a final Tasks
CreateTask outcome. Read moreSource§fn declares_final_mrtr(&self) -> bool
fn declares_final_mrtr(&self) -> bool
Declares whether this handler can use final MRTR continuations. Read more
Source§fn call_final_outcome(
&self,
ctx: &McpContext,
arguments: Value,
) -> McpResult<FinalToolOutcome>
fn call_final_outcome( &self, ctx: &McpContext, arguments: Value, ) -> McpResult<FinalToolOutcome>
Calls the tool through the final complete, input-required, or task-creation surface. Read more
Source§fn call_final_outcome_async<'a>(
&'a self,
ctx: &'a McpContext,
arguments: Value,
) -> BoxFuture<'a, McpOutcome<FinalToolOutcome>>
fn call_final_outcome_async<'a>( &'a self, ctx: &'a McpContext, arguments: Value, ) -> BoxFuture<'a, McpOutcome<FinalToolOutcome>>
Asynchronously calls the final complete, input-required, or task-creation surface.
Source§fn call_final_outcome_async_in_request<'a>(
&'a self,
ctx: &'a McpContext,
_request_cx: &'a Cx,
arguments: Value,
) -> BoxFuture<'a, McpOutcome<FinalToolOutcome>>
fn call_final_outcome_async_in_request<'a>( &'a self, ctx: &'a McpContext, _request_cx: &'a Cx, arguments: Value, ) -> BoxFuture<'a, McpOutcome<FinalToolOutcome>>
Calls the disjoint final outcome from a request-owned structured child.
Source§fn call_final_outcome_async_resuming_in_request<'a>(
&'a self,
ctx: &'a McpContext,
request_cx: &'a Cx,
arguments: Value,
_resume_inputs: Option<&'a MrtrCompletedInputs>,
) -> BoxFuture<'a, McpOutcome<FinalToolOutcome>>
fn call_final_outcome_async_resuming_in_request<'a>( &'a self, ctx: &'a McpContext, request_cx: &'a Cx, arguments: Value, _resume_inputs: Option<&'a MrtrCompletedInputs>, ) -> BoxFuture<'a, McpOutcome<FinalToolOutcome>>
Resumes a final tool invocation after framework-admitted MRTR input. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TransformedTool
impl !UnwindSafe for TransformedTool
impl Freeze for TransformedTool
impl Send for TransformedTool
impl Sync for TransformedTool
impl Unpin for TransformedTool
impl UnsafeUnpin for TransformedTool
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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).