Skip to main content

objectiveai_sdk/mcp/tool/
tool_use.rs

1//! Tool use content block.
2
3use indexmap::IndexMap;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7/// A tool call request from an assistant.
8#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
9#[schemars(rename = "mcp.tool.ToolUseContent")]
10pub struct ToolUseContent {
11    /// The name of the tool to invoke.
12    pub name: String,
13    /// Unique identifier for this tool call.
14    pub id: String,
15    /// Arguments to pass to the tool.
16    pub input: IndexMap<String, serde_json::Value>,
17    /// Extension metadata.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    #[schemars(extend("omitempty" = true))]
20    pub _meta: Option<IndexMap<String, serde_json::Value>>,
21}