output-schemas

Generate and validate MCP tool output schemas with JsonSchema and camelCase naming.

2|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/aussierobots/turul-mcp-framework --skill output-schemas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: output-schemas
Source: https://github.com/aussierobots/turul-mcp-framework/tree/main/plugins/turul-mcp-skills/skills/output-schemas
Command: npx skills add https://github.com/aussierobots/turul-mcp-framework --skill output-schemas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing MCP tool outputs that reliably communicate results is hard; inconsistent naming and missing schemas lead to integration issues. This skill helps you define and validate output schemas so clients consistently receive structuredContent and clear JSON descriptions.

Core Features & Use Cases

  • Auto-detect and generate output schemas for MCP tool results using schemars JsonSchema integration.
  • Support for derive macros, function macros, and builder patterns with proper output attributes and wrapper structs for Vec<T>.
  • Guidance for camelCase field naming and nested types to ensure API compatibility and tooling across MCP Inspector and related tooling.

Quick Start

Provide a sample tool output type annotated for JsonSchema and an example that demonstrates the wrapper pattern for Vec<T>.

Frequently Asked Questions about output-schemas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I auto-generate JSON schemas for MCP tool outputs?

You can auto-generate JSON schemas for MCP tool outputs by integrating schemars and applying derive macros to your tool result types. This ensures your outputs declare JsonSchema, providing clients with consistent structuredContent and clear JSON descriptions.

Why do my MCP tool outputs need wrapper structs for Vec<T>?

Wrapper structs for Vec<T> are required because MCP output schemas need named types to properly generate JSON schemas. Without a wrapper struct, the schema generation cannot correctly derive the JsonSchema implementation for vector collections in your tool outputs.

How do I enforce camelCase field naming in MCP tool output schemas?

To enforce camelCase field naming in MCP output schemas, you apply specific output attributes to your derive macros and nested types. This ensures API compatibility and consistent tooling behavior across MCP Inspector and related clients.

Can I use builder patterns to construct MCP tool outputs with JSON schemas?

Yes, builder patterns are fully supported for constructing MCP tool outputs. The schema generation process validates builder pattern attributes alongside derive macros and function macros to ensure proper JsonSchema declaration and structuredContent delivery.

What happens if my MCP tool output is missing a JSON schema?

Missing JSON schemas for MCP tool outputs lead to integration issues and inconsistent client results. Without proper schema validation and structuredContent, clients cannot reliably parse the tool output, causing failures in MCP Inspector and related tooling.

Does the MCP framework support derive macros for tool output schema validation?

Yes, the MCP framework supports derive macros for tool output schema validation. By applying these macros, the framework auto-detects your tool outputs and enforces proper JsonSchema declaration, ensuring robust and validated structuredContent.