Skip to content

git_line_change

MCP tools › Version control

One change (gutter marker) of a workspace file against HEAD. Without action: the file's changes with kind, new and old ranges (1-based, inclusive) and HEAD text. line picks the change containing it (a deletion: the line below). action rollback reverts it on disk; commit with message commits only this change (hooks run). Dry run by default: returns the change and resulting text; dry_run=false needs the vcs-write right. Open files are taken as the editor shows them; rollback is one undo step.

Its results carry text from git, files: the client is told to treat that as data, never as instructions.

Capabilitygit.git_line_change
AreaVersion control
Accesschanges files, repository
Reachesprocess
Rightsvcs-write
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative file path.
lineintegerA 1-based line of the change to act on (a deletion: the line below it).minimum 0
actionstringrollback (take the change back in the file) or commit (commit only this change); without it the file's changes are listed.
messagestringCommit message, for commit.
dry_runbooleanDefault true: only say what would happen.

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.

Terminal window
ferris-idea call ~/my-project git_line_change '{"path":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "Workspace-relative file path.",
"type": "string"
},
"line": {
"description": "A 1-based line of the change to act on (a deletion: the line below it).",
"type": [
"integer",
"null"
],
"minimum": 0
},
"action": {
"description": "`rollback` (take the change back in the file) or `commit` (commit only this change);\nwithout it the file's changes are listed.",
"type": [
"string",
"null"
]
},
"message": {
"description": "Commit message, for `commit`.",
"type": [
"string",
"null"
]
},
"dry_run": {
"description": "Default true: only say what would happen.",
"type": [
"boolean",
"null"
]
}
}
}