KaziKazi

How do you stop MCP tool definitions from filling an agent's context window?

Don't load every tool's schema into the prompt; let the agent search for the tools it needs and read their exact schemas only at that point. Connect a few large MCP servers and the definitions alone can eat a big share of the context before the user says a word. Kazi indexes your tools and finds them on demand, and runs multi-step API work as code instead of one tool call at a time.

Ken Wiltshire, founder of Kazi · Checked against the product on 2026-11-14

Where the tokens go

Every tool an agent might call needs a name, a description and an input schema in its context. Ten tools is nothing. Five servers with 50 tools each is a few hundred definitions, sent on every turn, mostly unused.

It costs twice: you pay for those tokens on every turn, and the model has to pick the right tool from a crowd, which it does worse.

Progressive discovery

  • List the services available, with a line each.
  • Search for tools relevant to the task.
  • Fetch the exact schema for the one or two tools you're about to call.

The agent carries a small, stable set of discovery tools instead of the whole catalog. Your own MCP servers get indexed the same way when you connect them.

Code execution does the rest

The other big waste is tool results. Pull 2,000 rows through a tool call and they all land in context. Run the call in code, filter there, and only the answer comes back. That's why Kazi runs multi-step API work as Python in a sandbox. Details in why AI agents need code execution.