Read pull request diff
gh_get_pr_diffFetch a bounded unified diff or patch for a pull request's exact commit SHAs, with truncation reporting and SHA-256 fingerprint. Read-only; no checkout, tests, or GitHub modifications.
Instructions
Read-only: return a bounded unified diff or patch for the exact immutable base and head commit SHAs currently identified by a pull request. The result reports truncation, byte counts, and a SHA-256 fingerprint. This tool never checks out code, runs tests, requests approval, or modifies GitHub.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | GitHub repository name. | |
| owner | Yes | GitHub repository owner. | |
| format | No | Unified diff or email-style patch output. | diff |
| number | Yes | Pull request number. | |
| max_bytes | No | Maximum UTF-8 bytes returned, capped by MCP_GH_MAX_PR_DIFF_BYTES. Omit to use the server cap. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | ||
| number | Yes | ||
| sha256 | Yes | ||
| content | Yes | ||
| base_sha | Yes | ||
| head_sha | Yes | ||
| truncated | Yes | ||
| total_bytes | Yes | ||
| bytes_returned | Yes |