Skip to content

Fix #155: honest story-list pagination in MCP (no silent 20-cap)#165

Merged
mkreyman merged 1 commit into
masterfrom
fix/155-story-list-limit
Jun 24, 2026
Merged

Fix #155: honest story-list pagination in MCP (no silent 20-cap)#165
mkreyman merged 1 commit into
masterfrom
fix/155-story-list-limit

Conversation

@mkreyman

Copy link
Copy Markdown
Owner

Summary

Closes #155. list_stories / list_ready_stories silently clamped limit to 20 (Math.min(limit ?? 20, 20)), so an agent requesting up to the server's documented max (500) received only 20 rows — and a loop advancing offset by the requested limit silently skipped stories. Same class as the #148a knowledge-enumeration clamp.

Change

  • Honor an explicit limit up to the server max (500); default 20 when unspecified (keeps unprompted MCP responses compact). The server already clamps to 500 / defaults to 100.
  • Document default 20, max 500 in both list_stories and list_ready_stories tool schemas.
  • Regression test test/story_tools.test.js: default → 20, explicit 50/200/500 honored, 1000 → 500, and the old MAX_PAGE_SIZE = 20 constant is gone.

MCP server 2.20.1. MCP tests 45/45.

list_stories and list_ready_stories hard-clamped `limit` to 20
(`Math.min(limit ?? 20, 20)`), so an agent requesting limit=500 (the
server's max) silently received 20 rows — and advancing `offset` by the
requested limit skipped stories. Same class as the #148a knowledge clamp.

- Honor an explicit `limit` up to the server max (500); default 20 when
  unspecified (keeps unprompted responses compact).
- Document `default 20, max 500` in both tool schemas.
- Regression test (test/story_tools.test.js) covering default / honored /
  clamped limits and that the old 20-cap constant is gone.

MCP server 2.20.1.
@mkreyman mkreyman merged commit 4d3907e into master Jun 24, 2026
6 checks passed
@mkreyman mkreyman deleted the fix/155-story-list-limit branch June 24, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP listStories/listReadyStories silently clamp limit to 20 (server allows 500)

1 participant