Skip to content

[Server] Fix outputSchema validation rejecting conforming structuredContent - #539

Merged
chr-hertel merged 4 commits into
modelcontextprotocol:mainfrom
chr-hertel:test/output-validation-gaps
Oct 7, 2026
Merged

chr-hertel merged 4 commits into
modelcontextprotocol:mainfrom
chr-hertel:test/output-validation-gaps

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

Follow-up to #515 - two cases were rejected although they conform on the wire:

  • a self-built CallToolResult with a JsonSerializable value was validated by its properties instead of its serialization
  • a nested empty object in a returned DTO was decoded to [], so it was sent as an array and failed validation

@chr-hertel chr-hertel added bug Something isn't working Server Issues & PRs related to the Server component labels Oct 7, 2026
A self-built JsonSerializable structuredContent and a nested empty object
in a returned DTO conform as sent, but fail outputSchema validation.
Decoding an object result into arrays turned every nested {} into [], which
was sent as a JSON array and now fails outputSchema validation.
A self-built JsonSerializable value was validated by its properties, not by
what it serializes to.
@chr-hertel
chr-hertel force-pushed the test/output-validation-gaps branch from 17f12ca to e831b86 Compare October 7, 2026 19:41
@chr-hertel
chr-hertel merged commit 10ea3be into modelcontextprotocol:main Oct 7, 2026
27 checks passed
@chr-hertel
chr-hertel deleted the test/output-validation-gaps branch October 7, 2026 19:47
@chr-hertel chr-hertel added the breaking change Breaking the Backwards Compatibility Promise label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking the Backwards Compatibility Promise bug Something isn't working Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant