pub struct ToolAnnotations {
pub title: Option<String>,
pub audience: Option<Vec<String>>,
pub priority: Option<f64>,
pub destructive_hint: Option<bool>,
pub idempotent_hint: Option<bool>,
pub open_world_hint: Option<bool>,
pub read_only_hint: Option<bool>,
pub custom: HashMap<String, Value>,
}Expand description
Optional metadata hints about a tool’s behavior.
Critical Warning (from MCP spec):
“All properties in ToolAnnotations are hints. They are not guaranteed to provide a faithful description of tool behavior. Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers.”
These fields are useful for UI display and general guidance, but should never be trusted for security decisions or behavioral assumptions.
Fields§
§title: Option<String>A user-friendly title for display in UIs (hint only).
audience: Option<Vec<String>>Role-based audience hint. Per spec, should be "user" or "assistant" (hint only).
priority: Option<f64>Subjective priority for UI sorting (hint only, often ignored).
destructive_hint: Option<bool>Hint that the tool may perform destructive actions (e.g., deleting data).
Do not trust this for security decisions. Default: true if not specified.
idempotent_hint: Option<bool>Hint that repeated calls with same args have no additional effects.
Useful for retry logic, but verify actual behavior. Default: false if not specified.
open_world_hint: Option<bool>Hint that the tool may interact with external systems or the real world.
Do not trust this for sandboxing decisions. Default: true if not specified.
read_only_hint: Option<bool>Hint that the tool does not modify state (read-only).
Do not trust this for security decisions. Default: false if not specified.
custom: HashMap<String, Value>Custom application-specific hints.
Trait Implementations§
Source§impl Clone for ToolAnnotations
impl Clone for ToolAnnotations
Source§fn clone(&self) -> ToolAnnotations
fn clone(&self) -> ToolAnnotations
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more