MindRoom: tools split by read and write, not by endpoint

How Bas Nijholt halved MindRoom's tool schemas and kept small models accurate, for builders who own their agent's tools.

Say you run a two-person automation shop and you've built a client assistant on your own agent harness. You wired in Gmail, GitHub and Slack the quick way: each REST endpoint became one tool, about 80 in all. On a frontier model it mostly works. The client wants a local model for privacy, though. On that model every request carries thousands of tokens of schemas before anyone types a word, and prefill drags. A colleague suggests collapsing everything into one big tool per service. That would shrink the schemas, but your client also asked for an agent that can read mail and must ask before sending, and one tool per service would put reads and writes behind the same name.

Designing tools for the model, instead of mirroring the API you already had, removes most of that cost without the mega-tool trap. In a post dated November 28, 2026, Bas Nijholt describes redesigning all 155 built-in toolkits in MindRoom. Default functions went from 729 to 298 and total tool schemas shrank by 50%. On his GitHub benchmark, pooled across four small open-weight models and a hosted reference model, the redesigned shape matched the old one at a third of the prompt tokens.

What it is

A set of tool-design rules, each with a measurement behind it, from one developer who owns every toolkit in his harness. Nijholt's starting point: every tool schema travels with the conversation on every turn, so the shape of the schema is a cost you pay repeatedly. MindRoom's toolkits had looked like auto-converted REST APIs, with GitHub, Gmail and Docker exposing twenty to forty functions each. Mapped to the shop above:

The benchmark is the part to copy. Nijholt argues that frontier models get almost any tool call right, so a test suite that scores 20/20 gives no signal. He ran 400 trials: 20 GitHub tasks, four consumer-scale open-weight models plus gpt-5-mini as a hosted reference, and four schema shapes covering the same 39 operations. He reports the five read/write functions tied the 39-function REST layout at 93/100 exact first-try passes using a third of the prompt tokens (1,488 tokens against 4,480 in the benchmark's schemas, which strip MindRoom's harness parameter so only the API shape is compared). Two functions dropped to 83% and one mega-tool to 79%, while saving only a couple hundred more tokens. The failure logs showed why. A merged tool's parameter list grows to the union of every action, 42 parameters in the single-tool arm, so small models pass the wrong action's arguments. Its required list shrinks to the intersection, so models drop arguments that used to be mandatory. gpt-5-mini stayed at 95 to 100% on every shape, which would have hidden the 14-point drop.

The guidance from vendors points the same way. P99Log's survey of OpenAI, Anthropic, Google and MCP guidance, from November 13, 2026, recommends designing around workflows over endpoints, namespacing names such as asana_search and jira_search, and using enums wherever valid values are limited. It also notes GitHub cut its MCP server's default from 101 tools and 64.6k tokens to 52 tools and 30.3k tokens in October 2025.

Nijholt also tested the objection that prompt caching makes schema tokens free. Across 345,924 of his own requests over seven days, 91.8% of tokens were cache reads, yet input and cache tokens still made up 81% of spend, by his count.

Alternatives, each from its own source:

Who it's for

Pick this up if you run your own harness or own the MCP servers your agent uses, if you connect more than a handful of integrations, and especially if you target local or small hosted models. Nijholt says smaller schemas matter most as a share of the bill on shorter loops, fresh subagents, cold cache writes and local models where every extra thousand tokens slows prefill. It also fits anyone who needs approval gates on writes, since the read/write split does that in code.

Skip it, or start elsewhere, if your agent does pure coding through a shell, where Nijholt's own tests favoured a single shell tool. Skip it if you consume vendor MCP servers you can't edit; toolsets or tool search are your levers there. And if your work is mostly long threads, Nijholt notes conversation history and tool outputs dominate the cached prefix, so trimming a few thousand schema tokens is a small slice of that thread's cost.

Before and after

Before:

  1. Point a converter at each REST API and get one tool per endpoint.
  2. Ship the whole list on every turn, with shared arguments repeated in each function and optional parameters carrying anyOf null branches.
  3. Test on the frontier model you develop with, see near-perfect scores, and move on.
  4. Enforce "read only" with a prompt, or with argument parsing in the approval layer.
  5. Find out about a name collision when one integration quietly shadows another.

After:

  1. Group each service's verbs under a required action enum, then split that into read and write functions, with more write tiers for big APIs.
  2. Emit plain types for optional parameters that default to None, and explain shared helper arguments once in the system prompt.
  3. Prefix every integration function with its toolkit name.
  4. Give a read-only agent only the read functions.
  5. Benchmark schema shapes on the weakest model you'd ship, and keep the shape where accuracy holds and tokens drop.
  6. Lock the rules in CI. MindRoom fails a pull request that adds a duplicate function name, an unprefixed integration function or a mutating default action, and keeps a short Tool Design Rules section in AGENTS.md.

Try it

Pick one toolkit you own that has grown endpoint-shaped, such as an email or ticketing integration with eight or more functions, and run this.

  1. Measure the baseline. Serialize the toolkit's schemas as compact JSON and count tokens. Nijholt used tiktoken with the o200k_base encoding; Jahanzaib Ahmed's measurement post used the same encoding and notes it is OpenAI's tokenizer, so Claude counts will differ. Write the number down.
  2. Write five to ten tasks. Make each one unambiguous with one correct call, the way Nijholt's GitHub benchmark used 20 unambiguous tasks. Include at least one task that needs an optional argument and one that is a write.
  3. Run them on your weakest model. Use the smallest model you'd actually ship, not your daily frontier model. Record exact first-try passes and prompt tokens.
  4. Regroup. Merge the functions into <toolkit>_read and <toolkit>_write, each with a required action enum and no default action. Emit plain types for optional parameters that default to None. If the write function now mixes harmless and destructive actions, split it by risk tier.
  5. Rerun and compare. It worked if schema tokens dropped, passes held or improved, and a read-only configuration lists only the read function. If passes fell, read the failures for the two bugs Nijholt found: arguments belonging to a different action, and dropped arguments that were required before the merge. Either one means you merged too far; split again.

To keep the rules from eroding, here is our example of lines for your agent's AGENTS.md or CLAUDE.md, adapted from the rules Nijholt says MindRoom enforces:

The last line comes from a catalog trap Nijholt hit: a chat_ui entry saying it "never controls the user's browser" kept ranking next to the browser tool in keyword search until the clause was deleted.

Where it breaks

Nijholt also says he chose five GitHub functions from parameter overlap and approval risk tiers rather than sweeping four against five against six, so the best split for an API of a different size remains a number each builder has to measure.

Sources