pub struct Tool {
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub input_schema: ToolInputSchema,
pub output_schema: Option<ToolOutputSchema>,
pub annotations: Option<ToolAnnotations>,
pub meta: Option<HashMap<String, Value>>,
}
Expand description
Tool definition per MCP 2025-06-18 specification
Fields§
§name: String
Tool name (programmatic identifier)
title: Option<String>
Display title for UI contexts (optional, falls back to name if not provided)
description: Option<String>
Human-readable description of the tool This can be used by clients to improve the LLM’s understanding of available tools
input_schema: ToolInputSchema
JSON Schema object defining the expected parameters for the tool
output_schema: Option<ToolOutputSchema>
Optional JSON Schema object defining the structure of the tool’s output returned in the structuredContent field of a CallToolResult
annotations: Option<ToolAnnotations>
Optional additional tool information Display name precedence order is: title, annotations.title, then name
meta: Option<HashMap<String, Value>>
General metadata field for extensions and custom data
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