Public: anyone can read this; the crew can change it.
The MCP size test says how many bytes are left, and docs/MCP.md says a new door extends a tool before it becomes one #5050
Check · Review · Land · Live done — Landed and live in production.
This pull makes the MCP size test say how far `tools/list` is over its limits, and adds a short "Room for a new tool" section to `docs/MCP.md`. `bun test test/mcp-size.test.ts` passes, and I ran only that test, not the whole suite.
shipped production is serving it deploy 5f89d5b
This pull makes the MCP size test say how far tools/list is over its limits, and adds a short "Room for a new tool" section to docs/MCP.md. bun test test/mcp-size.test.ts passes, and I ran only that test, not the whole suite.
test/mcp-size.test.ts:
- Failure message: it now gives the answer's size, the bytes over the 40,000 ceiling or the 37,000 headroom, and the bytes left under the ceiling. It still lists the five longest descriptions.
- Header comment: it now explains how to measure locally with bun test test/mcp-size.test.ts. It also says to extend an existing tool before adding one, and not to raise the ceilings in a feature pull.
docs/MCP.md:
- New section: "Room for a new tool" sits right after the tool table and gives the 40,000-byte ceiling and the 37,000-byte headroom.
- Rules it states: a new door is an action or kind on the tool that already owns the resource before it is a new tool, a new tool's description is one sentence, and the ceiling is the owner's.
- Measuring: it also says how to measure with the same command.
- Not changed: the ceilings, and every tool.
- Message wording: the failure message says the size twice ("is N bytes" and "the new answer has N bytes"), because the issue asked for both. I didn't polish the wording.
To try it, run bun test test/mcp-size.test.ts. To see the new failure message, temporarily lower CEILING or HEADROOM_CEILING in the test.
🤖 Generated with Claude Code
Docs section is accurate and the test passes, but the failure message the pull exists to improve states the size twice in one sentence ("is N bytes" ... "the new answer has N bytes"). That is the one thing a person reads when a push fails, so fix it first: drop the "the new answer has N bytes" clause from both messages. Result: "tools/list is N bytes, X over the 40000 ceiling; the five longest descriptions: ..." and the headroom one keeps "(Y left under the ceiling)". The header comment and docs already say what to run, so nothing else changes.
I dropped "the new answer has N bytes" from both failure messages in test/mcp-size.test.ts, as @juniper asked, and pushed to the same branch. bun test test/mcp-size.test.ts passes.
The messages now read:
- Ceiling: "tools/list is N bytes, X over the 40000 ceiling; the five longest descriptions: …"
- Headroom: "tools/list is N bytes, X over the 37000 headroom (Y left under the ceiling); the five longest descriptions: …"
I changed nothing else, and I agree with the feedback.
🤖 Generated with Claude Code
Docs and test message only; no tool, ceiling or runtime path changes, so the security, terminal and dependency points do not apply. The size test passes locally, and the message now reports bytes over each limit and bytes left under the ceiling. The docs claims (admin gets the largest answer, 40,000/37,000) match the test. Next: (1) the docs and the test header both state the rules, so keep one the source and point the other at it; (2) add a test that forces a failure and checks the message format, since the new wording is untested.
This pull makes the MCP size test say how far
tools/listis over its limits, and adds a short "Room for a new tool" section todocs/MCP.md.bun test test/mcp-size.test.tspasses, and I ran only that test, not the whole suite.test/mcp-size.test.ts:- Failure message: it now gives the answer's size, the bytes over the 40,000 ceiling or the 37,000 headroom, and the bytes left under the ceiling. It still lists the five longest descriptions. - Header comment: it now explains how to measure locally with
bun test test/mcp-size.test.ts. It also says to extend an existing tool before adding one, and not to raise the ceilings in a feature pull.docs/MCP.md:- New section: "Room for a new tool" sits right after the tool table and gives the 40,000-byte ceiling and the 37,000-byte headroom. - Rules it states: a new door is an
actionorkindon the tool that already owns the resource before it is a new tool, a new tool's description is one sentence, and the ceiling is the owner's. - Measuring: it also says how to measure with the same command.To try it, run
bun test test/mcp-size.test.ts. To see the new failure message, temporarily lowerCEILINGorHEADROOM_CEILINGin the test.🤖 Generated with Claude Code
Closes #5033