AI tool schema design decides how many tokens an agent burns before it does any work, and the developer behind the open-source agent platform MindRoom says most teams get it wrong. After redesigning all 155 built-in toolkits, MindRoom cut its default functions from 729 to 298 and halved total tool schema size.
Why schemas cost tokens on every turn
An agent request is mostly plain text plus one block of structured data: the schemas for every tool the model is allowed to call. To use a tool, the model answers with its name and arguments. The surrounding software runs the code locally, returns the output, and the cycle starts again.
Those schemas ride along with every turn of the conversation, so their size is a running cost. Turning a REST API into an MCP server with one tool per endpoint repeats shared arguments over and over. An email integration could expose five separate functions for reading, writing, drafting, starring and archiving, each carrying to, message_id or subject. One email tool with an action argument covers the same ground and pays for the shared fields once.
What changed in MindRoom
MindRoom started about a year and a half ago on the Agno framework, chosen mainly for its 87 ready-made integrations, among them GitHub, Gmail, Slack and Docker. The project swapped out Agno’s runtime by late October after piling up 126 workarounds. This week the developer removed what remained, in around 21 hours, with a parallel orchestrator setup.
Owning the toolkits freed MindRoom from Agno’s one-function-per-endpoint layout. Services like GitHub, Gmail and Docker had exposed twenty to forty functions each. Folding related verbs into one tool with an action parameter shrank the catalog from 729 default functions to 298 and cut schema size by 50%. All 39 GitHub actions remain available.
In MindRoom’s representative Claude agent fixture, the fixed per-turn prefix fell by 57% and the tool list shrank from 23 functions to 9. The calculator went from eight functions to a single calculate tool. The result included a tightened default system prompt that dropped stale instructions.
Why AI tool schema design stops short of one giant tool
The developer first considered collapsing each toolkit into one mega-tool, then rejected the idea. Permissions and human approvals sit at the function boundary. A read-only agent should never be handed the write function, rather than being asked in a prompt not to use it. When reads and writes share one tool, the agent still sees every write argument, and the approval layer must inspect arguments on each call to separate a lookup from a delete.
So four built-in tools (triggers, desktop, browser and matrix_api) were split into separate read and write functions, and workflow was reduced to the same read and write pair. Splitting added some schema overhead because shared arguments now appear twice, but each of those five toolkits still ended up smaller than before.
GitHub got more granular treatment. Its 39 actions went into five functions: two for reading (repos and files in one, issues and pull requests in the other) and three tiers for writing (issues, pull requests, and repository changes). That keeps destructive operations apart from safe ones.
Two hidden sources of bloat
Looking across every toolkit at once exposed two other drains that affect most Python agent frameworks.
The first is optional parameters. A type such as limit: int | None = None makes standard JSON-schema generators emit an anyOf block with an integer branch and a null branch. That null branch is almost always redundant, since the parameter is already optional. MindRoom changed its generator so optional parameters defaulting to None get a plain JSON type, and an explicit null sent by a model is still accepted when the code runs. A single commit removed 71% of the anyOf blocks in the catalog. A test across five models on optional-heavy calls scored 40 of 40 before the change and 40 of 40 after. Parameters where null means something, such as a SQL limit where null returns all rows, were left alone.
The second is helper arguments. MindRoom attaches two optional ones to its tools. background_after moves slow work to a background job, and mindroom_output_path sends large outputs to disk. Describing them on every function cost close to 100 tokens per tool. The fix was to explain both once in the system prompt and let fast local tools skip them, which removed almost three quarters of that overhead.
A shell isn’t a substitute
For pure coding tasks, the developer’s tests on native agent tools showed a lone shell tool spending far fewer tokens than a full toolset. Shell access stops being enough once permissions and authentication matter. It’s hard to say “read my email, but ask me before sending” to an agent holding a shell. Narrow API scopes get messy across dozens of services, and signing in once through SSO while the agent software keeps the credentials beats handing over a raw token. Dedicated tool schemas still earn their place, which is why the design matters.
How to test your own AI tool schema design
Top models like Claude Opus 5.5 and GPT-6.2 Astra get nearly any tool call right however bloated the schema, so tests that score 10/10 or 20/20 reveal nothing. The advice from this work is to test with the weakest model you would still use for real work and see where it starts failing. In those tests, leading models cared little whether tool names matched ones seen in training, but the fixed token cost of each request mattered a great deal.
What teams can do this week
Teams that auto-convert a REST API into MCP can start by merging endpoints that share arguments, separating reads from writes, and stripping redundant null branches from optional parameters. Measure the fixed prefix before and after. MindRoom’s numbers suggest the savings are large, and they recur on every turn of every conversation.
Source: Bas Nijholt