Cloudflare Developers has shared Rhys Sullivan’s Connect 2026 talk on giving an agent 10,000 tools. Sullivan runs Executor, an open-source layer that connects agents to MCP servers and APIs, and his answer to the 10,000-tool problem is Code Mode: the agent searches a catalogue and writes TypeScript for the few calls it needs. I installed Executor, loaded Cloudflare’s own API into it, and checked what the model would see and what the sandbox does.
The problem Sullivan describes
Sullivan starts from the idea that an agent needs to do everything its user can. Every tool costs context. He says that at 100 tools about half the context window goes on tool names and schemas, and at 1,000 tools the list no longer fits.
Claude Code’s bash tool looked like the way out, and plenty of people concluded that agents want fewer tools and more command-line programs. Sullivan’s view is that a bash tool only moves the execution environment. It’s the place where an agent finds tools, chains them and filters their output before it reaches the context. He says bash works well and that he often wants a CLI himself. His objections are that calling an API through a CLI brings a whole Unix shell and its permissions along, and that CLIs are lossy, because nothing standard tells an agent what a program like GitHub’s can do short of reading its help menus. He adds that OpenAPI specs have described which calls are destructive for about 20 years, and the move to CLIs threw that away.
Code Mode turns every tool into a typed TypeScript function and indexes the catalogue so it can be searched. The model then writes a script instead of calling tools one at a time. A script can also filter a result before it enters the context, so the model doesn’t call a tool, read the shape of the output and call it again. Sullivan puts that repeat at about 300 milliseconds a call, which he says will matter more as models get faster, especially when the tool is destructive.
What Executor is
Executor is open source. You add an integration (an MCP server, an OpenAPI spec or a GraphQL API), create a connection with its credentials, and set a policy for each tool: allowed, needs approval, or blocked. Any MCP-compatible agent then shares the one catalogue. It runs as a local CLI, a desktop app, a hosted cloud, or self-hosted on Docker or Cloudflare. Sullivan describes the company as a personal cloud where you connect your accounts and build your own software on top. In the talk he says the product matters less than the idea underneath it: give the model somewhere to run untrusted code and build on that.
What I ran
I installed Executor 1.6.11 from npm on a 4 vCPU Intel Xeon at 2.3 GHz with 15 GB of memory and a 252 GB disk, running Ubuntu 24.04.5 on kernel 6.18 with Node 22. No model was involved. I wrote the scripts and sent them to Executor’s MCP endpoint myself, so this checks what a model would see and what the sandbox does, not how well a model writes the scripts.
Executor pauses for approval when you add an integration or create a connection, and I approved both from the CLI. These are the commands for the Cloudflare catalogue:
npm install executor
npx executor daemon run
npx executor call executor openapi addSpec '{"spec":{"kind":"url","url":"https://raw.githubusercontent.com/cloudflare/api-schemas/main/openapi.json"},"slug":"cf","authenticationTemplate":[]}'
npx executor resume --execution-id <id> --base-url http://localhost:4788 --action accept --content '{}'
npx executor call executor coreTools connections create '{"owner":"user","integration":"cf","name":"demo","template":"none"}'
Cloudflare’s OpenAPI description is a file of about 30 MB. Executor turned it into 3,967 tools, the same as the number of operations in the file.

| Measure | Result |
|---|---|
| Operations in Cloudflare’s OpenAPI file | 3,967 |
| Tools Executor created from it | 3,967 |
| Those definitions as plain text | 4.7 MB, about 1.2 million tokens at four characters a token |
| Tools on Executor’s MCP endpoint | 7, in 10,137 bytes before and 10,145 bytes after loading Cloudflare’s API |
| Search for “list dns records for a zone” | First result was the list-DNS-records endpoint for a zone |
Cloudflare’s own session abstract puts its API at 2,500 endpoints and 1.17 million tokens if every one is exposed as a tool. The file I loaded has 3,967 operations, more than the 2,500 endpoints Cloudflare cites, and my estimate lands in the same range.

The seven are execute, skills and resume, plus four artifact tools. Discovery happens inside an execute program, where the script calls tools.search to find a tool by words. The catalogue grew by nearly 4,000 tools and the endpoint’s tool list grew by eight bytes.

A script that filters before the model sees anything
For a real call I used the public Swagger Petstore, since the Cloudflare API needs an account token. This is the script I sent through execute:
const res = await tools.pet3.user.demo.pet.findPetsByStatus({ status: "available" });
const pets = res.data;
const cats = {};
for (const p of pets) { const c = p.category?.name ?? "none"; cats[c] = (cats[c] || 0) + 1; }
const top = Object.entries(cats).sort((a, b) => b[1] - a[1]).slice(0, 3);
return { rawBytes: JSON.stringify(pets).length, petCount: pets.length, top };
The call returned 8,901 bytes of pet records. They stayed in the sandbox, and the endpoint returned a count of 54 pets and the top three categories: Dogs 37, none 14 and unknown 1. The stack trace from a failed call named a QuickJS runtime, so the local CLI runs these scripts in QuickJS.

