Skip to content

fix(mcp): honor page and page_size in search tools - #1685

Open
lhk0504 wants to merge 2 commits into
apache:mainfrom
lhk0504:fix/mcp-search-pagination
Open

lhk0504 wants to merge 2 commits into
apache:mainfrom
lhk0504:fix/mcp-search-pagination

Conversation

@lhk0504

@lhk0504 lhk0504 commented Nov 22, 2026

Copy link
Copy Markdown

Fixes #1676

Proposed Changes

  • Expose page and page_size parameters in the get_questions and get_comments MCP tool schemas.
  • Parse the parameters in NewMCPSearchCond and NewMCPSearchCommentCond with defaults (page 1, page_size 5) and an upper bound of 50 on page_size.
  • Use the parsed values in MCPQuestionsHandler and MCPCommentsHandler instead of the hardcoded Page: 1, Size: 5.
  • Add unit tests covering defaults, explicit values, string arguments, invalid values and the page_size cap.

This branch has not been deployed

No deployments
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.

fix(mcp): search tools hardcode page size and ignore pagination parameters

1 participant