Skip to content

[MCP] Copilot Chat silently discards type:"resource" content blocks from MCP tool results — get_file_contents returns no file content #312042

@madhushesharam

Description

@madhushesharam

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: 1.115.0 (Universal) Commit: 41dd792 Date: 2026-04-07T22:04:57Z Electron: 39.8.5 ElectronBuildId: 13703022 Chromium: 142.0.7444.265 Node.js: 22.22.1 V8: 14.2.231.22-electron.0
  • OS Version: Darwin arm64 25.3.0 (macOS)

Steps to Reproduce:

  1. Configure the GitHub remote MCP server in .vscode/mcp.json:
    {
    "servers": {
    "github": {
    "type": "http",
    "url": "https://api.githubcopilot.com/mcp/",
    "headers": { "Authorization": "Bearer ${input:github_mcp_pat}" }
    }
    }
    }

  2. Open Copilot Chat in Agent mode. Confirm GitHub MCP server is
    connected and get_file_contents tool is listed and enabled.

  3. Ask the agent to read any file from any GitHub repository
    you have access to:
    "Read the file README.md from /"

  4. Observe the agent calls get_file_contents with correct parameters
    and receives "successfully downloaded text file (SHA: ...)" but
    has no access to actual file content. Agent retries 2-3 times
    and gives up without ever reading the file.

  5. Open Output panel → GitHub Copilot Chat and observe this error:
    [error] Error from tool read_file with args
    {"filePath": "vscode-chat-response-resource://.../"}:
    File vscode-chat-response-resource://... is outside of the
    workspace, and not open in an editor, and can't be read

Expected: Agent receives actual file content and uses it.

Actual: File content silently discarded. Agent only sees
"successfully downloaded text file" and never the file content.

Root Cause:
The GitHub MCP server returns file content as two content blocks
per the MCP specification:

  • Block 1 type:"text" → "successfully downloaded text file"
  • Block 2 type:"resource" → { uri: "repo://...", text: "" }

VS Code Copilot Chat's MCP tool result parser processes only
type:"text" blocks and silently discards type:"resource" blocks.
The actual file content sits in the resource block and is never
passed to the agent.

Proof — identical bug fixed in OpenCode (another MCP client) in
24 hours on Jan 12 2026 by updating the MCP tool result parser:

No server change required. Pure client-side parser update needed
in github.copilot-chat extension.

Upstream references:

Metadata

Metadata

Assignees

Labels

insiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions