pub struct McpTypedTool<Input> { /* private fields */ }Expand description
Tool definition paired with the typed MCP input it was built from.
McpServer::add_typed_tool consumes this wrapper so a typed handler cannot
accidentally be registered with another input type’s schema.
Implementations§
Source§impl<Input> McpTypedTool<Input>
impl<Input> McpTypedTool<Input>
Sourcepub fn definition(&self) -> &ToolDefinition
pub fn definition(&self) -> &ToolDefinition
Returns the wrapped MCP tool definition.
Sourcepub fn definition_mut(&mut self) -> &mut ToolDefinition
pub fn definition_mut(&mut self) -> &mut ToolDefinition
Returns the wrapped MCP tool definition mutably.
Sourcepub fn into_definition(self) -> ToolDefinition
pub fn into_definition(self) -> ToolDefinition
Returns the wrapped MCP tool definition.
Methods from Deref<Target = ToolDefinition>§
Sourcepub fn schema_as_json_value(&self) -> Value
pub fn schema_as_json_value(&self) -> Value
Get the schema as json value
Trait Implementations§
Source§impl<Input> AsRef<Tool> for McpTypedTool<Input>
impl<Input> AsRef<Tool> for McpTypedTool<Input>
Source§fn as_ref(&self) -> &ToolDefinition
fn as_ref(&self) -> &ToolDefinition
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<Input: Clone> Clone for McpTypedTool<Input>
impl<Input: Clone> Clone for McpTypedTool<Input>
Auto Trait Implementations§
impl<Input> Freeze for McpTypedTool<Input>
impl<Input> RefUnwindSafe for McpTypedTool<Input>
impl<Input> Send for McpTypedTool<Input>
impl<Input> Sync for McpTypedTool<Input>
impl<Input> Unpin for McpTypedTool<Input>
impl<Input> UnsafeUnpin for McpTypedTool<Input>
impl<Input> UnwindSafe for McpTypedTool<Input>
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