#[non_exhaustive]pub struct McpToolAnnotations {
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
Additional properties describing a Tool to clients.
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 (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.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 A human-readable description of the tool’s purpose.
idempotent_hint: Option<bool>If true, calling the tool repeatedly with the same arguments will have no additional effect on the 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
pub fn new() -> ToolAnnotations
Sourcepub fn from_raw(
title: Option<String>,
read_only_hint: Option<bool>,
destructive_hint: Option<bool>,
idempotent_hint: Option<bool>,
open_world_hint: Option<bool>,
) -> ToolAnnotations
pub fn from_raw( title: Option<String>, read_only_hint: Option<bool>, destructive_hint: Option<bool>, idempotent_hint: Option<bool>, open_world_hint: Option<bool>, ) -> ToolAnnotations
Create a new ToolAnnotations with all fields specified
pub fn with_title<T>(title: T) -> ToolAnnotations
pub fn read_only(self, read_only: bool) -> ToolAnnotations
pub fn destructive(self, destructive: bool) -> ToolAnnotations
pub fn idempotent(self, idempotent: bool) -> ToolAnnotations
pub fn open_world(self, open_world: bool) -> ToolAnnotations
Sourcepub fn is_destructive(&self) -> bool
pub fn is_destructive(&self) -> bool
If not set, defaults to true.
Sourcepub fn is_idempotent(&self) -> bool
pub fn is_idempotent(&self) -> bool
If not set, defaults to false.
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<ToolAnnotations, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolAnnotations, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ToolAnnotations
impl JsonSchema for ToolAnnotations
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more