pub struct ToolAnnotations {
pub read_only_hint: bool,
pub destructive_hint: bool,
pub idempotent_hint: bool,
pub needs_approval_hint: bool,
pub supports_streaming_hint: bool,
}Expand description
Hints that describe behavioural properties of a tool.
These flags are advisory — they influence UI presentation and permission
policies but do not enforce behaviour at runtime. For example, a
permission policy may automatically require approval for tools that
set destructive_hint to true.
Fields§
§read_only_hint: boolThe tool only reads data and has no side-effects.
destructive_hint: boolThe tool may perform destructive operations (e.g. file deletion).
idempotent_hint: boolRepeated calls with the same input produce the same effect.
needs_approval_hint: boolThe tool should prompt for user approval before execution.
supports_streaming_hint: boolThe tool can stream partial results during execution.
Implementations§
Source§impl ToolAnnotations
impl ToolAnnotations
Sourcepub fn destructive() -> Self
pub fn destructive() -> Self
Marks the tool as destructive.
Sourcepub fn needs_approval() -> Self
pub fn needs_approval() -> Self
Marks the tool as requiring approval.
pub fn with_read_only(self, read_only_hint: bool) -> Self
pub fn with_destructive(self, destructive_hint: bool) -> Self
pub fn with_idempotent(self, idempotent_hint: bool) -> Self
pub fn with_needs_approval(self, needs_approval_hint: bool) -> Self
pub fn with_supports_streaming(self, supports_streaming_hint: bool) -> Self
Trait Implementations§
Source§impl Clone for ToolAnnotations
impl Clone for ToolAnnotations
Source§fn clone(&self) -> ToolAnnotations
fn clone(&self) -> ToolAnnotations
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
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
Source§impl PartialEq for ToolAnnotations
impl PartialEq for ToolAnnotations
Source§impl Serialize for ToolAnnotations
impl Serialize for ToolAnnotations
impl Eq 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