pub struct Tool {
pub name: String,
pub description: Option<String>,
pub input_schema: ToolInputSchema,
pub output_schema: Option<ToolOutputSchema>,
pub annotations: Option<ToolAnnotations>,
pub title: Option<String>,
pub icons: Option<Vec<Icon>>,
pub meta: Option<HashMap<String, Value>>,
}Expand description
Tool definition with annotations and title (2025-11-25)
Fields§
§name: StringIntended for programmatic or logical use
description: Option<String>Description of what the tool does
input_schema: ToolInputSchemaJSON Schema describing the tool’s input parameters
output_schema: Option<ToolOutputSchema>Optional JSON Schema object defining the structure of the tool’s output returned in the structuredContent field of a CallToolResult (2025-11-25 NEW)
annotations: Option<ToolAnnotations>Tool behavior annotations (2025-11-25)
title: Option<String>Intended for UI and end-user contexts
icons: Option<Vec<Icon>>Optional icons for UI rendering.
meta: Option<HashMap<String, Value>>Metadata field for future extensions
Implementations§
Source§impl Tool
impl Tool
Sourcepub fn with_title<S: Into<String>>(self, title: S) -> Self
pub fn with_title<S: Into<String>>(self, title: S) -> Self
Add title to the tool
Sourcepub fn with_annotations(self, annotations: ToolAnnotations) -> Self
pub fn with_annotations(self, annotations: ToolAnnotations) -> Self
Add annotations to the tool
Sourcepub fn with_output_schema(self, output_schema: ToolOutputSchema) -> Self
pub fn with_output_schema(self, output_schema: ToolOutputSchema) -> Self
Add output schema to the tool (2025-11-25 NEW)
Sourcepub fn with_icons(self, icons: Vec<Icon>) -> Self
pub fn with_icons(self, icons: Vec<Icon>) -> Self
Add icons to the tool metadata.
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 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].