Gemini CLI PR preserves MCP structuredContent instead of throwing parse errors
abdul-karim-mia · ghdev · 2026-12-01
A community PR (#30554) to google-gemini/gemini-cli fixes transformMcpContentToParts and getStringifiedResultForDisplay so MCP structuredContent payloads (2025-06-18 spec) are preserved instead of dropped or failing with [Error: Could not parse tool response] when content is omitted.
- Adds helpers (isMcpContentBlock, getMcpResponsePayload, hasDuplicateStructuredContent) in mcp-tool.ts; emits a wrapUntrusted(safeJsonStringify(...)) text part for structured-only responses.
- Uses node:util isDeepStrictEqual to avoid duplicate payloads from the backwards-compatible JSON TextContent shim and McpComplianceTransport; non-equivalent blocks in content are preserved alongside.
- Includes 4 regression tests; vitest (109 tests), typecheck, eslint, and prettier all pass. Fixes issue #30545.
More from coding & agent
- Reddit user compares Zapier, Make, n8n and AI-native workflow platforms — Flesizer · 2026-12-01
- Building an agent to manage a shared Outlook inbox for freight coordination — getrichquick5 · 2026-12-01
- Remory: agent memory at 5.2% context with near full-context scores — jiqizhixin · 2026-12-01
- GTA AI recomp dev's Claude disabled after using employer's subscription, project halted — banteg · 2026-12-01
- Design agency makes clients build sites with AI first, then redoes everything — michalmalewicz · 2026-12-01
- Team rewrote Cursor from scratch with a swarm of Grok agents in 6 weeks — tristanbob · 2026-12-01