A tool named list_users on a revision 2026-07-28 server declares an outputSchema whose top-level type is an array of user objects. The developer also wants older clients that read only the content array to receive the data. Which approach follows the 2026-07-28 tools specification?
Select an answer to reveal the explanation.
Short Explanation
Think of structuredContent as a typed box that can hold any JSON value, arrays included. You put the array straight in, and you also drop the same JSON as text so older clients aren't left empty-handed. The trap is believing it has to be an object.
Full Explanation
The tools specification defines structuredContent as a JSON value in the result that may be any JSON type: object, array, string, number, boolean or null, as long as it conforms to the tool's outputSchema when one is declared. An outputSchema whose root is an array is therefore legitimate, and the server returns the array itself. For backwards compatibility, a tool that returns structured content SHOULD also return the serialized JSON in a TextContent block, so clients that only read the content array still receive the data. Wrapping the array in an artificial object misreads the rule; the object-only restriction belonged to earlier thinking about tool output, not to this revision, and it would also break conformance with the declared array schema. Dropping structuredContent and sending only text discards the validation and typing benefits that the outputSchema exists to provide. Encoding the data as a base64 blob inside an embedded resource confuses binary resource contents with structured tool output; JSON is text and has no reason to be treated as binary. Exam caveat: when an outputSchema exists, the server MUST return conforming structuredContent and clients SHOULD validate it. Operational check: call the tool, confirm structuredContent is a JSON array that validates against the outputSchema, and confirm a text block carries the same serialized JSON.