Skip to main content

TransformedTool

Struct TransformedTool 

Source
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

Source

pub fn from_tool<H: ToolHandler + 'static>(tool: H) -> TransformedToolBuilder

Creates a builder for transforming an existing tool.

Source

pub fn from_boxed(tool: Box<dyn ToolHandler>) -> TransformedToolBuilder

Creates a builder from a boxed tool handler.

Source

pub fn parent_definition(&self) -> Tool

Returns the parent tool’s definition.

Source

pub fn arg_transforms(&self) -> &HashMap<String, ArgTransform>

Returns the argument transforms.

Trait Implementations§

Source§

impl Debug for TransformedTool

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ToolHandler for TransformedTool

Source§

fn definition(&self) -> Tool

Returns the tool definition.
Source§

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>>>

Calls the tool asynchronously with the given arguments. Read more
Source§

fn icon(&self) -> Option<&Icon>

Returns the tool’s icon, if any. Read more
Source§

fn version(&self) -> Option<&str>

Returns the tool’s version, if any. Read more
Source§

fn tags(&self) -> &[String]

Returns the tool’s tags for filtering and organization. Read more
Source§

fn annotations(&self) -> Option<&ToolAnnotations>

Returns the tool’s annotations providing behavioral hints. Read more
Source§

fn output_schema(&self) -> Option<Value>

Returns the tool’s output schema (JSON Schema). Read more
Source§

fn final_title(&self) -> Option<&str>

Returns the final display title for this tool. Read more
Source§

fn final_icons(&self) -> Option<&[RawIcon]>

Returns the validated final icon set for this tool. Read more
Source§

fn final_metadata(&self) -> Option<&OpenMetadata>

Returns final open metadata for this tool’s catalog entry.
Source§

fn final_definition(&self) -> Option<FinalTool>

Returns an exact final catalog definition when this handler owns one. Read more
Source§

fn final_tool_schema_authority(&self) -> FinalToolSchemaAuthority

Returns the legacy diagnostic label for this handler’s exact-final schemas. Read more
Source§

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>

Maps a framework-authored tool error into this tool’s structured output. Read more
Source§

fn timeout(&self) -> Option<Duration>

Returns the tool’s custom timeout duration. Read more
Source§

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>>>

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>>>

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>>>

Calls the tool’s final result hook from a request-owned child. Read more
Source§

fn declares_final_tasks(&self) -> bool

Declares whether this handler can return a final Tasks CreateTask outcome. Read more
Source§

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>

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>>

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>>

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>>

Resumes a final tool invocation after framework-admitted MRTR input. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more