fix: add missing pagination on get_reviews#2367
Open
RossTarrant wants to merge 3 commits intomainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds REST pagination support to the get_reviews method of the pull_request_read MCP tool so callers can fetch review pages beyond GitHub’s default first page.
Changes:
- Extend
GetPullRequestReviewsto acceptPaginationParamsand passPage/PerPageintoPullRequests.ListReviews. - Add/adjust unit tests to assert pagination query params are forwarded (including default
page=1&per_page=30). - Update tool/docs text (toolsnap + README) to document pagination support for
get_reviews.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/pullrequests.go | Wires PaginationParams into ListReviews and updates tool method description text. |
| pkg/github/pullrequests_test.go | Adds a paginated success case and asserts default pagination query params on failure path. |
| pkg/github/toolsnaps/pull_request_read.snap | Updates the tool schema snapshot description to mention pagination for get_reviews. |
| README.md | Mirrors the updated get_reviews pagination note in generated docs. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 2
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add pagination support to get_reviews method in pull_request_read tool, bringing it in line with other paginated methods like get_files, get_comments, and get_check_runs.
Why
Fixes #2347 - GetPullRequestReviews passed nil options to ListReviews, silently truncating results to the first page (~30 items) with no pagination support.
What changed
MCP impact
Prompts tested (tool changes only)
Example Prompts:
Basic fetch (default pagination): List the reviews on PR ID: 1 in rosstarrant/octopus-mcp
Explicit pagination - first page: Get the first 10 reviews on rosstarrant/octopus-mcp PR ID: 1
Explicit pagination - second page: Get page 2 of reviews on rosstarrant/octopus-mcp PR ID: 1, with 10 per page
Edge case - page beyond results: Get page 100 of reviews on rosstarrant/octopus-mcp PR ID: 1
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs