pub struct ToolDefinition {
pub name: String,
pub description: String,
pub input_schema: ToolInputSchema,
pub annotations: Option<ToolAnnotations>,
}Fields§
§name: String§description: String§input_schema: ToolInputSchema§annotations: Option<ToolAnnotations>Optional annotations for tool classification
Implementations§
Source§impl ToolDefinition
impl ToolDefinition
Sourcepub fn new(name: &str, description: &str, input_schema: ToolInputSchema) -> Self
pub fn new(name: &str, description: &str, input_schema: ToolInputSchema) -> Self
Create a new tool definition (annotations defaults to None)
Sourcepub fn is_concurrency_safe(&self, _input: &Value) -> bool
pub fn is_concurrency_safe(&self, _input: &Value) -> bool
Check if tool can run concurrently (default: false)
Sourcepub fn is_read_only(&self, _input: &Value) -> bool
pub fn is_read_only(&self, _input: &Value) -> bool
Check if tool only reads data (default: false)
Sourcepub fn is_destructive(&self, input: &Value) -> bool
pub fn is_destructive(&self, input: &Value) -> bool
Check if tool performs destructive operations (default: false)
Sourcepub fn is_idempotent(&self) -> bool
pub fn is_idempotent(&self) -> bool
Check if tool is idempotent (can be run multiple times safely)
Sourcepub fn get_use_summary(&self, input: &Value) -> String
pub fn get_use_summary(&self, input: &Value) -> String
Get tool use summary for compact views
Trait Implementations§
Source§impl Clone for ToolDefinition
impl Clone for ToolDefinition
Source§fn clone(&self) -> ToolDefinition
fn clone(&self) -> ToolDefinition
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 ToolDefinition
impl Debug for ToolDefinition
Source§impl Default for ToolDefinition
impl Default for ToolDefinition
Source§impl<'de> Deserialize<'de> for ToolDefinition
impl<'de> Deserialize<'de> for ToolDefinition
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
Auto Trait Implementations§
impl Freeze for ToolDefinition
impl RefUnwindSafe for ToolDefinition
impl Send for ToolDefinition
impl Sync for ToolDefinition
impl Unpin for ToolDefinition
impl UnsafeUnpin for ToolDefinition
impl UnwindSafe for ToolDefinition
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