You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tool/mcptoolset/tool.go's result conversion in mcpTool.Run keeps only *mcp.TextContent blocks. Every other content-block class — EmbeddedResource, ResourceLink, ImageContent, AudioContent — is silently discarded:
The same text-only loop is used for the IsError path, and when res.StructuredContent is non-nil the content blocks are ignored entirely.
Real-world impact
GitHub's official MCP server (github/github-mcp-server, also the hosted api.githubcopilot.com endpoints) returns get_file_contents file bodies as an EmbeddedResource block alongside a status-line TextContent (pkg/utils/result.goNewToolResultResource). Through mcptoolset, the model therefore receives only:
successfully downloaded text file (SHA: …)
with no file content at all — the agent is effectively blind to every file it reads, with no error or indication anything was dropped. Directory listings (plain text) survive, which makes the loss non-obvious. Files ≥ 1MB come back as ResourceLink, also dropped.
Related: #1352 covers the "no text content in tool response" error, which is what a result consisting only of non-text blocks currently produces — the two issues are adjacent but distinct.
Suggested behavior
At minimum, flatten EmbeddedResource with textual content (Resource.Text, or Resource.Blob with a text-like MIME type) into the text output, and represent ResourceLink/binary resources legibly (URI + MIME + size) rather than dropping them. Ideally, image/audio blocks would map to genai inlineData parts.
Workaround
Supplying Config.Client with a custom *mcp.Client carrying an AddSendingMiddleware that rewrites EmbeddedResource/ResourceLink blocks into TextContent before the conversion runs restores the content losslessly. Happy to upstream a PR along those lines if useful.
Observed on v2.2.0; main is currently identical for this file.
Thanks for the detailed report. I ran into the same issue and have been looking into it as well. I’ve put together a possible backward-compatible fix and am planning to open a PR shortly. The current approach keeps the existing output behavior while preserving non-text MCP content blocks. I’d be happy to adjust it based on feedback.
Activity
ktsoator commentedon Aug 25, 2026
Thanks for the detailed report. I ran into the same issue and have been looking into it as well. I’ve put together a possible backward-compatible fix and am planning to open a PR shortly. The current approach keeps the existing
outputbehavior while preserving non-text MCP content blocks. I’d be happy to adjust it based on feedback.fix(mcptoolset): harden non-text result conversion
fix(mcptoolset): pin both halves of the non-text guard
fix(mcptoolset): report non-text-only tool results instead of droppin…
fix(mcptoolset): handle MIME charset edge cases
fix(mcptoolset): render non-text unstructured tool results (#1401)
fix(mcptoolset): report non-text-only tool results instead of droppin…
fix(mcptoolset): render non-text unstructured tool results (google#1401)
fix(mcptoolset): report non-text-only tool results instead of droppin…
fix(mcptoolset): render non-text unstructured tool results (google#1401)