What happened?
The client CLI's JSON serializer converts valid MCP ResourceLink and EmbeddedResource blocks to {"type": "unknown", "value": "..."} using Python's string representation. Their typed fields and nested resource content are no longer available as structured JSON. For text, image, and audio blocks, it preserves the primary payload but drops annotations and _meta.
This affects tool results printed by fastmcp call --json; prompt JSON output uses the same serializer and supports the same MCP content-block union. The CLI documentation says --json emits the raw result, including content blocks.
Could the CLI preserve all defined fields when serializing supported mcp_types.ContentBlock variants, including annotations and _meta on text/image/audio and the structured fields of resource_link and resource blocks?
Example Code
Version Information
- FastMCP main: `5baeacfe20eca735cb949564b4915f93a622b916`
- Python: 3.12.15
- OS: macOS 15.0.1 arm64
What happened?
The client CLI's JSON serializer converts valid MCP
ResourceLinkandEmbeddedResourceblocks to{"type": "unknown", "value": "..."}using Python's string representation. Their typed fields and nested resource content are no longer available as structured JSON. For text, image, and audio blocks, it preserves the primary payload but dropsannotationsand_meta.This affects tool results printed by
fastmcp call --json; prompt JSON output uses the same serializer and supports the same MCP content-block union. The CLI documentation says--jsonemits the raw result, including content blocks.Could the CLI preserve all defined fields when serializing supported
mcp_types.ContentBlockvariants, includingannotationsand_metaon text/image/audio and the structured fields ofresource_linkandresourceblocks?Example Code
Version Information