Skip to main content

tool_definition

Function tool_definition 

Source
pub fn tool_definition(
    name: impl Into<String>,
    title: Option<String>,
    description: Option<String>,
    input_schema: McpSchema,
    output_schema: Option<McpSchema>,
) -> Result<ToolDefinition, McpToolError>
Expand description

Build and validate an MCP tool definition.

ยงErrors

Returns McpToolError when the tool metadata is invalid or when the input schema is not an object-shaped MCP tool schema, or the output schema is not a JSON object.