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,
pub security: Option<Vec<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
security: Option<Vec<String>>Security requirements from OpenAPI spec - internal only, not exposed to MCP
Implementations§
Source§impl ToolMetadata
impl ToolMetadata
Sourcepub fn requires_auth(&self) -> bool
pub fn requires_auth(&self) -> bool
Check if this tool requires authentication based on OpenAPI security definitions
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.