#[non_exhaustive]pub struct ToolAnnotations {
pub read_only: Option<bool>,
pub destructive: Option<bool>,
pub idempotent: Option<bool>,
pub open_world: Option<bool>,
}Expand description
What a tool’s source says about its effects. Hints, not guarantees: MCP’s
own wording, and a server can lie. None is “the source said nothing”,
which is not the same as Some(false) — a tool with no read_only claim
is a tool the consumer knows nothing about, not one that writes.
Owned here rather than borrowed from rmcp so this crate stays free of
MCP; the bridge maps between the two.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.read_only: Option<bool>The tool does not modify its environment.
destructive: Option<bool>The tool may perform destructive updates (meaningful when not read-only).
idempotent: Option<bool>Repeating a call with the same arguments has no further effect.
open_world: Option<bool>The tool reaches an open world of external entities (a web search), as opposed to a closed one (a memory store).
Implementations§
Source§impl ToolAnnotations
impl ToolAnnotations
pub fn new() -> Self
pub fn read_only(self, value: bool) -> Self
pub fn destructive(self, value: bool) -> Self
pub fn idempotent(self, value: bool) -> Self
pub fn open_world(self, value: bool) -> Self
Trait Implementations§
Source§impl Clone for ToolAnnotations
impl Clone for ToolAnnotations
impl Copy for ToolAnnotations
Source§impl Debug for ToolAnnotations
impl Debug for ToolAnnotations
Source§impl Default for ToolAnnotations
impl Default for 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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more