MCP audit
Problem
Section titled “Problem”MCP tool definitions (schemas) included in a request add input whether used or not. Some clients defer schemas through virtual tool grouping, as described below. When all schemas are sent on each step of an agent loop, the cost multiplies:
tokens per task ≈ (tool schema tokens × steps) + accumulated conversation + tool responsesAn idle server whose full schemas are loaded still costs tokens on each step; deferred schemas can change this baseline.
Actions
Section titled “Actions”Run a monthly audit
Section titled “Run a monthly audit”- List every MCP server and its tool count (the tools picker, Configure Tools, shows them).
- For each server, note how often you used it last month (Agent Debug Logs show tool calls).
- Decide per server:
| Usage | Decision |
|---|---|
| Used most days | Keep |
| Used occasionally | Keep disabled by default, enable per task |
| Rarely/never, or duplicated by another tool | Remove |
| Large server where you need two tools | Use a narrower server or a small CLI the agent calls from the terminal |
- Re-measure the first-request input size and the baseline task (Measure your usage).
On-demand tool loading and virtual grouping
Section titled “On-demand tool loading and virtual grouping”Recent VS Code Copilot builds can group a large tool catalog into virtual tools and defer full schemas until a group is activated (a tool-search step such as tool_search, where supported). Once activated, the group’s schemas can remain in later requests for the session; behavior depends on the build and model. If grouping is disabled or unsupported, full schemas may be sent from the start. Check Agent Debug Logs and Cache Explorer rather than assuming a cache saving. The experimental github.copilot.chat.virtualTools.threshold controls when grouping is used (VS Code settings reference). Disabling unused MCP servers per workspace remains the most reliable baseline for reducing the available catalog.
Scope per workspace, not globally
Section titled “Scope per workspace, not globally”Put MCP configuration in the repository (.vscode/mcp.json) so each project loads only what it needs: a
backend repo does not need design-tool servers; a frontend repo does not need database-schema tools. Reviewing
a per-repo file is also easier than a global list.
Replace long knowledge with Skills
Section titled “Replace long knowledge with Skills”Repeated or large reference material (a house style, a runbook, API notes) can be packaged as an agent skill that loads on demand instead of sitting in always-on instructions. Benefits: less repeated input, one place to update, consistent results.
Keep tool output small
Section titled “Keep tool output small”Tool results are often the largest part of the context (file reads, grep, shell output). Prefer targeted searches over reading whole files, and exclude noisy paths (Keep context lean).
How to verify
Section titled “How to verify”Record the first-request input tokens in Agent Debug Logs before and after pruning, then run the same task and compare credits and success. Keep the change only if quality held.
Trade-offs
Section titled “Trade-offs”A pruned tool the task needed leads to workarounds and extra steps. Keep a fast way to re-enable tools, and prune by evidence (usage), not by guesswork.
Illustrative numbers
Section titled “Illustrative numbers”The talk deck this page draws on describes a team that reduced 187 tools to 52 and reports about a 72% drop in agent-task token use. We could not verify that case independently; use it as an example of the method, and measure your own result. TokenEconomizer automates the same idea by pruning tools that go unused across sessions (see the case study).
Further reading (papers)
Section titled “Further reading (papers)”Ordered by venue tier, then citations. Findings are hypotheses to verify on your own workload; see the full list in Papers.
- MCP-Zero: Active Tool Discovery for Autonomous LLM Agents — preprint 2025, 55 citations. Lets the agent request tools on demand instead of injecting all tool schemas.
- RAG-MCP: Mitigating Prompt Bloat in LLM Tool Selection via Retrieval-Augmented Generation — preprint 2025, 41 citations. Retrieves only the relevant MCP tool descriptions instead of loading every tool (prompt bloat).
- Less is More: Optimizing Function Calling for LLM Execution on Edge Devices — preprint 2024, 33 citations. Presents a smaller selected tool set at function-calling time to cut cost on edge devices.
Sources
Section titled “Sources”- Optimize AI credit usage — Keep the tool catalog focused
- Use tools with agents (VS Code)
- Token Efficiency and Context Engineering — developer talk deck (June 2026), MCP sections (figures as reported)