Skip to content

Use content instead of structuredContent in examples - #81

Merged
jonathanhefner merged 1 commit into
modelcontextprotocol:mainfrom
jonathanhefner:examples-use-content-for-now
Dec 5, 2025
Merged

Use content instead of structuredContent in examples#81
jonathanhefner merged 1 commit into
modelcontextprotocol:mainfrom
jonathanhefner:examples-use-content-for-now

Conversation

@jonathanhefner

@jonathanhefner jonathanhefner commented Dec 5, 2025

Copy link
Copy Markdown
Member

Not all MCP clients support structuredContent in MCP tool results, so examples now return data as JSON in content and parse it client-side.

Pattern used:

  • Server: content: [{ type: "text", text: JSON.stringify(data) }]
  • Client: JSON.parse(result.content!.filter(...).map(...).join(""))

🤖 Generated with Claude Code

@jonathanhefner
jonathanhefner force-pushed the examples-use-content-for-now branch from 60c5147 to 05cdaf5 Compare December 5, 2025 22:32
Not all MCP clients support structuredContent in MCP tool results, so
examples now return data as JSON in content and parse it client-side.

Pattern used:
- Server: content: [{ type: "text", text: JSON.stringify(data) }]
- Client: JSON.parse(result.content!.filter(...).map(...).join(""))

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jonathanhefner
jonathanhefner force-pushed the examples-use-content-for-now branch from 05cdaf5 to 61cd4ed Compare December 5, 2025 22:35
@jonathanhefner
jonathanhefner merged commit 437b918 into modelcontextprotocol:main Dec 5, 2025
1 check passed
ochafik added a commit that referenced this pull request Dec 11, 2025
…nt-for-now"

This reverts commit 437b918, reversing
changes made to d5b13b7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants