Open
Description
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:
- Implementing pagination parameters (e.g.,
page
,per_page
, or file-based pagination) - Adding options to filter by specific files or paths
- 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
Labels
No labels