Skip to content

docs: give the real reason outputSchema is not implemented - #125

Open
lukecotter wants to merge 1 commit into
certinia:mainfrom
lukecotter:docs/66-outputschema-cost
Open

docs: give the real reason outputSchema is not implemented#125
lukecotter wants to merge 1 commit into
certinia:mainfrom
lukecotter:docs/66-outputschema-cost

Conversation

@lukecotter

Copy link
Copy Markdown
Collaborator

Corrects one sentence in CLAUDE.md that gave a wrong reason for not implementing outputSchema.

What was wrong

CLAUDE.md said the MCP spec "asks for the payload to also be serialized into a text block, which would send it twice". The spec says:

For backwards compatibility, a tool that returns structured content SHOULD also return the serialized JSON in a TextContent block.

SHOULD, not MUST, and it is there for old clients. The spec's own array example declares an outputSchema, returns structuredContent, and puts prose in the text block instead of the serialized JSON. So a lean TOON block is legal beside structuredContent, and the rule we recorded as blocking does not block anything.

2026-07-28 does not change this. It relaxes the surrounding rules: structuredContent may be any JSON value, and outputSchema takes the full JSON Schema 2020-12 vocabulary.

What it says now

The two costs that are real and still unmeasured:

  1. outputSchema rides in tools/list, which every client loads on every turn, against a budget pinned at what 1.x charged.
  2. A client may read structuredContent rather than our text block, which spends the response-shaping saving.

#66 is rewritten to measure both before deciding.

Refs #66

CLAUDE.md said the MCP spec asks for the payload to also be serialized
into a text block, so a schema would send it twice. That is a SHOULD for
old clients, not a MUST, and the spec's own example pairs an outputSchema
with a text block that is not the serialized JSON. A lean TOON block is
legal beside structuredContent.

State the costs that are real instead: outputSchema is charged in
tools/list on every turn, and a client may read structuredContent rather
than our text block, which spends the shaping saving.

Refs certinia#66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant