git_diff
MCP tools › Version control
Changes of a workspace file against the last commit (HEAD): line markers (added, modified, deleted with 1-based line ranges) and unified hunks. With side_by_side=true also rows: each with kind (null for unchanged), left [line, text] at HEAD and right [line, text] in the working tree, null where one side has no line, and for modified rows left_words/right_words: [start, end] char ranges of the changed words. With unified=true also unified: the rows of the unified view (kind null, deleted or added; old and new line numbers; text). revision compares the working copy with that branch, tag or commit instead of HEAD.
Its results carry text from git, files: the client is told to treat that as data, never as instructions.
| Capability | git.git_diff |
|---|---|
| Area | Version control |
| Access | reads only |
| Reaches | — |
| Rights | none |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
pathrequired | string | Workspace-relative file path. |
side_by_side | boolean | Also return rows: HEAD and working-tree lines side by side, as the diff viewer shows them,
with left_words/right_words (char ranges of changed words, SPEC-0084 v2). |
unified | boolean | Also return unified: the rows of the unified view (kind, old, new, text; SPEC-0084 v2). |
revision | string | Compare the working copy with this branch, tag or commit instead of HEAD (SPEC-0084 v2). |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project git_diff '{"path":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "path" ], "properties": { "path": { "description": "Workspace-relative file path.", "type": "string" }, "side_by_side": { "description": "Also return `rows`: HEAD and working-tree lines side by side, as the diff viewer shows them,\nwith `left_words`/`right_words` (char ranges of changed words, SPEC-0084 v2).", "type": [ "boolean", "null" ] }, "unified": { "description": "Also return `unified`: the rows of the unified view (kind, old, new, text; SPEC-0084 v2).", "type": [ "boolean", "null" ] }, "revision": { "description": "Compare the working copy with this branch, tag or commit instead of HEAD (SPEC-0084 v2).", "type": [ "string", "null" ] } }}