pub struct CallToolRequest {
pub id: RequestId,
pub params: CallToolRequestParams,
/* private fields */
}Expand description
Used by the client to invoke a tool provided by the server.
JSON schema
{
"description": "Used by the client to invoke a tool provided by the server.",
"type": "object",
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"properties": {
"id": {
"$ref": "#/$defs/RequestId"
},
"jsonrpc": {
"type": "string",
"const": "2.0"
},
"method": {
"type": "string",
"const": "tools/call"
},
"params": {
"$ref": "#/$defs/CallToolRequestParams"
}
}
}Fields§
§id: RequestId§params: CallToolRequestParamsImplementations§
Source§impl CallToolRequest
impl CallToolRequest
pub fn new(id: RequestId, params: CallToolRequestParams) -> Self
pub fn jsonrpc(&self) -> &String
pub fn method(&self) -> &String
Sourcepub fn method_value() -> &'static str
pub fn method_value() -> &'static str
returns “tools/call”
pub fn method_name() -> &'static str
👎Deprecated since 0.8.0: Use
method_value() instead.Source§impl CallToolRequest
impl CallToolRequest
Sourcepub fn tool_name(&self) -> &str
pub fn tool_name(&self) -> &str
Retrieves the name of the tool from the request parameters.
This method provides access to the tool name stored within the params field
of the CallToolRequest struct, returning it as a string reference.
§Returns
A reference to the string containing the tool’s name.
Trait Implementations§
Source§impl Clone for CallToolRequest
impl Clone for CallToolRequest
Source§fn clone(&self) -> CallToolRequest
fn clone(&self) -> CallToolRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CallToolRequest
impl Debug for CallToolRequest
Source§impl<'de> Deserialize<'de> for CallToolRequest
impl<'de> Deserialize<'de> for CallToolRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CallToolRequest> for ClientRequest
impl From<CallToolRequest> for ClientRequest
Source§fn from(value: CallToolRequest) -> Self
fn from(value: CallToolRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CallToolRequest
impl RefUnwindSafe for CallToolRequest
impl Send for CallToolRequest
impl Sync for CallToolRequest
impl Unpin for CallToolRequest
impl UnwindSafe for CallToolRequest
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