MCPサーバーにツールを追加したら、Copilot が一方しか呼ばなくなった件The author discovered that adding multiple tools to an MCP server caused VS…
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy
- MCPサーバーに複数のツールを定義したところ、VS Code Copilot がそのうち一方しか呼び出さないという問題に直面した経験を共有し、原因と対処法を解説している。
- MCP連携の落とし穴を把握できる実践的な記事。
- The author discovered that adding multiple tools to an MCP server caused VS Code Copilot to invoke only one of them, and shares the root cause and workaround.
- A practical heads-up for developers building multi-tool MCP servers.
要約と収集メタデータをもとに生成した AI 解説本文です。元記事全文の転載・翻訳ではありません。This AI explainer is generated from the summaries and collected metadata, not from a reproduction or translation of the full source article.
MCP(Model Context Protocol)サーバーに複数のツールを定義したところ、VS Code の GitHub Copilot がそのうち一方しか呼び出さなくなった——。開発者向けブログで共有されたこの体験談は、MCP を使ってエージェント機能を拡張する際に見落としがちな落とし穴を浮き彫りにしている。
MCP は、Anthropic が提唱した、大規模言語モデル(LLM)と外部ツールやデータソースを接続するためのオープンな規格である。VS Code はエージェントモードでこの MCP に対応しており、ローカルやリモートの MCP サーバーが公開する「ツール」を Copilot が必要に応じて呼び出せる。各ツールには名前と説明(description)、入力スキーマが与えられ、モデルはユーザーの指示とこれらのメタ情報を突き合わせて、どのツールを実行するかを判断する仕組みだ。
今回の問題は、サーバー側に複数のツールを登録したにもかかわらず、Copilot が特定の一つばかりを選び、もう一方を呼ばないというものだった。原因として考えられるのは、ツールの説明文が曖昧だったり、機能の境界が重なっていたりして、モデルが両者を区別できていないケースである。ツール名や説明が似通っていると、LLM が「同じ役割」と解釈し、処理を片方に寄せてしまう可能性がある。
MCPサーバーに複数のツールを定義したところ、VS Code Copilot がそのうち一方しか呼び出さないという問題に直面した経験を共有し、原因と対処法を解説している。
対処としては、各ツールの説明文を具体的にし、いつ・どのような入力で使うべきかを明示することが有効とされる。名前を明確に差別化し、想定するユースケースや出力形式を description に書き込むことで、モデルの選択精度が上がると見られる。ツールの粒度を見直し、役割が重複しないよう再設計するアプローチも考えられるだろう。
こうした挙動は Copilot に限った話ではない。ツール選択は最終的に LLM の判断に委ねられるため、Anthropic の Claude や OpenAI の function calling でも、説明の質がツール呼び出しの成否を左右する。MCP の採用は OpenAI をはじめ各社へ広がりつつあり、サーバー実装のノウハウは今後さらに重要度を増すとみられる。ツールを「増やす」だけでなく、モデルが正しく使い分けられるよう「伝える」設計が問われている。
The Model Context Protocol (MCP) has quickly become a common way to connect large language models to external tools and data, and a recent developer report highlights a subtle pitfall: when several tools are registered on a single MCP server, GitHub Copilot in Visual Studio Code may consistently reach for only one of them. For teams building custom MCP servers to extend Copilot's agent capabilities, understanding why this happens matters, because a tool that is never invoked effectively does not exist.
MCP, introduced by Anthropic in late 2024 and since adopted across a range of editors and assistants, defines a standard interface through which a client — such as VS Code's Copilot Chat in agent mode — can discover and call the tools that a server exposes. Each tool typically advertises a name, a natural-language description, and a JSON Schema describing its input parameters. The model does not execute the tools directly; instead, it reads these advertised descriptions and decides, based on the user's request and the surrounding context, which tool to call and with what arguments. That decision is probabilistic and driven by the language model, not by deterministic routing logic.
This design is precisely where the reported problem appears to originate. According to the author, defining two tools on the same server led Copilot to invoke only one of them, even in situations where the other tool seemed to be the better match. The likely cause is that the tool descriptions and schemas were similar enough that the model could not reliably distinguish between them, or that one description was phrased broadly enough to appear to cover both use cases. When descriptions overlap, the model tends to converge on whichever tool seems most generally applicable, leaving the second tool unused.
The practical takeaway is that tool metadata is not boilerplate; it is effectively the prompt that steers the model's selection. The workaround discussed centers on making each tool's purpose unambiguous. That includes writing distinct, specific descriptions that state clearly when the tool should and should not be used, choosing tool names that reflect narrow responsibilities, and tightening the input schemas so the required arguments differ in ways the model can key on. Explicitly noting the intended trigger conditions — for example, describing one tool as handling read operations and the other as handling writes — appears to help the model disambiguate. Reducing the number of tools per server, or splitting responsibilities so each tool has a single clear job, is another commonly recommended practice.
The author discovered that adding multiple tools to an MCP server caused VS Code Copilot to invoke only one of them, and shares the root cause and workaround.
This behavior is not unique to Copilot. Because tool selection is delegated to the underlying model, the same ambiguity can affect other MCP clients and function-calling implementations, including Claude Desktop, Cursor, and applications built directly on the OpenAI or Anthropic function-calling APIs. Vendors have documented that model performance tends to degrade as the number of available tools grows and as their descriptions become less distinct, which is why guidance often suggests keeping tool counts modest and descriptions precise.
For context, VS Code added support for MCP servers to Copilot's agent mode over the course of 2025, allowing developers to plug in local or remote servers that expose custom capabilities alongside built-in features. GitHub Copilot's agent mode can chain multiple tool calls to accomplish a task, which makes reliable tool selection even more consequential: if the agent never considers a tool, entire branches of intended functionality remain inaccessible. Debugging such issues can be awkward, since the failure is silent — there is no error, just an unused tool.
The broader lesson from this report is that building an MCP server is as much an exercise in clear communication with a language model as it is in software engineering. Developers are encouraged to test their servers with realistic prompts, inspect which tools the client actually calls, and iterate on descriptions much as one would refine a prompt. As MCP adoption continues to expand across editors and agents, treating tool descriptions as a first-class part of the design — rather than an afterthought — is likely to become a standard part of the workflow.
本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (qiita.com) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (qiita.com).





