Lazy Namespace Discovery as a Third MCP Shape

Parlup left a comment on the lazy-shape piece asking for the middle ground: instead of listing every tool up front, or looking each one up as needed, expose a few high-frequency tools directly and add one call that loads a small domain group once per session. Ahmet Özel asked the follow-up that decides whether the idea is real: is it the grouping that does the work, or the caching? I built the registry and measured all three shapes on it, so the answer is numbers now, not an opinion.
The registry is six real MCP servers, 69 tools, all listed through real clients: filesystem (16 tools), memory (9), sequential-thinking (1), everything (16), postgres (1), github (26). Brave-search would not start without an API key, so it is out and recorded as such. Eleven jobs ran through the shapes: the same six file jobs as the earlier lazy-shape piece, plus five cross-domain jobs so the namespace question is actually tested. No model anywhere in the loop. The calls are fixed in advance and only the token counts are measured, the same method as the earlier pieces.
Rent by domain, in tokens, because this table is the first surprise:
| Domain | Tools | Rent (tokens) |
|---|---|---|
| filesystem | 16 | 4,204 |
| memory | 9 | 3,182 |
| sequential-thinking | 1 | 611 |
| everything | 16 | 11,916 |
| postgres | 1 | 32 |
| github | 26 | 3,395 |
| Whole registry | 69 | 23,330 |
Read the everything row twice. Sixteen tools, 11,916 tokens, nearly three times the filesystem's 4,204 for the same count. Github carries 26 tools for 3,395, the cheapest per tool on the table. Tool count is a bad proxy for rent. Description verbosity is what matters, and the everything server's descriptions are long. If you are counting tools to estimate context cost, you are measuring the wrong thing.
The three shapes, over the eleven jobs:
| Shape | Rent | Toll | Results | Total |
|---|---|---|---|---|
| A: list everything | 23,330 | 0 | 21,508 | 44,838 |
| B: lookup per tool | 208 | 4,410 | 21,508 | 26,126 |
| B, cached lookups | 208 | 3,942 | 21,508 | 25,658 |
| C: namespace discovery | 1,141 | 15,709 | 21,508 | 38,358 |
The namespace shape beats the static list by 6,480 tokens and loses to the per-tool lookup by 12,232. The load is the reason. Three domains touched, 15,709 tokens of loads, and the everything load alone is 11,916. One verbose domain eats more than half of what the shape saves against the static list. The hot tools are cheap, 1,141 for four tools plus the load call. The loads are where the money goes.
So where does the namespace shape stop paying? The budget against the static list is 22,189 tokens, the rent it saves. Touching all six domains costs 23,340 in loads, more than the budget. A session that wanders across five or six domains pays more for namespace discovery than for listing everything up front. A session that stays in one or two domains wins by a lot: the six file jobs alone touch no extra domain, so on those the namespace shape costs 1,141 plus results and nothing else. The shape is a bet on locality. If your sessions stay inside a domain or two, it is the cheapest honest shape on the table. If they wander, it is a tax.
The break-even for the lookup shape moved a long way on the bigger registry. On 16 tools it was about 16 jobs uncached, 23 cached. On 69 tools it is about 58 jobs uncached, 65 cached, because the rent saving is 23,122 now and the per-job lookup toll is only about 400. A bigger registry makes the lazy shape look better for longer. That is the opposite of what most people assume, and it follows directly from the arithmetic: the saving grows with the registry, the toll grows with the jobs.
That leaves Parlup's compounding factor, and it is the part that decides the lookup shape, not the namespace one. In the static shape the tool list sits in the prompt-cached prefix. In the lookup shape every schema lookup lands in the uncached tool-result history. If the host strips resolved lookups after the call succeeds, the lookup shape costs what the table says. If it does not, each lookup gets re-sent on every later call, and I computed that cost from the call sequence: the same eleven jobs would cost 63,372 instead of 26,126, worse than listing everything. That number is a computed projection, not a measured host run, and I am labelling it as one, because no model or host was in this loop to measure it on. But the direction is not in doubt. The lookup shape's win depends entirely on eviction. Without it, it is the most expensive shape, not the cheapest.
Which brings back Ahmet's question, grouping or caching. The answer is both, in different places. The grouping does the work in the namespace shape: it is what keeps the rent at 1,141 instead of 23,330 while the session stays local. The caching does the work in the lookup shape: without it, the per-tool toll compounds past the static list. I did try one without the other, in the sense the question means: the namespace shape has grouping with no per-tool caching, and the lookup shape has caching with no grouping. Grouping wins when the session is local. Caching wins when the session is long. Neither wins everywhere, and the everything domain is the proof that a grouping is only as cheap as its most verbose member.
There are limits, and they are the same kind as the earlier pieces. No model ran here, so nothing about answer quality was measured, only tokens. The cross-domain jobs are small and local; github and postgres tools were never called, only counted toward the rent, because they need credentials and a database. The registry is six servers I could install, not a production surface. What carries over is the shape of the numbers, not the counts: rent follows description length, loads follow domain verbosity, and the lookup shape's win is conditional on eviction in a way the namespace shape's win is not.
What grouping do you actually run, if any? And does your host evict resolved schema lookups, or do they sit in the history getting re-sent? I want the real answer, not the documented one. The namespace shape's case depends on the first, and the lookup shape's case depends on the second.
P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam
Comments
Join the discussionNo comments yet. Be the first to comment.







