Skip to content

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

Open
chr-hertel wants to merge 4 commits into
modelcontextprotocol:mainfrom
chr-hertel:test/output-validation-gaps
Open

chr-hertel wants to merge 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

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 added bug Something isn't working Server Issues & PRs related to the Server component labels Oct 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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