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

The MCP person and pins tools refuse a limit outside 1–200 instead of clamping it, with the words the HTTP list routes use #8502

shipped production is serving it opened this has it
opened this

Intent: the same action has the same shape for a person and an agent. An MCP caller asking for limit: -5 or limit: 9999 is told the range, as the HTTP list routes tell it (pageParams in src/http/api.ts: "limit is a whole number from 1 to 200").

Today: src/http/mcp/tools/person.ts:25 and src/http/mcp/tools/pins.ts:27 check only that limit is a finite number, then pageLimit (src/core/issues.ts:426) clamps -5 to 1 and 9999 to 200 without a word. A fraction is truncated.

Done looks like:

  • [x] Both tools answer bad("invalid", "limit is a whole number from 1 to 200") for a non-integer, 0, a negative or more than 200. An absent limit still gives the default page.
  • [x] One small shared check in src/http/mcp/shared.ts that both tools call, taking the bounds from the constants pageLimit uses (LIST_LIMIT_MAX), not a new literal.
  • [x] Tests in the MCP test that covers these tools: each bad value is refused with that message; 1 and 200 pass.
  • [x] bun test test/mcp-size.test.ts passes: tool descriptions do not grow beyond naming the range.

Files: src/http/mcp/tools/person.ts, src/http/mcp/tools/pins.ts, src/http/mcp/shared.ts, one test. Do not touch src/http/api.ts; #8490 owns the HTTP side.

commented

Left open after pull #8514 landed: 4 unticked items remain (Both tools answer bad("invalid", "limit is a whole number from 1 to 200") for a non-integer, 0, a negative or more than 200. An absent limit still gives the default page.; One small shared check in src/http/mcp/shared.ts that both tools call, taking the bounds from the constants pageLimit uses (LIST_LIMIT_MAX), not a new literal.; Tests in the MCP test that covers these tools: each bad value is refused with that message; 1 and 200 pass.; …). Close it, tick what is done, or say what is left; until a person does, the crew does not pick it again.

commented

Reviewed pull #8514 at its head: ticked Both tools answer bad("invalid", "limit is a whole number from 1 to 200") for a non-integer, 0, a negative or more than 200. An absent limit still gives the default page.; One small shared check in src/http/mcp/shared.ts that both tools call, taking the bounds from the constants pageLimit uses (LIST_LIMIT_MAX), not a new literal.; Tests in the MCP test that covers these tools: each bad value is refused with that message; 1 and 200 pass.; bun test test/mcp-size.test.ts passes: tool descriptions do not grow beyond naming the range..

commented

Already done on main in 173a228a. badLimit in src/http/mcp/shared.ts takes LIST_LIMIT_MAX.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs