You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pull_request_read): expose after cursor parameter in input schema (#2489)
The `pull_request_read` tool description tells clients that
`get_review_comments` uses cursor-based pagination (`perPage`, `after`),
and the handler does plumb `after` through to the GraphQL query, but the
input schema only declared `page` and `perPage` (via `WithPagination`).
Because `after` was not advertised in `inputSchema`, MCP clients had
no way to request it, leaving cursor pagination effectively broken:
`perPage: 1` returned only the first thread with no way to advance, and
`page` was silently ignored by the GraphQL path.
This change adds `after` to the schema (string, optional) with a
description making clear it only applies to `get_review_comments`. All
other methods continue to ignore it. No handler behavior is changed.
- Add `after` schema property after `WithPagination` in `PullRequestRead`
- Regenerate `__toolsnaps__/pull_request_read.snap` and update README
- Add a regression test asserting `after` is in the schema and a new
table-driven case verifying the cursor is forwarded to the GraphQL query
Fixes#2122 (for the `get_review_comments` pagination part). The
remaining concerns in #2122 about unbounded response sizes for `get`,
`get_diff`, and `get_reviews` are deferred to follow-up design.
Co-authored-by: Sam Morrow <info@sam-morrow.com>
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1111,6 +1111,7 @@ The following sets of tools are available:
1111
1111
1112
1112
-**pull_request_read** - Get details for a single pull request
1113
1113
-**Required OAuth Scopes**: `repo`
1114
+
-`after`: Cursor for pagination, used only by the get_review_comments method. Pass the endCursor from the previous page's PageInfo to fetch the next page. (string, optional)
1114
1115
-`method`: Action to specify what pull request data needs to be retrieved from GitHub.
Copy file name to clipboardExpand all lines: pkg/github/__toolsnaps__/pull_request_read.snap
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@
6
6
"description": "Get information on a specific pull request in GitHub repository.",
7
7
"inputSchema": {
8
8
"properties": {
9
+
"after": {
10
+
"description": "Cursor for pagination, used only by the get_review_comments method. Pass the endCursor from the previous page's PageInfo to fetch the next page.",
11
+
"type": "string"
12
+
},
9
13
"method": {
10
14
"description": "Action to specify what pull request data needs to be retrieved from GitHub. \nPossible options: \n 1. get - Get details of a specific pull request.\n 2. get_diff - Get the diff of a pull request.\n 3. get_status - Get combined commit status of a head commit in a pull request.\n 4. get_files - Get the list of files changed in a pull request. Use with pagination parameters to control the number of results returned.\n 5. get_review_comments - Get review threads on a pull request. Each thread contains logically grouped review comments made on the same code location during pull request reviews. Returns threads with metadata (isResolved, isOutdated, isCollapsed) and their associated comments. Use cursor-based pagination (perPage, after) to control results.\n 6. get_reviews - Get the reviews on a pull request. When asked for review comments, use get_review_comments method. Use with pagination parameters to control the number of results returned.\n 7. get_comments - Get comments on a pull request. Use this if user doesn't specifically want review comments. Use with pagination parameters to control the number of results returned.\n 8. get_check_runs - Get check runs for the head commit of a pull request. Check runs are the individual CI/CD jobs and checks that run on the PR.\n",
// get_review_comments uses GraphQL cursor-based pagination and accepts the
62
+
// `after` cursor. Other methods rely on the `page`/`perPage` parameters
63
+
// added by WithPagination and ignore `after`.
64
+
schema.Properties["after"] =&jsonschema.Schema{
65
+
Type: "string",
66
+
Description: "Cursor for pagination, used only by the get_review_comments method. Pass the endCursor from the previous page's PageInfo to fetch the next page.",
0 commit comments