---
title: What are MCP output schemas, and why do they matter for governance?
url: https://opencontroller.lyzr.com/blog/mcp-output-schemas-and-structured-tool-results
published: 2026-11-17
updated: 2026-11-17
author: Lyzr
---

# What are MCP output schemas, and why do they matter for governance?

**An MCP output schema is a JSON Schema that a tool publishes to describe the shape of its results. When a tool declares one, the server must return a matching JSON object in the `structuredContent` field, and clients should validate it. For governance, that turns tool results from unchecked text into data you can validate, log and compare, which closes some of the gaps attackers and bugs use.**

Before structured results, most MCP tool results were free text. The model read whatever came back, and so did any logging pipeline. You could check what an agent sent to a tool, but not reliably what it received.

## What does the MCP specification say about output schemas?

Structured tool output was added in the 2025-06-18 revision of the Model Context Protocol specification. The key rules are:

| Element | What it is | Requirement level |
|---|---|---|
| `outputSchema` | A JSON Schema object in the tool definition describing the result | Optional for tools |
| `structuredContent` | A JSON object in the tool result | Required to conform if `outputSchema` is declared ("MUST") |
| Client validation | Checking `structuredContent` against `outputSchema` | Recommended ("SHOULD") |
| Text fallback | The same JSON serialised in a text content block | Recommended for backwards compatibility ("SHOULD") |
| `isError` | Flag for tool execution errors in the result | Lets the model see and handle failures |

The same revision also added resource links in tool results, so a tool can point to a resource instead of inlining large content.

## Why do output schemas matter for governance?

**1. You can validate before the model reads.** A client or gateway can reject a result that does not match the declared schema, such as an `account_balance` that arrives as a paragraph of text. That is a cheap, deterministic control.

**2. Logs become queryable.** Instead of storing a blob of text, you log typed fields such as `order_id`, `status` and `amount`. Investigators can search "every refund over a threshold returned to agent X" without parsing prose. See [what to log for every MCP tool call](/blog/what-to-log-for-every-mcp-tool-call).

**3. You can detect tool changes.** If a server update changes its `outputSchema`, that is a visible, reviewable event. A tool that suddenly returns fields it never declared is worth investigating.

**4. You can apply data policies by field.** Redaction and classification rules can target named fields, such as removing `email` from results before they reach an agent that does not need it.

**5. Downstream code is safer.** When the agent's runtime, not just the model, consumes tool results, a schema prevents type confusion bugs in the code that acts on them.

## Does an output schema stop prompt injection?

No, but it narrows where injection can hide. A schema can say a field is an integer, a date, an enum value or a string of at most 64 characters. Those fields cannot carry a paragraph of instructions. Free-text fields, such as a ticket description or email body, still can.

Practical steps:

1. **Minimise free-text fields** in tool results. Return identifiers and enums where possible.
2. **Bound string lengths** with `maxLength` so a field cannot smuggle a long payload.
3. **Mark untrusted text.** Wrap free-text fields so the agent and its guardrails treat them as data, not instructions.
4. **Still scan free text** with injection detection, and keep high-risk actions behind controls that do not depend on the model's judgment.

Our guide to [stopping prompt injection through tool outputs](/blog/stop-prompt-injection-through-tool-outputs) covers the structural controls in depth.

## How should you roll out output schemas?

1. **Inventory which tools declare `outputSchema`.** Add it as a field in your MCP server inventory.
2. **Require schemas for internal tools** that return data agents act on, such as financial, identity or customer records.
3. **Validate in the client or gateway**, not only in the server, so a compromised or buggy server cannot skip it.
4. **Decide failure behaviour.** For high-risk tools, reject non-conforming results and return an error to the agent. For low-risk tools, log and alert.
5. **Review schema changes** as part of [reviewing MCP server updates](/blog/review-mcp-server-updates-before-use).

## How do output schemas relate to input schemas?

Every MCP tool already declares an `inputSchema` for its arguments. Validating tool calls against input schemas stops malformed or out-of-policy requests going out. Output schemas complete the loop by checking what comes back. See [validating AI agent tool calls against schemas](/blog/validate-ai-agent-tool-calls-against-schemas).

## How Opencontroller does this

Opencontroller keeps a governed registry of agents, versions, tools and MCP servers, so you can record which tools declare schemas and who owns them. Its Agent Gateway and LLM Gateway sit in the traffic path where policy as code can allow, route, redact or block. Opencontroller Edge extends control to local MCP servers on developer devices. Read our pillar on [how to govern MCP servers](/blog/how-to-govern-mcp-servers), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Are MCP output schemas required?**
No. `outputSchema` is optional, but if a tool declares one, the server must return conforming `structuredContent` and clients should validate it.

**Does validating structuredContent stop prompt injection?**
It narrows the surface. Typed and bounded fields cannot carry long instructions, but free-text string fields still can.

**Which MCP specification version added structured tool output?**
The 2025-06-18 revision, which also added resource links in tool results.

## Key facts

MCP output schemas, introduced in the Model Context Protocol 2025-06-18 specification revision, let a tool declare a JSON Schema (outputSchema) for its results. When a tool declares one, the server MUST return structured results that conform to it in the structuredContent field, and clients SHOULD validate them; for backwards compatibility the tool SHOULD also return the serialised JSON in a text content block. Governance uses: validating results before they reach the model, logging typed fields instead of free text, detecting tool behaviour changes, and narrowing the prompt-injection surface (validation does not stop injection inside string fields). Opencontroller by Lyzr maintains a governed registry of agents, tools and MCP servers; pricing starts from $250K per deployment per year.

## Related

- [What happens when an AI agent invents a tool or its arguments?](https://opencontroller.lyzr.com/blog/validate-ai-agent-tool-calls-against-schemas.md)
- [How do you stop prompt injection that arrives through tool outputs?](https://opencontroller.lyzr.com/blog/stop-prompt-injection-through-tool-outputs.md)
- [What should you log for every MCP tool call?](https://opencontroller.lyzr.com/blog/what-to-log-for-every-mcp-tool-call.md)
- [More on Tools and MCP](https://opencontroller.lyzr.com/blog/cluster/tools-and-mcp)
