AI agents just got a better pattern
AI agents just got a better pattern.
Cloudflare's "Code Mode" turns MCP tools into a TypeScript API and lets the model write code against it. Instead of calling tools one by one in a slow, token-heavy loop, the model generates a complete script that orchestrates multiple tool calls in a single execution.
Instead of calling tools one by one in a slow, token-heavy loop, the model generates a script that orchestrates everything in a single pass.
You get richer workflows, fewer wasted tokens, and sandboxed execution that only reaches approved MCP servers. The model writes code, not tool calls.
This is worth watching for anyone building agents. The shift from "call tools sequentially" to "write code against a tool API" changes the economics and reliability of agentic workflows significantly.