Context Budget Calculator for AI Agents

Add up what your agent puts in its context window before it reads the question: instructions, MCP tool definitions, retrieved chunks, memory, history and room for the answer. Then check whether that window still fits next to your model on your GPU. For anyone building agents on a local or hosted model.

tool definitions sent up front

Approximate, measured by Anthropic with Claude's tokenizer (Nov 2025). Your model's tokenizer will differ.

tokens
tokens
tokens
answer + reasoning

Your agent uses 12,700 of 32,768 tokens (38.8%) before the user's question.

Retrieved chunks
History
Output reserve
The same budget as a table.
PartTokensShare of window
Instructions1,5004.6%
Tool definitions00%
Retrieved chunks3,2009.8%
Memory1,0003.1%
History3,0009.2%
Output reserve4,00012.2%
Free20,06861.2%

Does this window fit your GPU?

models with a published attention config
Weights, KV cache and the verdict come from the site’s compute module; GB are 10⁹ bytes.

Five MCP servers in three context windows

GitHub, Slack, Sentry, Grafana and Splunk servers with this tool’s defaults. Approximate, measured by Anthropic with Claude's tokenizer (Nov 2025). Your model's tokenizer will differ. With tools loaded on demand (4 per task), the same agent needs 16,200 tokens.
WindowUsed before the questionShareVerdict
32K67,700206.6%does not fit (over by 34,932)
128K67,70051.7%fits
200K67,70033.9%fits

How it works

Token sizes for the MCP servers are Anthropic's own measurements with Claude's tokenizer, so treat them as approximate: your model's tokenizer will count differently. Loading tools on demand is modelled as 500 tokens for a search tool plus 750 per tool it loads (our estimate from Anthropic's figures). Memory comes from the same compute module as every other page on this site.

  1. Pick the MCP servers your agent connects to, or a custom server with its tool count.
  2. Set the context window, the system prompt and how much retrieval, memory and history you keep.
  3. Turn on "load tools on demand" to see what tool search would save.
  4. Optionally pick a model and a GPU: the weights, KV cache and fit verdict come from the compute module.

Sources

Checked 2026-11-28.

Questions

How many tokens do MCP tools use?

Each tool's name, description and input schema is sent to the model up front. Anthropic measured a five-server setup (GitHub, Slack, Sentry, Grafana, Splunk) at 58 tools and about 55,000 tokens before the conversation starts, and a Jira server alone at about 17,000. Those are Claude-tokenizer counts; local tokenizers differ.

What is a context budget?

The share of the context window each part of an agent's prompt takes: instructions, tool definitions, retrieved documents, memory, conversation history, and room left for the answer. With the five-server setup above and this tool's defaults, the agent needs 67,700 tokens before the question: 206.6% of a 32K window, so it does not fit.

Why does a bigger context window need more VRAM?

Every token in the window is held in the KV cache while the model generates. For Qwen3.8 27B with an f16 cache, our compute module gives 2.3 GB at 32K and 8.7 GB at 128K, on top of the weights. Fewer wasted tokens means a smaller window, which means less memory.

Does tool search work with local models?

Tool search is a pattern, not a Claude-only feature: give the model one search tool and load full tool definitions only when it asks. With four tools loaded per task, the five-server setup above would use about 3,500 tokens for tools instead of 55,000. Local hosts such as LM Studio (since 0.3.17) and Open WebUI (since 0.6.31) speak MCP; whether a host defers tool definitions depends on the host and router you use.