Skip to content

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

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
    SchemaIssues & PRs related to the Schema component
    P1Significant bug affecting many users, highly requested feature
    improves spec complianceImproves consistency with other SDKs such as TyepScript
    enhancementRequest for a new feature that's not currently supported
    on May 26, 2026
  2. added
    2026-07-28All issues and PRs related to the spec release 2026-07-28
    on May 26, 2026
  3. removed
    P1Significant bug affecting many users, highly requested feature
    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-28All issues and PRs related to the spec release 2026-07-28SchemaIssues & PRs related to the Schema componentenhancementRequest for a new feature that's not currently supportedimproves spec complianceImproves consistency with other SDKs such as TyepScript

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions