MCP & Architecture

Tool Discovery for AI Agents: Dynamic Lookup vs Loading 100+ Schemas

Loading dozens of tool schemas into every prompt wastes context tokens and degrades tool selection. Dynamic tool discovery lets an agent search a catalog on demand, inspect one input schema, and execute only what the current task needs.

Replace static multi-server tool lists with a 4-step loop: discover by job, inspect one contract, execute, and read the receipt.

Why static tool lists break past 20–30 tools

When an agent connects to five or ten separate MCP servers, every turn sends hundreds of JSON parameter definitions to the model before it reads the user prompt. Accuracy drops on overlapping names, prompt latency rises, and input-token bills grow on every message—even when the model only needs one search call.

  • Prompt overhead compounds on every turn in multi-step coding or research loops.
  • Near-duplicate tools from different vendors confuse model argument selection.
  • Updating or adding a vendor forces every teammate to edit local MCP config files.

How 4-tool dynamic discovery solves context overload

A remote MCP gateway exposes only four fixed meta-tools to the model: discover, inspect, call, and get_call. The agent searches by plain-language intent, inspects the exact schema for the single capability it picked, and invokes it with server-side credential injection.

Discover and inspect from CLI or Remote MCP
duang discover "company technographics"
duang inspect companies.technographics

When to pin a provider vs let discovery choose

Use capability-level discovery when multiple vendors return the same normalized shape (such as Google SERP or webpage Markdown reading). Pin a specific provider when you require a vendor-specific metric or want to route through your team's existing subscription in the $0 vault.

Try live capabilities right now.

Connect to your AI agent in 60 seconds.

Chat promptPaste into Claude Code, OpenClaw, OpenCode, Grok Bot, Antigravity, Hermes, or Pi

Read https://duang.ai/SKILL.md and use duang to run web.search.

Frequently asked questions

How many tools does Duang put in my agent's context window?

Always four tools: discover, inspect, call, and get_call. Regardless of how many data providers or team apps your workspace enables, the model only sees those four meta-tools until it inspects a specific capability on demand.

Does dynamic tool discovery work in Claude Code, Cursor, and Codex?

Yes. Point any MCP client at https://api.duang.ai/mcp or use the Duang CLI via SKILL.md. Discovery runs identically across Claude Code, Cursor, Claude Desktop, Codex, OpenClaw, and Windsurf.

Does discovery ever silently switch away from my team's own API key?

No. Team connections always take priority at $0, and if an account expires Duang pauses with a reconnect link rather than silently billing your cloud wallet.