Tool responses with both content text and structuredContent: text is hidden
Summary
When an MCP tool response contains both content[0].text and structuredContent, Claude Code renders only the structuredContent JSON. The content[0].text is not displayed to the user, though the model does receive it.
Reproduction
- MCP tool handler returns:
return {
content: [{ type: 'text', text: 'IMPORTANT INSTRUCTION\n\n---\n{"results":[...]}' }],
structuredContent: { results: [...] }
};
- Claude Code displays the
structuredContentas formatted JSON - The "IMPORTANT INSTRUCTION" text in
content[0].textis not visible
Expected behavior
Both should be visible, or at minimum the content[0].text should take priority since it's the primary content field in the MCP protocol. structuredContent is supplementary.
Workaround
Omit structuredContent when the text content contains important instructions that must be visible.
Impact
MCP servers that enrich tool responses with instructions (e.g., type schema guidance after issue creation) have those instructions silently hidden from the user. The model receives the text and can act on it, but the user has no visibility into what the model was told.
Environment
- Claude Code CLI (latest)
- macOS
- MCP server: custom HTTP streamable transport
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