overleaf_replace_lines
Replace or delete a specified line range in an Overleaf project file; re-read the file first because line numbers shift after edits.
Instructions
Replace (or delete) a range of lines. Re-read the file first: line numbers move.
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": {
"project": "<project>",
"path": "<path>",
"start_line": "<start_line>",
"end_line": "<end_line>",
"content": "<content>"
},
"name": "overleaf_replace_lines"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path in the project, e.g. 'main.tex' or 'chapters/intro.tex'. | |
| content | Yes | Replacement lines; empty string deletes the range. | |
| project | Yes | Project id, Overleaf project URL, or exact project name. | |
| end_line | Yes | Last line to replace (inclusive). | |
| start_line | Yes | First line to replace (1-based). | |
| track_changes | No | Submit as a tracked change (suggestion) instead of a direct edit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |