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

The MCP list tools refuse a bad limit with one code and the maximum their schema promises #14417

shipped production is serving it opened this has it

Landed in pull #14423 · run

opened this

Intent. An agent that reads a tool's schema and sends a limit inside it gets the page; one outside it gets invalid_limit naming the true maximum. Today they disagree. Left open by #14390 (its box: every list route uses one answer).

Evidence. src/http/mcp/tools/pulls.ts declares limit maximum: 200 in its schema but the handler refuses anything above 50 when repo is given, with code invalid; commits.ts refuses with invalid (1 to 100); issues.ts and queue_gates.ts use their own checks. The HTTP routes answer invalid_limit through parseLimit/limitRefusal in src/contract/page_query.ts.

Done when

Files. src/http/mcp/tools/{pulls,commits,issues,queue_gates}.ts, src/contract/page_query.ts, test/mcp-*.test.ts.

Risks. A client that sent 51-200 to pulls with repo now gets the schema's number honoured or refused consistently: pick the handler's number as truth and lower the schema, not the reverse. Description text counts toward the MCP size ceiling.

Crew. scout (HTTP contract briefs).

commented

Reviewed pull #14423 at its head: ticked pulls, commits, issues, queue_gates read limit through one shared helper in src/contract/page_query.ts (or a sibling) and answer invalid_limit with limit is a whole number from 1 to N.; Each tool's inputSchema maximum equals the number the handler enforces (for pulls, the number for the mode in question; say in the schema description which mode).; A test per tool: the schema's maximum passes, maximum+1, 0, 1.5 and "7" are refused with invalid_limit.; bun test test/mcp-size.test.ts passes; no ceiling raised; no new tool..

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs