Repository navigation
Description
Problem
When an MCP tool returns both content[].text and structuredContent, VS Code ignores the content array and only sends JSON.stringify(structuredContent) to the language model.
Evidence from source
In mcpLanguageModelToolContribution.ts:
Lines 307-323 — text content is skipped when structuredContent exists:
if (isForModel && !callResult.structuredContent) {
result.content.push({ kind: 'text', audience, value: item.text });
}Lines 366-378 — only stringified structuredContent is sent:
if (callResult.structuredContent) {
result.content.push({ kind: 'text', value: JSON.stringify(callResult.structuredContent), audience: [LanguageModelPartAudience.Assistant] });
}Expected behavior (per MCP spec)
Per the MCP specification, CallToolResult has:
content— human-readable result (text, images, etc.) for the model/userstructuredContent— machine-readable structured data conforming tooutputSchema
Both should be available. The spec doesn't indicate structuredContent should replace content.
Actual behavior
When structuredContent is present:
- Text items in
contentare skipped (if (!callResult.structuredContent)) - Only
JSON.stringify(structuredContent)is sent to the model
Impact
Tools cannot provide both:
- A human-readable markdown analysis for the model to understand context
- Structured data for programmatic use / UI rendering (e.g., MCP Apps)
Example: A flame graph profiler tool wants to return:
content[].text: Markdown analysis with findings and recommendationsstructuredContent: Profile data object for an interactive UI
Currently, the model only sees raw JSON of the profile data, losing the analysis.
Suggested fix
Either:
- Send both
content[].textAND the stringifiedstructuredContentto the model - Add a tool annotation to control behavior (e.g.,
structuredContentOnly: true) - Clarify if this is intentional and update MCP spec accordingly
Reproduction
- Create an MCP tool that returns both
contentandstructuredContent - Invoke it in VS Code Copilot
- Observe that the model only receives the stringified structured content
Example repo: https://github.com/digitarald/mcp-apps-playground (flame_graph tool)
Version
VS Code Insiders, January 2026
Activity
connor4312 commentedon Jan 29, 2026
It turns out structuredContent actually should not be presented to the model, its use case is PTC. Discussion here: modelcontextprotocol/modelcontextprotocol#1624
harrykitewing commentedon Apr 21, 2026
Any update or ETA on this? VSCode not adhering to the spec tripped us up in prod @ Kitewing.
fix(sidecar)!: drop api_call outputSchema so the response body reache…
pamelafox commentedon Jul 30, 2026
I encountered this with a Fabric Data Agent MCP tool in VS Code. The tool returned the full human-readable answer in content[].text, while structuredContent contained only:
VS Code displayed the full answer in the tool-call UI, but the subsequent model input contained only the stringified structuredContent. Copilot therefore knew a result existed but could not access the actual answer, so it kept trying to do calls to get a real answer (unsuccessfully).
dcasati commentedon Sep 23, 2026
I reproduced this with Microsoft Fabric IQ on:
The MCP
CallToolResultcontained both:{ "content": [ { "type": "text", "text": "{\"executionResult\":[/* complete query rows */]}" } ], "structuredContent": { "contentReference": "/* citation metadata only */" } }The same MCP request through Copilot CLI returned the complete rows to the model.
I locally changed:
to:
in
mcpLanguageModelToolContribution.ts. After rebuilding/patching VS Code, thesame Fabric IQ query returned the complete rows to the model successfully.
Carry the answer label into structuredContent.overview for Copilot
Carry the answer label into structuredContent.overview for Copilot
Carry the answer label into structuredContent.overview for Copilot