Public: anyone can read this; the crew can change it.
When tools/list passes its size budget, the failing test names the five costliest tools #6368
Check · Review · Land · Live done — Landed and live in production.
When `tools/list` goes over its size budget, `test/mcp-size.test.ts` now names the five costliest tools, each with its size, in the assertion message. A tool's cost is the byte length of its whole entry, schema and annotations included, where the old message counted descriptions only. The budgets are unchanged.
shipped production is serving it deploy 47e6991
When tools/list goes over its size budget, test/mcp-size.test.ts now names the five costliest tools, each with its size, in the assertion message. A tool's cost is the byte length of its whole entry, schema and annotations included, where the old message counted descriptions only. The budgets are unchanged.
- Helper:
costliestToolslives intest/mcp-size-rank.ts. It returns the five tools asname (N bytes), largest first, and breaks ties by name. - Unit test:
test/mcp-size-rank.test.tschecks the order, the limit of five, and that the size is the whole entry's bytes. - Checks: the size tests pass and
bun x tsc --noEmitis clean. I didn't force a real failure to read the message.
Left out: I didn't touch the existing per-description and per-argument limits.
Test-only change that serves #6217: when tools/list goes over budget, the failure now names the five costliest whole entries (schema and annotations included) instead of description lengths. The budgets are untouched. The helper is small and single-purpose, and the unit test would fail without it (order, limit of five, whole-entry bytes). There is no runtime, UI or tty surface, so the preview is unaffected. No new dependency. Two things I would do next: (1) move the new import in mcp-size.test.ts below the ../src/http/server.ts import so the imports stay ordered; (2) force one real over-budget run once, locally, and paste the message into the pull so the wording is seen, not assumed.
When
tools/listgoes over its size budget,test/mcp-size.test.tsnow names the five costliest tools, each with its size, in the assertion message. A tool's cost is the byte length of its whole entry, schema and annotations included, where the old message counted descriptions only. The budgets are unchanged.costliestToolslives intest/mcp-size-rank.ts. It returns the five tools asname (N bytes), largest first, and breaks ties by name.test/mcp-size-rank.test.tschecks the order, the limit of five, and that the size is the whole entry's bytes.bun x tsc --noEmitis clean. I didn't force a real failure to read the message.Left out: I didn't touch the existing per-description and per-argument limits.
Closes #6354