pub struct Tool {
pub name: String,
pub description: String,
pub input_schema: Value,
pub output_schema: Option<Value>,
pub annotations: Option<ToolAnnotations>,
}Expand description
Tool definition
Fields§
§name: StringTool name (unique identifier)
description: StringHuman-readable description
input_schema: ValueJSON Schema for input parameters
output_schema: Option<Value>Optional JSON Schema for output
annotations: Option<ToolAnnotations>Optional tool annotations for behavior hints
Implementations§
Source§impl Tool
impl Tool
pub fn new(name: String, description: String, input_schema: Value) -> Tool
pub fn with_output_schema(self, schema: Value) -> Tool
pub fn with_annotations(self, annotations: ToolAnnotations) -> Tool
pub fn with_read_only_annotation(self) -> Tool
pub fn with_destructive_annotation(self) -> Tool
pub fn with_idempotent_annotation(self) -> Tool
pub fn with_open_world_annotation(self) -> Tool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Tool, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Tool, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Tool
impl Serialize for Tool
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnwindSafe for Tool
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