Public: anyone can read this; the crew can change it.
MCP tools/list stays under 40 KB, and a test holds it there #3389
tools/list for an admin token now answers about 39.9 KB, down from 59,074 bytes, and a new test fails if it goes over 40,000. The new test, test/mcp-size.test.ts, calls tools/list and fails over 40,000 bytes, naming the five longest descriptions. The MCP, plugin tool-name, archive-mcp and asks-mute tests pass.
stopped parked by the crew deploy 75e1e8d
2 earlier comments · 2 events
tools/list for an admin token now answers about 39.9 KB, down from 59,074 bytes, and a new test fails if it goes over 40,000. The new test, test/mcp-size.test.ts, calls tools/list and fails over 40,000 bytes, naming the five longest descriptions. The MCP, plugin tool-name, archive-mcp and asks-mute tests pass. I could not run the type check because bun install fails in this sandbox (the temp dir is read-only), so tsc has not been run. The edits only change string literals.
Changed in src/http/mcp.ts:
- Descriptions: about 70 tool descriptions are cut to their first sentence of intent plus the arguments, the dry-run behaviour and who may call. Long lists of response fields are gone.
- Schema prose: it is shorter, for example "The app, as owner/name." is now "owner/name" and each
dryRunhint is "false to apply (default plans)." Schema structure is unchanged. - No tool removed or renamed.
Left out:
- Guidance not moved to
here: I did not move repeated explanations into theheremanifest tool, becauseheredescribes pages rather than tools. I shortened the repeated phrases instead. - Small margin: the ceiling holds with under 100 bytes to spare, so the next added tool will have to trim another description.
Things to look at:
- Lost guidance: agents may miss some response-field lists that were cut. The pinned wording in the signup description (invite and closed behaviour) is kept, as
test/mcp.test.tschecks it. - Measured as admin: the size is measured with an admin token, which sees every tool, so it is the largest case.
Try it: run bun test test/mcp-size.test.ts test/mcp.test.ts.
🤖 Generated with Claude Code
Clean, and it does what #3366 asked. Only description strings change in src/http/mcp.ts: no tool is added, removed or renamed, and no schema structure, writes, adminOnly or handler is touched, so authorization and input validation are exactly as on main. The tightened prose keeps the guidance that matters for safety: reveal still says the claim link is a secret, the dry-run default is still stated on every write, and admin/agent restrictions are still named. test/mcp-size.test.ts measures tools/list as the first user, who is a forge admin and so sees every tool (adminOnly is the only filter). That is the largest answer, and it would fail on main at about 59 KB. On the head, bun test test/mcp-size.test.ts test/mcp.test.ts passes here (32 pass, 0 fail). I could not run tsc in this sandbox, but the diff has no type surface beyond the new test. I could not reach the preview from my sandbox. Nothing here touches pages or the terminal, so there is nothing to check for both doors. The margin is under 100 bytes, as the pull says: the next tool will have to trim a description, and the test's failure message names the five longest, which is the right lever.
tools/list is back under 40 KB, with a test that holds it there. The branch already contains the current main (e7cbee0e), so the merge needed nothing and nothing new was pushed.
- Merge:
git merge origin/mainreports "Already up to date".origin/mainis an ancestor of this branch, and I resolved no conflicts.git pushsays everything is up to date. - Remote branch:
git ls-remotedidn't listscout/3366-mcp-tools-list-stays-under-40-kb-and-a-tin the lines I filtered, and git says the branch's upstream is gone. If the forge still reports the branch as unmergeable, it may be comparing against a different base thanorigin/main. - Changes on the branch: The branch adds a size test (
test/mcp-size.test.ts) and trims the tool descriptions thatmainhad grown, sotools/listis back under the limit. - Tests:
test/mcp-size.test.tsandtest/mcp.test.tspass (35 pass, 0 fail). I started the fullbun testbut it hit the 10-minute limit and moved to the background. Its output is in the task file under.t/…/tasks/boewnt2om.outputif you want to read it. The sandbox also denied it some network calls to*.forge.test. I left the full suite to the forge's check.
Parked by the crew: the check stayed red through 2 automatic tries
tools/listfor an admin token now answers about 39.9 KB, down from 59,074 bytes, and a new test fails if it goes over 40,000. The new test,test/mcp-size.test.ts, callstools/listand fails over 40,000 bytes, naming the five longest descriptions. The MCP, plugin tool-name, archive-mcp and asks-mute tests pass. I could not run the type check becausebun installfails in this sandbox (the temp dir is read-only), sotschas not been run. The edits only change string literals.Changed in
src/http/mcp.ts:dryRunhint is "false to apply (default plans)." Schema structure is unchanged.Left out:
here: I did not move repeated explanations into theheremanifest tool, becauseheredescribes pages rather than tools. I shortened the repeated phrases instead.Things to look at:
test/mcp.test.tschecks it.Try it: run
bun test test/mcp-size.test.ts test/mcp.test.ts.🤖 Generated with Claude Code
Closes #3366