pub struct Tool {
pub name: String,
pub description: String,
pub input_schema: Option<Value>,
pub extensions: Option<Value>,
pub read_only: Option<bool>,
pub return_type: Option<Value>,
}Expand description
Tool definition including schema and metadata.
Fields§
§name: StringUnique name of the tool
description: StringHuman-readable description of what the tool does
input_schema: Option<Value>JSON Schema for the tool’s input parameters
extensions: Option<Value>Additional tool extensions and metadata
read_only: Option<bool>Whether the tool is read-only
return_type: Option<Value>Return type schema for the tool
Implementations§
Source§impl Tool
impl Tool
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Create a new tool definition.
Sourcepub fn with_input_schema(self, schema: Value) -> Self
pub fn with_input_schema(self, schema: Value) -> Self
Set the input schema for this tool.
Sourcepub fn with_extensions(self, extensions: Value) -> Self
pub fn with_extensions(self, extensions: Value) -> Self
Set the extensions for this tool.
Sourcepub fn with_read_only(self, read_only: bool) -> Self
pub fn with_read_only(self, read_only: bool) -> Self
Set the read-only flag for this tool.
Sourcepub fn with_return_type(self, return_type: Value) -> Self
pub fn with_return_type(self, return_type: Value) -> Self
Set the return type schema for this tool.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
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
impl Eq for Tool
impl StructuralPartialEq for Tool
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.