pub struct ToolMetadata {
pub name: String,
pub title: Option<String>,
pub description: String,
pub parameters: Value,
pub output_schema: Option<Value>,
pub method: String,
pub path: String,
}Expand description
Internal metadata for tools generated from OpenAPI operations.
This struct contains all the information needed to execute HTTP requests and is used internally by the OpenAPI server. It includes fields that are not part of the MCP specification but are necessary for HTTP execution.
For MCP compliance, this struct is converted to rmcp::model::Tool using
the From trait implementation, which only includes MCP-compliant fields.
Fields§
§name: StringTool name - exposed to MCP clients
title: Option<String>Tool title - human-readable display name exposed to MCP clients
description: StringTool description - exposed to MCP clients
parameters: ValueInput parameters schema - exposed to MCP clients as inputSchema
output_schema: Option<Value>Output schema - exposed to MCP clients as outputSchema
method: StringHTTP method (GET, POST, etc.) - internal only, not exposed to MCP
path: StringURL path for the API endpoint - internal only, not exposed to MCP
Implementations§
Source§impl ToolMetadata
impl ToolMetadata
Sourcepub fn is_parameter_required(&self, param_name: &str) -> bool
pub fn is_parameter_required(&self, param_name: &str) -> bool
Check if a parameter is required according to the tool metadata
Sourcepub fn is_parameter_array_type(&self, param_name: &str) -> bool
pub fn is_parameter_array_type(&self, param_name: &str) -> bool
Check if a parameter is an array type according to the tool metadata
Sourcepub fn has_parameter_default(&self, param_name: &str) -> bool
pub fn has_parameter_default(&self, param_name: &str) -> bool
Check if a parameter has a default value according to the tool metadata
Sourcepub fn is_empty_array(value: &Value) -> bool
pub fn is_empty_array(value: &Value) -> bool
Check if a JSON value is an empty array
Sourcepub fn should_omit_empty_array_parameter(
&self,
param_name: &str,
value: &Value,
) -> bool
pub fn should_omit_empty_array_parameter( &self, param_name: &str, value: &Value, ) -> bool
Determine if an empty array parameter should be omitted from the HTTP request
Trait Implementations§
Source§impl Clone for ToolMetadata
impl Clone for ToolMetadata
Source§fn clone(&self) -> ToolMetadata
fn clone(&self) -> ToolMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolMetadata
impl Debug for ToolMetadata
Source§impl From<&ToolMetadata> for Tool
Converts internal ToolMetadata to MCP-compliant Tool.
impl From<&ToolMetadata> for Tool
Converts internal ToolMetadata to MCP-compliant Tool.
This implementation ensures that only MCP-compliant fields are exposed to clients.
Internal fields like method and path are not included in the conversion.