Diff one file between two history versions
diff_fileCompare two versions of a project file and show changed lines marked as insertions, deletions, and unchanged context.
Instructions
Shows what changed in one file between two versions from list_history. Changed lines are marked with ~, insertions as [+text+] and deletions as [-text-], with a few lines of context.
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": {
"path": "<path>",
"from": "<from>",
"to": "<to>"
},
"name": "diff_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Version to diff to (`to_version` of a list_history entry). | |
| from | Yes | Version to diff from (`from_version` of a list_history entry, or an earlier `to_version`). | |
| path | Yes | Project-relative path of the file, as it was named in the versions compared. | |
| project_id | No | Overleaf project id from list_projects or open_project. Opens the project if it is not already active. Pass it on every call when MCP sessions may change between calls. Writes without it only go to the project last confirmed by open_project or by a write naming it. | |
| context_lines | No | Unchanged lines to show around each change (default: 2). |