Agent tool call budget calculator
Every tool call appends raw JSON back into the conversation history, so step 15 re-sends steps 1 through 14 all over again. Model quadratic tool-call token burn and set exact per-run dollar caps below.
Interactive calculator
| Agent Policy | Tokens / Run | Cost / Run | Monthly Bill | Savings vs Uncapped |
|---|
How to stop quadratic tool-call token growth
- Truncate tool outputs before appending them to context. A single raw log dump or full HTML fetch adds 6,000 tokens that get re-billed on every remaining step.
- Load only the 6 to 10 tool schemas needed for the active task. Attaching 40 global MCP tools burns 10,000+ input tokens on every single turn.
- Keep your tool definitions in a fixed sorted order. Reordering JSON keys between turns invalidates Anthropic and OpenAI prompt caches immediately.
- Enforce a hard per-run step limit and USD ceiling in your runner. Most runs that fail to converge by step 15 are stuck in a retry loop.
Common questions
Why do multi-step agent costs grow quadratically?
Because LLM APIs are stateless. On step k, you resend the system prompt, all tool schemas, and the accumulated outputs of steps 1 through k-1. Doubling tool calls nearly quadruples total input tokens.
How many tokens does each MCP or function tool schema add?
A typical JSON tool schema with parameter descriptions runs 220 to 320 tokens. Loading 20 tools adds roughly 5,400 tokens to every single step in the loop.
How much does 80% prompt caching save on tool-call loops?
Since steps 2 through N reuse the previous conversation prefix, prompt caching cuts cached input token prices by 50% on OpenAI and 90% on Anthropic.
What is a safe hard per-run cap for production agents?
Set your hard cap at 2.5x your median successful run cost. That leaves room for one legitimate retry while killing infinite loops before they drain your monthly budget.
All calculations run 100% locally in your browser with zero external API calls. Model rates and hardware figures reflect published 2026 provider rate cards.