docs: distill mcp-pagination strategy into github-mcp-server.md - #49081
Merged
Conversation
Add a ## Pagination section to .github/aw/github-mcp-server.md that distills the guidance from .github/workflows/shared/mcp-pagination.md: - 25k token limit context - perPage defaults by item type (detailed vs simple vs exploratory) - Tool-specific guidance for PRs, issues, and search - Pagination loop pattern - Known tool quirks (list_label / list_workflows wrappers) - Oversized-response error messages Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
July 30, 2026 06:55
View session
pelikhan
approved these changes
Jul 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds canonical GitHub MCP pagination guidance, including response limits, page sizing, tool quirks, and recovery steps.
Changes:
- Documents recommended pagination sizes and tool-specific defaults.
- Adds pagination-loop and oversized-response guidance.
- Describes wrappers for pagination inconsistencies.
Show a summary per file
| File | Description |
|---|---|
.github/aw/github-mcp-server.md |
Adds GitHub MCP pagination guidance. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/aw/github-mcp-server.md:411
- This recovery step is too broad for the generic oversized-response error: not every tool or method supports
perPage(for example, a non-paginated diff request). Retrying with an unsupported parameter will fail again rather than reduce the payload.
add `perPage: 10` (or smaller) and retry.
- Files reviewed: 1/1 changed files
- Comments generated: 4
- Review effort level: Medium
|
|
||
| --- | ||
|
|
||
| ## Pagination |
| | Simple list operations (commits, branches, labels) | 50–100 | | ||
| | Exploratory / schema-discovery queries | 1–5 | | ||
|
|
||
| Always pass an explicit `perPage` value. Do **not** rely on server defaults. |
Comment on lines
+399
to
+402
| Two built-in GitHub MCP tools ignore standard pagination parameters: | ||
|
|
||
| - **`list_label`** — uses a hardcoded GraphQL `labels(first: 100)` query; `perPage` is silently ignored. Use the `shared/github-mcp-pagination-wrappers.md` wrapper instead. | ||
| - **`list_workflows`** — uses snake_case `per_page` (inconsistent with every other list tool). Use the `shared/github-mcp-pagination-wrappers.md` wrapper for consistent camelCase `perPage` support. |
| ### Pagination Loop (when all pages are needed) | ||
|
|
||
| ``` | ||
| page 1 → check total_count or has_next_page → fetch page 2, 3, … until done |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.
Pagination guidance was only in workflow-level shared files (
mcp-pagination.md,github-mcp-pagination-wrappers.md), not in the canonical GitHub MCP instruction file consulted by agents. This adds a dedicated## Paginationsection to.github/aw/github-mcp-server.md.Changes
perPagedefaults by item type — 10–20 (detailed), 50–100 (simple lists), 1–5 (exploratory)list_pull_requests,pull_request_read,list_issues,issue_read,search_*,search_repositoriespageuntiltotal_count/has_next_pageexhausted; process incrementallylist_labelignoresperPage(hardcoded GraphQLfirst: 100);list_workflowsuses snake_caseper_page; both have wrapper fixes inshared/github-mcp-pagination-wrappers.mdperPage: 10)