Agent Skills & Progressive Tool Discovery: Scaling Beyond 100 Tools
Stop stuffing 150 tool schemas into every prompt—learn how progressive disclosure, Agent Skills, and dynamic tool search keep context lean and tool accuracy high
Progressive tool disclosure (and Agent Skills) is a context-engineering pattern where an agent starts with only lightweight skill summaries and loads full tool schemas or domain instructions on demand.
Dumping 100+ MCP tool schemas into the system prompt burns 20,000–40,000 tokens on every single turn, destroys prompt caching, spikes cost, and causes tool-selection accuracy to plummet due to schema distraction.
Once an enterprise connects 5–10 MCP servers (GitHub, Jira, Slack, Postgres, Stripe, Datadog), the agent suddenly faces 150+ tools—and naive tool injection breaks both latency and accuracy.
You implement a 2-tier catalog: a compact index of skills/tools in the system prompt, plus a search_tools or load_skill meta-tool that dynamically mounts only the 3–8 schemas needed for the active task.
You benchmark tool-selection F1 and input tokens per turn as the catalog grows from 10 to 500 tools.
Explaining 'Progressive Disclosure' (L1: name + 1-line summary → L2: full instructions/schema on demand → L3: executable scripts/references) is the hallmark of a Staff-level Agentic AI Engineer.
Your agent connects to 8 MCP servers exposing 160 tools (~220 tokens per JSON schema). Roughly how many prompt tokens are wasted BEFORE the user even types 'Hi'?
- Model Context Protocol (MCP) Architecture
- Context Engineering: Compaction & Scratchpads
Context is a scarce attention budget, not an infinite junk drawer. Progressive disclosure applies lazy loading to agent prompts: keep the initial prompt small and cache-friendly, and load heavy instructions or tool schemas only when the current task actually triggers them.
1. The 3-Level Progressive Disclosure Architecture
Modern agent harnesses organize capabilities into three tiers:
| Tier | What Is Loaded | Token Cost | When Loaded |
|---|---|---|---|
| Level 1: Discovery Index | Skill/tool names + 1-line trigger descriptions | ~20–40 tokens each | Always in system prompt (cacheable!) |
| Level 2: Active Playbook / Schemas | Full SKILL.md instructions or exact JSON parameter schemas | ~500–2,000 tokens | Dynamically loaded when task matches |
| Level 3: Supporting Assets | Reference docs, SQL templates, helper scripts | On-demand reads | Only when executing a specific sub-step |
2. Tool Search (RAG for Tools)
When an agent has 200+ tools across multiple MCP servers:
- Index every tool's
name,description, and parameter tags in an in-memory BM25 + embedding index. - Give the LLM a lightweight meta-tool:
find_tools(query, top_k=5). - When the user asks "Refund invoice #882 and notify #billing on Slack", the agent searches once, mounts only
stripe_refund_invoiceandslack_post_message, and executes with near-100% schema accuracy.
3. Protecting Prompt Caching While Loading Dynamically
A subtle production pitfall: never mutate the top of the system prompt when loading a new skill or tool—that invalidates the entire KV prefix cache! Instead:
- Keep the Level 1 index frozen at the top of the system prompt (100% cache hit).
- Inject Level 2 skill instructions or dynamically discovered tool schemas as a tool observation message appended to the end of the conversation history.
The exact honest questions almost every beginner wonders — answered in plain English without hiding behind jargon.
Up to ~15–20 well-differentiated tools, static injection is simpler and faster (zero extra discovery turn). Above ~30–50 tools—or whenever tool schemas exceed ~5,000 tokens—dynamic tool discovery and Agent Skills pay off immediately.
Long-Horizon Context Compaction Animator (Beating Context Rot)
Watch context utilization climb toward 80% during a long coding run, then compact cleanly into a 18% high-signal handoff summary.
# Progressive Tool Discovery: Static Injection vs. On-Demand Top-K Mounting
TOOL_CATALOG = [
{"name": "stripe_refund", "desc": "Issue a full or partial payment refund for a Stripe charge", "tokens": 240},
{"name": "stripe_invoice", "desc": "Fetch customer invoice PDF and billing status", "tokens": 210},
{"name": "slack_post_msg", "desc": "Send a message to a Slack channel or thread", "tokens": 190},
{"name": "github_create_pr", "desc": "Open a pull request on a GitHub repository", "tokens": 260},
{"name": "postgres_query", "desc": "Run a read-only SQL query against analytics warehouse", "tokens": 230},
]
def search_tools(query: str, catalog: list[dict], top_k: int = 2) -> list[dict]:
q_words = set(query.lower().split())
scored = []
for t in catalog:
doc_words = set((t["name"].replace("_", " ") + " " + t["desc"]).lower().split())
overlap = len(q_words & doc_words)
scored.append((overlap, t))
scored.sort(key=lambda x: x[0], reverse=True)
return [t for score, t in scored[:top_k] if score > 0]
static_tokens = sum(t["tokens"] for t in TOOL_CATALOG)
selected = search_tools("refund payment and post to slack channel", TOOL_CATALOG, top_k=2)
dynamic_tokens = len(TOOL_CATALOG) * 25 + sum(t["tokens"] for t in selected)
print("Selected tools:", [t["name"] for t in selected])
print(f"Prompt schema tokens -> Static: {static_tokens} | Progressive: {dynamic_tokens}")