pub struct McpToolDefinition {
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub group: Option<String>,
pub icons: Option<Vec<Icon>>,
pub input_schema: Value,
pub output_schema: Option<Value>,
pub execution: Option<ToolExecution>,
pub annotations: Option<ToolAnnotations>,
pub meta: Option<Value>,
}Expand description
MCP Tool Definition (from tools/list response)
Fields§
§name: String§title: Option<String>Intended for UI and end-user contexts — optimized to be human-readable.
description: Option<String>§group: Option<String>§icons: Option<Vec<Icon>>Optional set of sized icons that the client can display.
input_schema: Value§output_schema: Option<Value>An optional JSON Schema object defining the structure of the tool’s output.
execution: Option<ToolExecution>Execution-related properties for this tool.
annotations: Option<ToolAnnotations>Optional additional tool information.
meta: Option<Value>See General fields: _meta for notes on _meta usage.
Implementations§
Source§impl McpToolDefinition
impl McpToolDefinition
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the title.
Sourcepub fn with_group(self, group: impl Into<String>) -> Self
pub fn with_group(self, group: impl Into<String>) -> Self
Set the group.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set the description.
Sourcepub fn with_schema(self, schema: Value) -> Self
pub fn with_schema(self, schema: Value) -> Self
Set the input schema.
Sourcepub fn with_output_schema(self, schema: Value) -> Self
pub fn with_output_schema(self, schema: Value) -> Self
Set the output schema.
Sourcepub fn with_annotations(self, annotations: ToolAnnotations) -> Self
pub fn with_annotations(self, annotations: ToolAnnotations) -> Self
Set the annotations.
Sourcepub fn with_execution(self, execution: ToolExecution) -> Self
pub fn with_execution(self, execution: ToolExecution) -> Self
Set the execution properties.
Sourcepub fn description_or_default(&self) -> &str
pub fn description_or_default(&self) -> &str
Get the description, defaulting to empty string.
Sourcepub fn parameters(&self) -> Value
pub fn parameters(&self) -> Value
Get a copy of the input schema as parameters value.
Trait Implementations§
Source§impl Clone for McpToolDefinition
impl Clone for McpToolDefinition
Source§fn clone(&self) -> McpToolDefinition
fn clone(&self) -> McpToolDefinition
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 McpToolDefinition
impl Debug for McpToolDefinition
Source§impl<'de> Deserialize<'de> for McpToolDefinition
impl<'de> Deserialize<'de> for McpToolDefinition
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 McpToolDefinition
impl RefUnwindSafe for McpToolDefinition
impl Send for McpToolDefinition
impl Sync for McpToolDefinition
impl Unpin for McpToolDefinition
impl UnwindSafe for McpToolDefinition
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