Add pagination support for get_pull_request_diff to handle large PRs · Issue #625 · github/github-mcp-server · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Add pagination support for get_pull_request_diff to handle large PRs #625

Open
@kaovilai

Description

@kaovilai

Problem

The get_pull_request_diff function currently fails when attempting to fetch diffs for large pull requests that exceed the token limit. This makes it impossible to analyze changes in PRs with substantial modifications.

Example Error

Error: MCP tool "get_pull_request_diff" response (36464 tokens) exceeds maximum allowed tokens (25000). 
Please use pagination, filtering, or limit parameters to reduce the response size.

This error was encountered when trying to fetch the diff for vmware-tanzu/velero#9019

Proposed Solution

Add pagination support to the get_pull_request_diff function to handle large diffs by:

  1. Implementing pagination parameters (e.g., page, per_page, or file-based pagination)
  2. Adding options to filter by specific files or paths
  3. Supporting partial diff retrieval with offset/limit parameters

Use Case

This enhancement would enable users to:

  • Analyze large pull requests without hitting token limits
  • Retrieve diffs incrementally for better performance
  • Focus on specific files or directories within a PR

Alternative Workarounds

Currently, users must resort to other methods like:

  • Using get_pull_request_files to list changed files
  • Fetching individual file contents
  • Using the GitHub CLI or API directly

Having built-in pagination would provide a more seamless experience for MCP users working with large codebases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      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.