MCP structuredContent and outputSchema: what changed in 2026
In MCP, structuredContent is the field in a tool result that carries machine-readable JSON, and outputSchema is the JSON Schema in the tool definition that the result must match. In the 2026-07-28 specification, structuredContent can be any JSON value, including an array. Older revisions required an object. Also send the JSON as text.
Many explanations of MCP structured output were written for the 2025 revisions, when structuredContent had to be an object. This guide works from the current specification and SEP-2106, checked on 2026-12-02, and uses a commerce tool that returns a list of eSIM plans as its example.
What is structuredContent in an MCP tool result?
structuredContent is an optional field in a tools/call result that holds the tool's output as JSON data, next to the usual content array. The MCP 2026-07-28 tools specification calls these two kinds of output structured and unstructured content.
The content array holds text, images, audio, resource links or embedded resources, which a model reads. structuredContent holds data that a client can parse without guessing, such as prices, IDs and flags.
The specification adds a note to prevent a common mix-up. structuredContent is produced by the server and is unrelated to LLM "structured outputs", which constrain what a model generates.
What does outputSchema do?
outputSchema is an optional JSON Schema in a tool's definition that describes the shape of its structuredContent. If a tool declares one, the specification says servers MUST return structured results that conform to it, and clients SHOULD validate results against it.
The schema follows JSON Schema 2020-12 unless it sets a different $schema. A client reads it from tools/list, so it knows the result's shape before calling the tool. That helps a client generate types, and it helps an orchestrator branch on fields without parsing prose.
Declaring a schema is a contract. If your tool sometimes returns a different shape, such as an error object, the result no longer matches the schema the client was promised. The section on errors below covers how to handle that.
Can structuredContent be an array?
Yes, in the 2026-07-28 specification. It says structuredContent can be any JSON value, meaning an object, array, string, number, boolean or null, as long as it conforms to the tool's outputSchema. The 2025-11-25 tools page still says it is returned as a JSON object.
The change came from SEP-2106, which has Final status. It loosened outputSchema to allow any JSON Schema 2020-12 keywords, with no type: "object" requirement. inputSchema keeps type: "object", because tool arguments are always an object, but it can now use keywords such as oneOf and anyOf.
| Field | 2025-11-25 | 2026-07-28 |
|---|---|---|
structuredContent | JSON object | Any JSON value |
outputSchema | Object type (per SEP-2106) | Any 2020-12 schema |
inputSchema | type: "object" | type: "object" + any keywords |
SEP-2106 explains why: list-style results, such as a search returning several items, had to be wrapped in an object like {"plans": [...]}. A wrapper still works in 2026-07-28, so you don't have to change existing tools.
What does a tool with an array outputSchema look like?
Here is an illustrative eSIM search tool that returns an array of plans. The field names are our example, not a published API. The tool definition declares the array in outputSchema:
{
"name": "search_esim_plans",
"description": "Search eSIM data plans for a country",
"inputSchema": {
"type": "object",
"properties": {
"country": { "type": "string" }
},
"required": ["country"]
},
"outputSchema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"price_cents": { "type": "integer" },
"validity_days": { "type": "integer" }
},
"required": ["id", "name", "price_cents"]
}
}
}
A matching result, under the 2026-07-28 specification, carries resultType, a short text summary, and the array itself:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"resultType": "complete",
"content": [
{ "type": "text",
"text": "[{\"id\":\"p1\",\"name\":\"Mexico 1GB / 7d\",\"price_cents\":344,\"validity_days\":7}]" }
],
"structuredContent": [
{ "id": "p1", "name": "Mexico 1GB / 7d",
"price_cents": 344, "validity_days": 7 }
]
}
}
The specification's own array example puts a readable sentence in the text block instead of serialized JSON. Either works for the model. The next section explains when the serialized JSON matters.
Do you still need to return the JSON as text?
Yes, in practice. The specification says a tool that returns structured content SHOULD also return the serialized JSON in a TextContent block, for backwards compatibility. SEP-2106 goes further for the new shapes: servers using array or primitive structuredContent MUST also emit a TextContent block with the serialized JSON.
The reason is older clients. SEP-2106's compatibility table says a client written for the earlier format may reject structuredContent that isn't an object. A text copy gives that client something to fall back on.
SDKs differ in what they do for you. The official Python SDK's structured output guide (checked 2026-12-02) says the return type annotation becomes the output schema, and every result carries both text content and structured content. It wraps scalars and lists in {"result": ...}. structured_output=False makes a tool text-only.
How should a tool with an outputSchema report errors?
The tools pages we read don't say whether an isError: true result has to match outputSchema. Our reading is to avoid the question by choosing one of these designs:
- Leave
structuredContentout of error results. Put the error in the text block. The client then has no structured data to validate against the schema. - Make the schema cover both shapes. Since 2026-07-28 you can use
oneOfat the root ofoutputSchema, with one branch for the success shape and one for an error object.
The Python SDK makes a related choice for schema mismatches. Its guide says a return value that doesn't match the schema becomes a tool error with is_error=True, not a corrupt result. Our MCP tool error handling guide covers error codes and retry flags for payment tools.
What breaks when you upgrade to 2026-07-28?
The wire format is backwards compatible, but typed code can break. SEP-2106 says changing the TypeScript type of structuredContent from an object to unknown stops code such as result.structuredContent?.temperature from compiling. You'll need a type check before reading fields.
Check these before you rely on arrays or composition keywords:
- Clients you support. A server using array
structuredContentcan't assume an older client accepts it, according to SEP-2106. $refin schemas. SEP-2106 says implementations MUST NOT automatically fetch a$refthat points at a network URI. Keep references local, such as#/$defs/Plan.- Schema size. SEP-2106 asks implementations to bound composition keywords, for example with a maximum depth, so very complex schemas may be rejected.
- Your validator's draft. Schemas default to JSON Schema 2020-12, so your validator needs to support it.
The 2026-07-28 revision changed much more than tools, including removing protocol-level sessions and the initialize handshake. The 2026-07-28 changelog lists every change.
Why does structured output matter for commerce tools?
Structured output lets an agent compare prices and IDs exactly instead of reading them out of prose. For a tool that searches products or prepares a payment, the exact price, currency and product ID are what the user agrees to, so they shouldn't depend on how a model reads a sentence.
A typed result also helps a client show the user what they are about to approve. Pair it with tool annotations to describe which tools spend money, idempotency keys so a retried call doesn't charge twice, and URL elicitation to send the user to a payment page.
Frequently asked questions
Is structuredContent the same as LLM structured outputs?
No. The MCP specification says structuredContent is data produced by the server and is unrelated to LLM structured outputs, which constrain what a model generates. structuredContent is the tool's result as JSON. A model provider's structured outputs feature controls the shape of the model's own reply, which is a separate thing.
Do I have to provide an outputSchema to return structuredContent?
No. outputSchema is optional in the tool definition, and a tool can return structuredContent without one. But once a tool declares an outputSchema, the specification says the server MUST return structured results that conform to it, so declaring a schema is a promise your server has to keep on every call.
Which JSON Schema version does outputSchema use?
JSON Schema 2020-12 by default. The 2025-11-25 and 2026-07-28 tools pages both say outputSchema defaults to 2020-12 when no $schema field is present. You can set $schema to another draft, such as draft-07, if your tooling needs it. Make sure the client's validator supports the draft you choose.
Can outputSchema use $ref to point at a schema on another server?
Avoid it. SEP-2106 says implementations MUST NOT automatically fetch a $ref that resolves to a network URI, because that could be abused for server-side request forgery. Keep every $ref inside the same schema, such as #/$defs/Plan. A client may reject a schema whose external $ref it won't resolve.
Does the model see structuredContent or the text content?
That depends on the client, and the tools page we read doesn't require either. The Python SDK's documentation describes content as text for the model and structured_content as data for the application. Because clients differ, put everything the model needs to answer in the text block too.
Try it
Connect cartapi from the install page to see a commerce MCP server's tools in your client, or read the docs to call them from your own agent. For the eSIM side of the API, see our eSIM API guide.