pub struct McpToolCall { /* private fields */ }Expand description
Typed MCP tool call payload passed to registered handlers.
The shared server normalizes protocol-level arguments into this object before dispatch. Domain integrations can then decode fields without repeatedly accepting arbitrary JSON values at every handler boundary.
Implementations§
Source§impl McpToolCall
impl McpToolCall
Sourcepub fn new(arguments: McpToolArguments) -> Self
pub fn new(arguments: McpToolArguments) -> Self
Creates a tool call from normalized MCP arguments.
Sourcepub fn from_value(arguments: Option<Value>) -> Result<Self, McpToolError>
pub fn from_value(arguments: Option<Value>) -> Result<Self, McpToolError>
Converts protocol arguments into a normalized tool call.
§Errors
Returns McpToolError::ArgumentsMustBeObject when arguments is
present but is not a JSON object.
Sourcepub fn arguments(&self) -> &McpToolArguments
pub fn arguments(&self) -> &McpToolArguments
Returns the normalized argument object.
Sourcepub fn into_arguments(self) -> McpArguments
pub fn into_arguments(self) -> McpArguments
Converts this call into an owning argument decoder.
Trait Implementations§
Source§impl Clone for McpToolCall
impl Clone for McpToolCall
Source§impl Debug for McpToolCall
impl Debug for McpToolCall
Source§impl Default for McpToolCall
impl Default for McpToolCall
impl Eq for McpToolCall
Source§impl From<McpToolCall> for McpArguments
impl From<McpToolCall> for McpArguments
Source§fn from(call: McpToolCall) -> Self
fn from(call: McpToolCall) -> Self
Converts to this type from the input type.
Source§impl PartialEq for McpToolCall
impl PartialEq for McpToolCall
impl StructuralPartialEq for McpToolCall
Auto Trait Implementations§
impl Freeze for McpToolCall
impl RefUnwindSafe for McpToolCall
impl Send for McpToolCall
impl Sync for McpToolCall
impl Unpin for McpToolCall
impl UnsafeUnpin for McpToolCall
impl UnwindSafe for McpToolCall
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.