pub struct ToolUseContent {
pub id: String,
pub input: Map<String, Value>,
pub meta: Option<Map<String, Value>>,
pub name: String,
/* private fields */
}Expand description
A request from the assistant to call a tool.
JSON schema
{
"description": "A request from the assistant to call a tool.",
"type": "object",
"required": [
"id",
"input",
"name",
"type"
],
"properties": {
"_meta": {
"description": "Optional metadata about the tool use. Clients SHOULD preserve this field when\nincluding tool uses in subsequent sampling requests to enable caching optimizations.\n\nSee [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
"type": "object",
"additionalProperties": {}
},
"id": {
"description": "A unique identifier for this tool use.\n\nThis ID is used to match tool results to their corresponding tool uses.",
"type": "string"
},
"input": {
"description": "The arguments to pass to the tool, conforming to the tool's input schema.",
"type": "object",
"additionalProperties": {}
},
"name": {
"description": "The name of the tool to call.",
"type": "string"
},
"type": {
"type": "string",
"const": "tool_use"
}
}
}Fields§
§id: StringA unique identifier for this tool use. This ID is used to match tool results to their corresponding tool uses.
input: Map<String, Value>The arguments to pass to the tool, conforming to the tool’s input schema.
meta: Option<Map<String, Value>>Optional metadata about the tool use. Clients SHOULD preserve this field when including tool uses in subsequent sampling requests to enable caching optimizations. See General fields: _meta for notes on _meta usage.
name: StringThe name of the tool to call.
Implementations§
Trait Implementations§
Source§impl Clone for ToolUseContent
impl Clone for ToolUseContent
Source§fn clone(&self) -> ToolUseContent
fn clone(&self) -> ToolUseContent
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 ToolUseContent
impl Debug for ToolUseContent
Source§impl<'de> Deserialize<'de> for ToolUseContent
impl<'de> Deserialize<'de> for ToolUseContent
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<ToolUseContent> for CreateMessageContent
impl From<ToolUseContent> for CreateMessageContent
Source§fn from(value: ToolUseContent) -> Self
fn from(value: ToolUseContent) -> Self
Converts to this type from the input type.
Source§impl From<ToolUseContent> for SamplingMessageContent
impl From<ToolUseContent> for SamplingMessageContent
Source§fn from(value: ToolUseContent) -> Self
fn from(value: ToolUseContent) -> Self
Converts to this type from the input type.
Source§impl From<ToolUseContent> for SamplingMessageContentBlock
impl From<ToolUseContent> for SamplingMessageContentBlock
Source§fn from(value: ToolUseContent) -> Self
fn from(value: ToolUseContent) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ToolUseContent
impl RefUnwindSafe for ToolUseContent
impl Send for ToolUseContent
impl Sync for ToolUseContent
impl Unpin for ToolUseContent
impl UnwindSafe for ToolUseContent
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