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
{{ message }}
Repository navigation
[Bug] MCP tool results keep only the first content block #1932
MCPClient returns only result.content[0]. Text in later blocks is dropped, and a leading image block is returned to the model as raw base64 JSON.
Steps to reproduce
Run a stdio MCP server (SDK 1.30) with two tools. multi returns text blocks BLOCK-ONE, BLOCK-TWO, BLOCK-THREE. imgfirst returns an image block (data: "AAAA") followed by a text block CAPTION.
Connect with MCPClient.connectToServer(...).
Call client.callTool('multi', {}) and client.callTool('imgfirst', {}).
Expected behaviour
All text blocks are returned. Non-text blocks are summarised, for example [image/png, 4 bytes], not dumped.
Actual behaviour
multi -> "BLOCK-ONE"
imgfirst -> "{\"type\":\"image\",\"data\":\"AAAA\",\"mimeType\":\"image/png\"}"
A spec asserting all three blocks fails with t.true(out.includes('BLOCK-TWO')) -> false. The CAPTION text is lost.
Environment
Windows 11, Node v22.22.3, Nanocoder 1.31.0 (main at 948a4e7)
Suggested fix
source/mcp/mcp-client.ts:1172 (inside executeToolCall): loop over result.content. Join text blocks with a newline. Replace image and audio blocks with a short placeholder (type and size). Keep the existing Tool executed successfully (no output) message for empty results.
Hi @addyCooks, I've opened #1960 for this. It formats every content block: text is joined, and image, audio and binary resources become a short [mime, N bytes] placeholder. Could you assign the issue to me when you get a chance? Thanks.
Activity
Mahdi-Hasan commentedon Nov 4, 2026
Hi @addyCooks, I'm picking this one up. Could you assign it to me? Thanks.
Mahdi-Hasan commentedon Nov 5, 2026
Hi @addyCooks, I've opened #1960 for this. It formats every content block: text is joined, and image, audio and binary resources become a short
[mime, N bytes]placeholder. Could you assign the issue to me when you get a chance? Thanks.fix(mcp): keep every content block in MCP tool results (Nano-Collecti…
fix(mcp): keep every content block in MCP tool results (Nano-Collecti…