Skip to content

[Schema] SEP-2106: Allow non-object outputSchema and structuredContent (arrays/primitives) #357

Closed

Description

@chr-hertel

Implements the non-object output portion of SEP-2106 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #337.

Spec summary

outputSchema fully drops the object-only restriction and accepts arrays/primitives/compositions. structuredContent widens from {[key:string]: unknown} to unknown, validated by outputSchema.

PHP SDK changes

  • The outputSchema path (today the formatters in src/Capability/Formatter/) must accept array/scalar return types without object wrapping.
  • Ensure structuredContent serialization handles non-object roots.
  • Continue emitting the back-compat TextContent mirror when output is array/primitive (verify against spec).
  • Client-side: Mcp\Client tool-listing types currently assume object-shaped structured content — relax type narrowing.

Related

Activity

  1. added
    Schema
    P1
    improves spec compliance
    enhancement
    on May 26, 2026
  2. added
    2026-07-28
    on May 26, 2026
  3. removed
    P1
    on Aug 19, 2026
  4. chr-hertel commented on Aug 19, 2026

    @chr-hertel
    MemberAuthor

    Implemented via #417, #421. See tests/Unit/Schema/NonObjectOutputSchemaTest.php.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-07-28Schemaenhancementimproves spec compliance

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions