What an MCP tool should return: content blocks, structuredContent and outputSchema
The MCP spec gives a tool five kinds of content block, a structuredContent field, an outputSchema and an isError flag. Here is what each one is for, what the 2026-07-28 spec actually requires, and how to shape results so the model and your code both get what they need.
Most MCP advice is about the front half of a tool: the name, the description, the input schema. That part matters, and we've written about it before. But the back half, what the tool hands back, gets a lot less attention, and it's where plenty of agents quietly go wrong. A result that dumps 40KB of raw JSON into the model's context, or reports a failure as a cheerful success, or forgets the one ID the model needs on its next call, will wreck a loop no matter how good the description was.
The current MCP tools specification (revision 2026-07-28) is pretty specific about result shape. This post goes through the pieces in the order you'll actually reach for them, with the rules the spec states and the habits that follow from them.
The basic shape
A tools/call response under the 2026-07-28 revision carries a resultType of "complete", a content array, and optionally structuredContent and isError. The weather example in the spec is about as plain as it gets: one text block saying the temperature is 72°F and partly cloudy, and isError: false.
That content array is the unstructured side, and it can hold several items of different types. The spec defines five: text, image, audio, resource_link and resource (an embedded resource). Images and audio travel as base64 data plus a mimeType. A resource link is a URI with a name, optional description and MIME type, which the client can fetch or subscribe to later. An embedded resource carries the actual contents inline, text or blob, under a URI.
Here's the thing to keep in mind. content is what usually ends up in front of the model. Whatever you put there, the model reads, and you pay for it in tokens on this turn and every turn after it as long as it stays in history. So the first question for any result is how little the model needs to see to make its next decision.
Text first, and keep it short
For most tools, a single text block is the right answer. Not a serialized database row with 30 columns, either. Write the sentence a helpful coworker would say: "Found 3 open invoices for Acme, total $4,120, oldest is 47 days overdue." If the model needs the full rows, give it a way to ask for them, like a get_invoice tool or a resource link, instead of shoving everything in up front.
You can return several text blocks, and sometimes that helps. A search tool might return one block per hit so a client can render them separately. But don't split for the sake of it. One clear block beats five fragments the model has to stitch back together.
Images and audio: only when the model will actually look
The image and audio types exist for tools whose output really is visual or audible: a chart render, a screenshot, a voice clip. They're expensive. As we covered in our screenshot cost breakdown, a single 1920x1080 frame can run a couple thousand input tokens depending on the model, and a loop that keeps old frames around pays for them again every turn.
Every content block, text included, can carry optional annotations with an audience ("user", "assistant" or both), a priority and a lastModified time. The spec's image example marks its picture audience: ["user"] with priority 0.9. That's a hint that the image is meant for the human watching, not for the model's reasoning. Annotations are hints, not commands, and a client is free to ignore them. Still, if your tool produces a preview image the model doesn't need, tagging it for the user gives a good client permission to keep it out of the context window.
Resource links versus embedded resources
These two get confused because they look almost the same in JSON. The difference is whether the data comes along for the ride.
A resource_link is a pointer. A file search tool might return links to file:///project/src/main.rs and two other files, each with a name and MIME type, and let the client decide whether to pull them in. The spec notes these links aren't guaranteed to show up in resources/list, so don't build anything that assumes they will.
An embedded resource is the payload itself. Use it when the model definitely needs the contents right now and fetching them would just be an extra round trip. The spec says servers that embed resources SHOULD implement the resources capability, which makes sense: if you're handing out resource URIs, a client may reasonably come back and ask for one again. For the bigger picture on how resources differ from tools, see our post on resources, prompts and tools.
The rule of thumb is simple. Large or maybe-needed data goes out as a link. Small and definitely-needed data gets embedded.
structuredContent is for your code
structuredContent is the structured side of a result: any JSON value, object, array, string, number, boolean or null. If the tool declares an outputSchema, the structured content has to conform to it.
The spec goes out of its way to say this field has nothing to do with LLM "structured outputs," the schema-constrained generation feature on model APIs. It's data the server produces. Think of it as the machine-readable version of the answer, for the client, a UI, a downstream step in a pipeline, or a model that's been given the JSON on purpose.
There's one compatibility rule you shouldn't skip. A tool that returns structured content SHOULD also return the serialized JSON in a text block. The spec's get_weather_data example does exactly this: structuredContent holds {"temperature": 22.5, "conditions": "Partly cloudy", "humidity": 65} and the content array holds the same thing as a JSON string. Older clients that only read content still get the answer.
That rule can bite you on big results, since you're now shipping the data twice. If the structured payload is large, think hard about whether all of it belongs in the result, or whether a summary plus a handle would do.
outputSchema is a promise
Declaring an outputSchema on a tool is a contract. Per the spec, servers MUST return structured results that conform, and clients SHOULD validate them. Like inputSchema, it follows JSON Schema and defaults to draft 2020-12 when there's no $schema field. The schema doesn't have to be an object, either. The spec shows a list_users tool whose output schema is an array of user objects.
Why bother? Because a client that knows the shape ahead of time can do real things with it: render a table, feed a field straight into the next tool call, or reject a malformed result before it confuses the model. It also forces you to decide what the tool actually returns, which tends to shake out sloppy, shape-shifting results where a field sometimes exists and sometimes doesn't.
The flip side is that you can't fudge it. If your tool sometimes returns a different shape, like a partial result during an outage, either put that variant in the schema or report it as an error. Don't hand back something that breaks your own contract.
isError versus a protocol error
The spec splits failures into two kinds, and getting this right is one of the cheapest wins in agent reliability.
Protocol errors are standard JSON-RPC errors for problems with the request itself: an unknown tool, a request that doesn't match the call schema, a server fault. The spec's example is code -32602 with "Unknown tool: invalid_tool_name." Clients MAY show these to the model, but the spec says they're less likely to lead to recovery.
Tool execution errors are normal results with isError: true. They're for API failures, bad input values and business-logic problems, anything the model could fix by trying again differently. The spec's example tells the model a departure date must be in the future and gives it the current date, which is exactly the kind of message that lets a model fix its own mistake on the next try. Clients SHOULD pass these to the model.
So if a user asks to book a flight for yesterday, don't throw a JSON-RPC error. Return isError: true with a sentence that says what was wrong and what would be right. We dig into the recovery side of this in handling tool errors in agent loops.
Handles: the ID the model has to carry
The 2026-07-28 revision dropped protocol-level sessions, which we covered in our stateless revision explainer. That changes what a stateful tool has to return. The spec's non-normative guidance on stateful tools says a server that needs to keep something across calls, like a shopping cart, a browser context or a database transaction, should return an explicit handle from a creation tool and take it as an argument on later calls.
Their example is a create_basket tool that returns the text "Created basket bsk_a1b2c3" plus structuredContent of {"basket_id": "bsk_a1b2c3"}. The model then passes basket_id into add_item. Notice the handle is in both places. The model reads it from the text, and code reads it from the structured field.
The guidance has a few points worth stealing. Handles should be opaque, so nobody's tempted to parse or guess them. On an authenticated server a handle is a name, not a capability, so check authorization on every call. On an unauthenticated server it's effectively a bearer token, so give it real entropy, something like a UUIDv4, and a bounded lifetime. Put the retention policy in the creation tool's description, something like "baskets expire after 24 hours of inactivity," so the model knows the rules before it creates anything. And when a call hits an expired handle, return a tool execution error that says so, so the model can make a new one instead of looping.
When the tool needs more input
One more result type is worth knowing. Instead of a complete result, a server can answer tools/call with resultType: "input_required" and a set of input requests, such as an elicitation/create form asking for a GitHub username, plus an optional opaque requestState. The client gathers the answers and retries the call with inputResponses and the same requestState, under a new JSON-RPC id. That's the multi round-trip requests pattern, and it's the right move when you need a confirmation or a missing value rather than guessing.
How this lands on the model side
Your MCP client eventually converts these results into whatever the model API expects. On Claude's Messages API, for example, a tool_result block takes its content as a string or a list of text, image, document or search_result blocks, plus an optional is_error flag. That maps cleanly from MCP text, images and isError. The other MCP block types have no direct equivalent there, so the client has to decide how to translate them.
That's really the argument for writing results with care. You don't control every client that will call your server. A short, honest text block, isError set when something failed, structured data that matches the schema you declared, and handles the model can carry forward will survive pretty much any translation layer. A raw JSON dump might not.