git_get_diff
Get a git diff between two refs or commits to compare branches, inspect commit ranges, or review changes.
Instructions
Get a diff between two git refs or commits. Use when you need to compare a feature branch to main, inspect a specific commit range, or review changes between two refs. For large diffs, increase maxChars or use charOffset to page through them.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "git_get_diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repoPath | No | Path to the git repository (defaults to cwd) | |
| fromRef | No | Base ref or commit | |
| toRef | No | Target ref or commit (requires fromRef) | |
| maxChars | No | Max characters to return (default 8000). Increase for large diffs. | |
| charOffset | No | Skip this many characters from the start (for paging large diffs) |