pub struct ToolMetadata {
pub id: String,
pub name: String,
pub description: String,
pub category: String,
pub parameters: Vec<ParameterMetadata>,
pub return_type: String,
pub source: ToolSource,
pub server_id: Option<String>,
}Expand description
Tool metadata
Fields§
§id: String§name: String§description: String§category: String§parameters: Vec<ParameterMetadata>§return_type: String§source: ToolSource§server_id: Option<String>Implementations§
Source§impl ToolMetadata
impl ToolMetadata
Sourcepub fn new(
id: String,
name: String,
description: String,
category: String,
return_type: String,
source: ToolSource,
) -> Self
pub fn new( id: String, name: String, description: String, category: String, return_type: String, source: ToolSource, ) -> Self
Creates a new tool metadata
Sourcepub fn add_parameter(&mut self, parameter: ParameterMetadata)
pub fn add_parameter(&mut self, parameter: ParameterMetadata)
Adds a parameter to the tool
Sourcepub fn set_server_id(&mut self, server_id: String)
pub fn set_server_id(&mut self, server_id: String)
Sets the server ID for MCP tools
Sourcepub fn get_documentation(&self) -> String
pub fn get_documentation(&self) -> String
Gets the tool documentation
Trait Implementations§
Source§impl Clone for ToolMetadata
impl Clone for ToolMetadata
Source§fn clone(&self) -> ToolMetadata
fn clone(&self) -> ToolMetadata
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 ToolMetadata
impl Debug for ToolMetadata
Source§impl<'de> Deserialize<'de> for ToolMetadata
impl<'de> Deserialize<'de> for ToolMetadata
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 ToolMetadata
impl RefUnwindSafe for ToolMetadata
impl Send for ToolMetadata
impl Sync for ToolMetadata
impl Unpin for ToolMetadata
impl UnwindSafe for ToolMetadata
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