Create or overwrite a file
write_fileWrites a complete text file and creates missing folders. Updates existing Overleaf docs in place with a live diff so collaborators keep their cursors; use for full-file replacements, not small edits.
Instructions
Writes the full content of a text file, creating it (and missing folders) if needed. Existing docs are updated in place via a minimal live diff, so collaborators keep their cursors. Prefer edit_file for small changes.
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>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of the text file, e.g. "sections/intro.tex"; missing folders are created | |
| content | Yes | The complete new content of the file | |
| project | No | Project name, id or Overleaf URL. May be omitted when exactly one project is pinned. | |
| suggest | No | Record changes to an existing doc as tracked changes | |
| overwrite | No | Set false to refuse replacing an existing file (default true) |