pub struct ToolAnnotations {
pub title: Option<String>,
pub read_only_hint: Option<bool>,
pub destructive_hint: Option<bool>,
pub idempotent_hint: Option<bool>,
pub open_world_hint: Option<bool>,
}Expand description
Tool-specific annotations (2025-11-25 Schema Compliance)
NOTE: all properties in ToolAnnotations are hints.
They are not guaranteed to provide a faithful description of
tool behavior (including descriptive properties like title).
Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers.
Fields§
§title: Option<String>A human-readable title for the tool
read_only_hint: Option<bool>If true, the tool does not modify its environment Default: false
destructive_hint: Option<bool>If true, the tool may perform destructive updates to its environment
If false, the tool performs only additive updates
(This property is meaningful only when readOnlyHint == false)
Default: true
idempotent_hint: Option<bool>If true, calling the tool repeatedly with the same arguments
will have no additional effect on its environment
(This property is meaningful only when readOnlyHint == false)
Default: false
open_world_hint: Option<bool>If true, this tool may interact with an “open world” of external entities If false, the tool’s domain of interaction is closed For example, the world of a web search tool is open, whereas that of a memory tool is not Default: true
Implementations§
Source§impl ToolAnnotations
impl ToolAnnotations
Sourcepub fn with_title<S: Into<String>>(self, title: S) -> Self
pub fn with_title<S: Into<String>>(self, title: S) -> Self
Set the human-readable title for the tool
Sourcepub fn destructive(self) -> Self
pub fn destructive(self) -> Self
Mark tool as destructive (may perform destructive updates)
Sourcepub fn idempotent(self) -> Self
pub fn idempotent(self) -> Self
Mark tool as idempotent (same input produces same result)
Sourcepub fn open_world(self) -> Self
pub fn open_world(self) -> Self
Mark tool as interacting with open world of external entities
Sourcepub fn closed_world(self) -> Self
pub fn closed_world(self) -> Self
Mark tool as interacting with closed world (limited domain)
Source§impl ToolAnnotations
impl ToolAnnotations
Sourcepub fn from_improved_metadata(
metadata: &ImprovedToolMetadata,
title_override: Option<String>,
) -> Self
pub fn from_improved_metadata( metadata: &ImprovedToolMetadata, title_override: Option<String>, ) -> Self
Create ToolAnnotations from improved metadata with explicit title override
Sourcepub fn from_behavior_hints(hints: &ToolBehaviorHints) -> Self
pub fn from_behavior_hints(hints: &ToolBehaviorHints) -> Self
Create minimal ToolAnnotations from behavior hints
Trait Implementations§
Source§impl Clone for ToolAnnotations
impl Clone for ToolAnnotations
Source§fn clone(&self) -> ToolAnnotations
fn clone(&self) -> ToolAnnotations
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolAnnotations
impl Debug for ToolAnnotations
Source§impl Default for ToolAnnotations
impl Default for ToolAnnotations
Source§fn default() -> ToolAnnotations
fn default() -> ToolAnnotations
Source§impl<'de> Deserialize<'de> for ToolAnnotations
impl<'de> Deserialize<'de> for ToolAnnotations
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>,
Source§impl From<&ImprovedToolMetadata> for ToolAnnotations
impl From<&ImprovedToolMetadata> for ToolAnnotations
Source§fn from(metadata: &ImprovedToolMetadata) -> Self
fn from(metadata: &ImprovedToolMetadata) -> Self
Source§impl From<&ToolBehaviorHints> for ToolAnnotations
impl From<&ToolBehaviorHints> for ToolAnnotations
Source§fn from(hints: &ToolBehaviorHints) -> Self
fn from(hints: &ToolBehaviorHints) -> Self
Source§impl PartialEq for ToolAnnotations
impl PartialEq for ToolAnnotations
Source§fn eq(&self, other: &ToolAnnotations) -> bool
fn eq(&self, other: &ToolAnnotations) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolAnnotations
impl Serialize for ToolAnnotations
impl StructuralPartialEq for ToolAnnotations
Auto Trait Implementations§
impl Freeze for ToolAnnotations
impl RefUnwindSafe for ToolAnnotations
impl Send for ToolAnnotations
impl Sync for ToolAnnotations
impl Unpin for ToolAnnotations
impl UnsafeUnpin for ToolAnnotations
impl UnwindSafe for ToolAnnotations
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].