Reads run, writes wait
Executor starts each tool’s policy from the spec, and for an OpenAPI source GET requests are allowed by default. The read above ran without a prompt. When I sent a POST that adds a pet from inside a program, Executor paused it, printed the request and returned an execution ID with instructions to resume it with accept or decline. I declined, so nothing was written to the public store.


Where 1.6.11 differs from its docs
- The README’s example adds a source with
openapi addSourceand a plain string for the spec. In 1.6.11 the tool isopenapi.addSpec, and the spec is an object withkindandurl. - The Petstore spec lists a relative server path. Until I passed a
baseUrl, every call failed with “Internal tool error”, which the README’s note on relative servers explains. - The docs show
tools.search.describeinside a program. In 1.6.11 it returnedtool_not_found, andexecutor tools describefrom the CLI worked instead. - The web dashboard asks for a token.
executor openopens it already signed in.
Where the code runs
Sullivan says the model’s TypeScript has to run somewhere and lists three options. OpenCode wrote an interpreter, so it doesn’t run JavaScript at all and has no runner to ship. I covered that engine when it came out as Psychoscript. QuickJS is a minimal JavaScript runtime that compiles to WebAssembly and embeds easily, and he says Pi uses it for its Code Mode, with slightly worse performance and a worse security trade-off. Cloudflare’s dynamic worker loaders are much faster than QuickJS, at the cost of billing per unique worker.

Cloudflare’s pricing page charges $0.002 per unique Dynamic Worker per day, on top of normal request and CPU pricing, and a Worker counts as unique by its ID and its code. Cloudflare’s launch post says that for Code Mode, where every Worker is a one-off, that works out to $0.002 a Worker, which it calls negligible next to the cost of generating the code. Executor uses two of the options. In the demo, ad hoc Code Mode goes through the interpreter, and the apps framework for repeatable extensions runs on dynamic worker loaders.
Beyond calling tools
Most of the demo is about what you can build once the model can run code. Sullivan connects Google’s APIs, has the agent find emails with personal details left out, then asks it to extend the read-email tool with storage so he can take notes on each message. The model gets a Git source to write to and defines an app that takes requirements and outputs tools plus instructions. It wrote a migration, extended the tool, read the notes back from SQL, and the app deployed to a dynamic worker. He describes an Executor app as one bundle that holds tools, skills and webhook handlers, and shows skills defined in code and fetched from a well-known path.
The same idea covers approvals. A rule can say that any refund under $20 runs and anything larger asks, or it can ping your phone for a second factor, because the policy is code. Sullivan’s pitch is to move permissions out of the agent and into a gateway, and he names Cloudflare’s MCP gateway as another place to do it, so every harness you use gets the same tools and the same rules. He calls the result tools as a cloud: you deploy Code Mode extensions to your own MCP servers the way you’d deploy a website.
Where this sits
Code Mode is now everywhere. I’ve explained what it is, and Claude Code added it as an opt-in where Claude writes JavaScript for several tool calls at once. OpenCode 2.0 made it the default for MCP servers, and Perplexity put it in its Agent API. Cloudflare has its own version, which another Connect session describes as collapsing any number of tools into two functions and about 1,000 tokens, running agent scripts in sandboxed V8 isolates where credentials never reach the model.
| Product | Where the script runs | What it adds |
|---|---|---|
| Executor | Interpreter or QuickJS for ad hoc scripts, dynamic worker loaders for apps | One catalogue and one set of policies shared across agents |
| Cloudflare Code Mode | Sandboxed V8 isolates | A whole API behind two functions, about 1,000 tokens |
| OpenCode | Its own interpreter, Psychoscript | Default for MCP servers in 2.0 |
| Perplexity Agent API | Embedded QuickJS WebAssembly runtime | On by default in its upper effort levels |
Executor’s docs say when to use which mode. Direct call suits one tool or a few, and Code Mode (execute) suits work where one tool’s output feeds the next or a large result needs filtering before it enters the context.
What I didn’t run
I didn’t run Executor Cloud, the desktop app, the self-hosted Cloudflare version, apps, skills or dynamic worker loaders. No model wrote any of the scripts, so I can’t say how reliably a model writes them. Those parts come from Sullivan’s talk and Executor’s documentation.
Sources and further reading:
- Giving an agent 10,000 tools with Code Mode, Cloudflare Connect 2026
- Executor on GitHub
- Code mode and tool execution, Executor docs
- Sandboxing AI agents, 100x faster, Cloudflare
- Dynamic Workers pricing, Cloudflare
- Code Mode: Fit 2,500 API endpoints into 1,000 tokens, Cloudflare Connect 2026
- Cloudflare Developers on X



