Skip to content

Tool selection via availableDeferredTools with MCP Registry-style server names doesn't work properly #299749

@LukasHeimann

Description

@LukasHeimann

To integrate tools from MCP Servers into the prompt sent of to the LLM, GitHub Copilot creates names for each of them and puts them into availableDeferredTools in the system prompt. It seems like these names are constructed from MCP Server name (as put into mcp.json + tool name (as announced by the MCP server).

For servers of the MCP Registry, especially if the registry is enforced as an allowlist, the server name must follow the MCP Registry spec, so typically something like io.github.{owner}/{repo} (when the github-based authentication is used). Compare also https://modelcontextprotocol.io/registry/authentication

This leads to an unfortunate situation for the generated tool names. For the MCP Server io.github.upstash/context7, they would be something like mcp_io_github_upstash_context7_resolve_library_id, which is already confusing since most tools will now have a name that includes "github". Except it's even worse, since there's some additional length-based cropping going on so that the actual tool name is mcp_io_github_ups_resolve_library_id, which as you can see, doesn't include context7 at all anymore.

As a consequence, the LLM doesn't know to use the tool, and we have a problem.

I understand the need to not bloat the context window with MCP Servers too much, but the current situation with conflicting naming strategies creates a problem. Perhaps a quick solution would be to base the name of the availableDeferredTools not on the config, but on the server-announced title of the MCP server, falling back to the name.

  • Copilot Chat Extension Version: 0.38.1
  • VS Code Version: 1.110.0
  • Feature (e.g. agent/edit/ask mode): agent
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): Claude 4.5 Opus

Steps to Reproduce:

  1. Add an MCP Server like Context7 with it's MCP Registry-compliant server name
  2. Check the system prompt in the chat debug view for availableDeferredTools

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugchat-mcpinsiders-releasedPatch has been released in VS Code Insidersmcp

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions