pub struct ToolDefinition {
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub input_schema: Value,
pub output_schema: Option<Value>,
pub icons: Option<Vec<ToolIcon>>,
pub annotations: Option<ToolAnnotations>,
}Expand description
Tool definition as returned by tools/list
Fields§
§name: String§title: Option<String>Human-readable title for display purposes
description: Option<String>§input_schema: Value§output_schema: Option<Value>Optional JSON Schema defining expected output structure
icons: Option<Vec<ToolIcon>>Optional icons for display in user interfaces
annotations: Option<ToolAnnotations>Optional annotations describing tool behavior. Note: Clients MUST consider these untrusted unless from a trusted server.
Implementations§
Source§impl ToolDefinition
impl ToolDefinition
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Returns true if the tool does not modify state.
Returns false (the MCP spec default) when annotations are absent.
Sourcepub fn is_destructive(&self) -> bool
pub fn is_destructive(&self) -> bool
Returns true if the tool may have destructive effects.
Returns true (the MCP spec default) when annotations are absent.
Sourcepub fn is_idempotent(&self) -> bool
pub fn is_idempotent(&self) -> bool
Returns true if calling repeatedly with same args has the same effect.
Returns false (the MCP spec default) when annotations are absent.
Sourcepub fn is_open_world(&self) -> bool
pub fn is_open_world(&self) -> bool
Returns true if the tool interacts with external entities.
Returns true (the MCP spec default) when annotations are absent.
Trait Implementations§
Source§impl Clone for ToolDefinition
impl Clone for ToolDefinition
Source§fn clone(&self) -> ToolDefinition
fn clone(&self) -> ToolDefinition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more