pub struct ToolAnnotations {
pub destructive: Option<bool>,
pub idempotent: Option<bool>,
pub read_only: Option<bool>,
pub open_world_hint: Option<bool>,
}Expand description
Tool annotations for additional metadata.
These annotations provide hints about tool behavior to help clients make informed decisions about tool usage.
Fields§
§destructive: Option<bool>Whether the tool may cause destructive side effects.
True means the tool modifies external state (e.g., deleting files).
Serialized as the MCP-spec destructiveHint field.
idempotent: Option<bool>Whether the tool is idempotent (safe to retry without side effects).
True means calling the tool multiple times has the same effect as calling it once.
Serialized as the MCP-spec idempotentHint field.
read_only: Option<bool>Whether the tool is read-only (has no side effects).
True means the tool only reads data without modifying anything.
Serialized as the MCP-spec readOnlyHint field.
open_world_hint: Option<bool>Whether the tool interacts with an “open world” of external entities.
Per the MCP spec openWorldHint is a boolean: true if the tool may reach
external/unknown systems, false if it operates over a closed/local domain.
Implementations§
Source§impl ToolAnnotations
impl ToolAnnotations
Sourcepub fn destructive(self, value: bool) -> Self
pub fn destructive(self, value: bool) -> Self
Sets the destructive annotation.
Sourcepub fn idempotent(self, value: bool) -> Self
pub fn idempotent(self, value: bool) -> Self
Sets the idempotent annotation.
Sourcepub fn open_world_hint(self, value: bool) -> Self
pub fn open_world_hint(self, value: bool) -> Self
Sets the open_world_hint annotation.
Per the MCP spec openWorldHint is a boolean: true if the tool interacts
with an open world of external entities, false for a closed/local domain.
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>,
impl Eq for ToolAnnotations
Source§impl PartialEq for ToolAnnotations
impl PartialEq for ToolAnnotations
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.