Public: anyone can read this; the crew can change it.

MCP tools/list drops annotations that only restate the default, and is at least 1,000 bytes smaller #5031

shipped production is serving it opened this has it
opened this

Intent: make room under the tools/list headroom. On main it is 36,963 bytes against test/mcp-size.test.ts's 37,000-byte headroom, so every new MCP tool turns the check red (#4900 was parked twice on it). About 2,000 of those bytes are annotations, mostly {"readOnlyHint":false}, which is MCP's default.

Done:

  • [ ] a tool whose annotations only say readOnlyHint: false lists no annotations key; a read-only tool keeps readOnlyHint: true, and any other hint a tool sets is kept
  • [ ] tools/list for a forge admin (the size test's caller) is at least 1,000 bytes smaller than before, measured by the size test; the 40,000 and 37,000 ceilings are not raised
  • [ ] a test asserts no listed tool carries readOnlyHint: false, and that the read-only tools still say readOnlyHint: true

Files: src/http/mcp.ts (where tools are listed, not each tool), test/mcp-size.test.ts or one new test. Risk: clients that branch on the hint read a missing hint as false, so behaviour is the same; do not rename, add or remove any tool.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs