Sulat.com / Writing on AISaturday, December 5, 2026
Enter →
Agent Engineering/5 December 2026

How Executor gives an agent 10,000 tools with Code Mode

Rhys Sullivan's Cloudflare Connect talk shows Executor letting an agent search a tool catalogue and write TypeScript for the calls it needs. I installed Executor and loaded Cloudflare's own API into it.

3D black E badge linking an orange tool card to a wall of thousands of tool icons
Illustration: Sulat, featuring the Executor logo

At a glance

  • Cloudflare Developers shared Rhys Sullivan's Connect 2026 talk on giving an agent 10,000 tools with Code Mode.
  • Sullivan's Executor turns MCP servers, OpenAPI specs and GraphQL APIs into one searchable TypeScript catalogue, and the model writes scripts against it.
  • I installed Executor 1.6.11 and loaded Cloudflare's OpenAPI file, which became 3,967 tools while the MCP endpoint still listed 7 tools in about 10 KB.
  • A script filtered 8,901 bytes of API results inside the sandbox, and a write request paused for approval until I declined it.
  • Sullivan names three places to run the model's code: an interpreter, QuickJS and Cloudflare's dynamic worker loaders.
  • I didn't run Executor Cloud, its apps or dynamic worker loaders, and no model wrote the scripts.

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.

Cloudflare Developers shares Rhys Sullivan’s Connect 2026 talk on X.

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:

Code
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.

Terminal showing Executor with 3967 Cloudflare tools, a DNS search and a script result
My terminal run: the catalogue count, a search, and the script’s returned result.
MeasureResult
Operations in Cloudflare’s OpenAPI file3,967
Tools Executor created from it3,967
Those definitions as plain text4.7 MB, about 1.2 million tokens at four characters a token
Tools on Executor’s MCP endpoint7, 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
Measured on my run of Executor 1.6.11. The token figure is my estimate from each operation’s name, description, parameters and request body.

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.

Hand-drawn comparison: 3,967 tool definitions versus 7 Executor tools in the model's context
Loaded with Cloudflare’s API spec, Executor still showed the model seven tools. Illustration: Sulat

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.

Hand-drawn: search the catalogue, write a short script; the model never sees the whole catalogue
The agent searches the catalogue, then writes a script. Illustration: Sulat

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:

Code
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.

Hand-drawn four steps: search, write a script, run in a sandbox, return only the filtered answer
One request, four steps, and only the last one reaches the model. Illustration: Sulat

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.

Hand-drawn: a GET ran straight away, a POST paused for approval and was declined
In my run, a read went through and a write waited for a person. Illustration: Sulat
Executor web dashboard listing the Cloudflare API and Swagger Petstore integrations
Executor’s local dashboard with the Cloudflare API added as an integration.

Where 1.6.11 differs from its docs

  • The README’s example adds a source with openapi addSource and a plain string for the spec. In 1.6.11 the tool is openapi.addSpec, and the spec is an object with kind and url.
  • 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.describe inside a program. In 1.6.11 it returned tool_not_found, and executor tools describe from the CLI worked instead.
  • The web dashboard asks for a token. executor open opens 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.

Hand-drawn list: interpreter, QuickJS, Cloudflare Worker loaders as places a model's code can run
Three places to run the model’s script, as Rhys Sullivan laid them out. Illustration: Sulat

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.

ProductWhere the script runsWhat it adds
ExecutorInterpreter or QuickJS for ad hoc scripts, dynamic worker loaders for appsOne catalogue and one set of policies shared across agents
Cloudflare Code ModeSandboxed V8 isolatesA whole API behind two functions, about 1,000 tokens
OpenCodeIts own interpreter, PsychoscriptDefault for MCP servers in 2.0
Perplexity Agent APIEmbedded QuickJS WebAssembly runtimeOn by default in its upper effort levels
Sources: Rhys Sullivan’s talk, Cloudflare’s Connect session listing, and my earlier reporting on OpenCode and Perplexity.

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: