The same LED display, almost dark, with only a few acid-lime cells lit at the bottom A tall LED display in a dark room, packed with violet and cyan cells that overflow its top edge

One program,not many calls.

How AI agents use tools now: the model writes code that calls them, instead of calling them one by one.

150,000 tokens in the model’s memory. One cell is 2,000.

CallsEvery tool result is pasted into the model’s memory.

CodeThe model writes one program. Only what it prints comes back.

Every result takes a seat.

The model asks for one tool and waits. The whole result is pasted into its context. Then it decides the next call. Each step is a round trip, and the model reads every row, even the ones it only passes along.

A field of violet and cyan LED cells, so full that cells break loose and drift upward
→ get_expenses("ops")+38,400
→ get_expenses("dev")+48,800
→ get_expenses("hr")+15,500
→ get_budgets()+21,300
→ compare(rows)+24,000
5 round trips, 12,857 rows read≈150,000

Example task: find the three biggest overspends across three teams. One cell is 2,000 tokens.

75 times less context

75×, drawn in glowing cells: the 7 and the 5 in violet and cyan, the × in lime

Less context for the same job. Anthropic reported one agent task falling from 150,000 tokens to 2,000 once tools were handled as code.

Anthropic Engineering, “Code execution with MCP”, November 2025.

Not for every call.

Code does the work.

Tools become functions. The model writes one program, the sandbox runs it, and only what it prints comes back. MCP still connects the tools; the model just reaches them through code.

You mark the tool once

{
  "name": "get_expenses",
  "description": "Expense rows for one team.",
  "input_schema": {
    "type": "object",
    "properties": {"team": {"type": "string"}}
  },
  "allowed_callers": [
    "code_execution_20260120"
  ]
}

The lit lines are the only new part. They let code call the tool.

A cube-shaped lattice of unlit glyph cells: the sandbox, empty The lattice is dark again; three short rows of lime cells have left it

The model writes a programThirteen lines. About 400 tokens, and that is all it sends.

The calls run in the sandbox12,857 rows arrive. None of them reach the model.

The filtering happens there tooLoop, compare, keep what is over budget.

So does the sortingThe three biggest gaps come first.

Only the print comes backThree lines. About 1,600 tokens.

import json over = []for t in ["ops", "dev", "hr"]:    raw = await get_expenses({"team": t})    for r in json.loads(raw):        gap = r["spent"] - r["budget"]        if gap > 0:            over.append((gap, r["item"])) over.sort(reverse=True)for gap, item in over[:3]:    print(f"{item}: +{gap:,}")
Cloud hosting: +4,200Team offsite: +1,850Software seats: +930
2,000 tokens in the model’s memory. One cell is 2,000.

The model kept three lines.

Everything else stayed in the sandbox.

Agents built this way