DEV Community

One tool or three? Measuring what MCP tool schema design costs in tokens

Every MCP server has to make the same design decision, and almost nobody measures it: do you expose one tool with several parameters, or several tools with one parameter each?

The usual argument is about the model. Fewer, fatter tools are easier to choose between. More, thinner tools are easier to validate. Both are reasonable. Neither mentions the thing that shows up on your invoice, which is that every tool schema is serialised JSON sitting in the prompt on every single call. So I measured it.

The setup

One endpoint, deepseek-v4-flash, one fixed user message: What is the weather in Paris on 2026-12-05?. max_tokens 120. Three runs of each shape.

Shape A - one tool, three parameters:

{ "name": "get_weather", "parameters": { "city": { "type": "string" }, "units": { "type": "string", "enum": ["c", "f"] }, "date": { "type": "string" } } }

Shape B - the same capability split into three tools, one parameter each: get_weather_city, get_weather_units, get_weather_date.

Both shapes can answer the same question. Only one of them is cheap.

What came back

Shape prompt_tokens completion_tokens
A - one tool 347, 347, 347 104, 66, 85
B - three tools 427, 427, 427 120, 120, 120

Two results, and the second one surprised me.

The prompt cost is 80 tokens, +23%, before the model says anything. That part is structural. You are serialising three JSON schemas instead of one, including three name fields, three description fields and three parameter wrappers. It does not depend on the model and it does not go away.

The completion cost went up too, and hit the cap every time. Shape A needed between 66 and 104 tokens to answer. Shape B hit max_tokens 120 on all three runs. Three callable tools is a bigger decision space than one, so the model spends more output deciding which tool to call before it calls anything. Total went from 432 average to 547, +27%.

What this does and does not prove

Two caveats worth stating before anyone quotes these numbers.

The prompt side was perfectly stable across runs - 347 and 427 every single time. The completion side was not, and it moved in one direction. This is exactly the case where a single run would have made the split look cheaper than it is, because you might catch a lucky 66-token completion on shape A and conclude the difference is small.

Second, this is one flash model on one endpoint. A model with better tool discrimination might not pay the completion penalty, because it would not need extra tokens to decide. The prompt overhead is structural and should hold anywhere; the completion overhead is a model behaviour and should be re-measured per model.

What I would do with it

The interesting question is not "which shape is cheaper" in general. It is whether your agent picks correctly with one fat tool. If it does, splitting the schema buys you nothing and costs 23% on every call in the loop. If it does not - if your agent picks the wrong tool often enough that you need the smaller decision space - then the split is worth paying for, and you should know that you are paying roughly a quarter more per call for that reliability, not just a rounding error.

The measurement itself takes about ten minutes and a few cents. Send the same prompt twice, once with each shape, and compare usage.prompt_tokens. It is the cheapest design decision you will ever have data for.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.