← Back to Dashboard
1. Sampling & Roots2. Async Tasks (2025)3. Elicitation & HITL4. Structured Content & Tool Annotations5. Completions & Metadata

Structured Content & Tool Annotations

📚 Advanced Features9 min100 XP

Machine-Parseable Tool Output

The 2025-2026 MCP spec introduced outputSchema and structuredContent, allowing tools to return both human-readable text and machine-parseable JSON simultaneously. This is critical for agentic pipelines where downstream tools need to consume structured data rather than parsing free-form text.

outputSchema & structuredContent

server.tool(
  "get_stock_price",
  "Fetch the current stock price for a ticker symbol",
  { ticker: z.string().describe("Stock ticker, e.g. AAPL") },
  async ({ ticker }) => {
    const price = await fetchStockPrice(ticker);
    return {
      content: [{ type: "text", text: \`The price of \${ticker} is $\${price.current}\` }],
      structuredContent: { ticker, current: price.current, change: price.change, volume: price.volume }
    };
  },
  { outputSchema: { type: "object", properties: { ticker: { type: "string" }, current: { type: "number" }, change: { type: "number" }, volume: { type: "number" } } } }
);

The content array is displayed to the user in the Host UI. The structuredContent is consumed programmatically by downstream agents or tools — enabling reliable data pipelines without brittle text parsing.

Tool Annotations

Tool annotations are metadata hints that describe a tool's behaviour to the client. They do not affect execution — they inform the Host about safety characteristics for smarter approval workflows.

AnnotationTypeMeaning
readOnlyHintbooleanTool only reads data, does not modify state
destructiveHintbooleanTool may delete or irreversibly modify data
idempotentHintbooleanCalling the tool multiple times with same args produces the same result
openWorldHintbooleanTool interacts with external entities (APIs, internet)
💡 Key Insight: Tool annotations enable auto-approval workflows. A Host can automatically approve tools marked readOnlyHint: true while requiring explicit user confirmation for tools with destructiveHint: true — dramatically speeding up safe agentic workflows.
🧪 Knowledge Check
Press 1-4 to select1 of 3
What is the purpose of structuredContent in MCP tool responses?
To style the UI
To provide machine-parseable JSON alongside human-readable text for downstream tool consumption
To compress the response
To encrypt sensitive data
Watch: 139x Rust Speedup
Structured Content & Tool Annotations | Advanced Features — MCP Academy