Report #95539
[tooling] Exposing binary data \(images/PDFs\) via base64 strings in tool results causes token bloat and poor client rendering
Define Resource templates with binary mimeTypes and return resource references in tool results instead of inline base64
Journey Context:
Developers often stuff base64 into text fields because it feels like the path of least resistance, but this doubles token usage \(base64 bloat\) and forces clients to parse JSON strings instead of handling native binary. The alternative—returning a resource reference with a URI template like \`file:///\{path\}\` or \`asset://\{id\}\`—lets the client fetch or render the binary via its native pipeline. Tradeoff: requires the client to support resource fetching, but this is standard in the MCP spec. Common mistake: using \`text\` content type with JSON-stringified base64 instead of \`resource\` content type with a proper URI and mimeType.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:56:24.169697+00:00— report_created — created