use WithPagination tool option by LuluBeatson · Pull Request #632 · github/github-mcp-server · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

use WithPagination tool option #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2025
Merged

use WithPagination tool option #632

merged 1 commit into from
Jul 3, 2025

Conversation

LuluBeatson
Copy link
Contributor

@LuluBeatson LuluBeatson commented Jul 3, 2025

Use WithPagination() tool option consistently for tools with pagination.

Affected tools:

  • Actions
    • list_workflow_jobs
    • list_workflow_run_artifacts
    • list_workflow_runs
    • list_workflows
  • Issues:
    • get_issue_comments

⚠️ This change also means the per_page argument has been renamed to perPage in the affected tools. Now perPage is used across the server.

This PR does not add pagination to any tools previously without pagination

@LuluBeatson LuluBeatson marked this pull request as ready for review July 3, 2025 14:04
@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 14:04
@LuluBeatson LuluBeatson requested a review from a team as a code owner July 3, 2025 14:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors several GitHub tools to use a unified WithPagination() helper and renames the pagination parameter from per_page to perPage across the server interfaces.

  • Replace individual mcp.WithNumber("page") & mcp.WithNumber("per_page") calls with WithPagination()
  • Update handler logic to call OptionalPaginationParams and use pagination.page/pagination.perPage
  • Rename all occurrences of per_page to perPage in tests and documentation

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/github/issues_test.go Updated test assertions to expect perPage instead of per_page
pkg/github/issues.go Swapped explicit page/per_page parameters for WithPagination() and OptionalPaginationParams
pkg/github/actions_test.go Updated tests for workflows and artifacts to check perPage
pkg/github/actions.go Refactored all Actions tools to use WithPagination()
README.md Renamed parameters and updated descriptions for pagination flags
Files not reviewed (1)
  • pkg/github/toolsnaps/get_issue_comments.snap: Language not supported
Comments suppressed due to low confidence (2)

README.md:482

  • [nitpick] Nested list items in Markdown currently use - -, which may not render correctly; consider using two-space indentation followed by a single hyphen for nested bullets to ensure proper formatting.
  - `perPage`: Results per page for pagination (min 1, max 100) (number, optional)

README.md:481

  • [nitpick] Consider adding the default values (e.g., page=1, perPage=30) to these parameter descriptions so that users know the defaults applied by OptionalPaginationParams.
  - `page`: Page number for pagination (min 1) (number, optional)

@LuluBeatson LuluBeatson merged commit 08a49b0 into main Jul 3, 2025
16 checks passed
@LuluBeatson LuluBeatson deleted the lulu/with-pagination branch July 3, 2025 14:33
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.

2 participants

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.