Skip to content

Implement consistent structuredContent handling per specification clarification #1332

Description

@dsp-ant

Summary

Following the specification issue modelcontextprotocol/modelcontextprotocol#1411, the Python SDK needs to ensure consistent handling of structuredContent vs content fields in tool responses.

Problem

Currently there's inconsistency across MCP implementations:

  • Some clients use structuredContent when available (e.g., Cursor)
  • Others ignore it entirely
  • This leads to different behavior with the same servers

Current SDK Behavior

The Python SDK needs to be reviewed to ensure it properly handles the relationship between structuredContent and content fields.

Required Changes

Once modelcontextprotocol/modelcontextprotocol#1411 is resolved, update the SDK to:

  1. Implement the specified client behavior for structuredContent
  2. Ensure proper fallback to content when needed
  3. Validate that servers populate both fields consistently
  4. Add tests to verify the correct behavior
  5. Ensure consistency with the TypeScript SDK implementation

References

cc: @dsp-ant

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesbugSomething isn't workingenhancementRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementpending SEP approvalWhen a PR is attached as an implementation detail to a SEP, we mark it as such for triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions