Skip to content

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 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 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
nickytonline pushed a commit to nickytonline/github-mcp-http that referenced this pull request Oct 4, 2025
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.

3 participants