GitHub ref comparison
github_compare_refsCompare two branches, tags, or SHAs in a GitHub repository to get ahead/behind counts, total commits, and changed files with patches in one call.
Instructions
Compares two refs in one repository, one core call: ahead/behind counts, total commits, and the first 100 changed files with each patch capped at 4000 characters. Unknown refs surface the standard 404 error. Returns {status, ahead_by, behind_by, total_commits, files[{filename, status, additions, deletions, patch}], files_truncated?}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo": "<repo>",
"base": "<base>",
"head": "<head>"
},
"name": "github_compare_refs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base ref (branch, tag or sha) | |
| head | Yes | Head ref (branch, tag or sha) | |
| repo | Yes | Repository in owner/name form | |
| fresh | No | Bypass the local cache |