write_file
Create or replace a text file in an Overleaf project, with automatic folder creation. Prevents overwriting files modified since the last read unless forced.
Instructions
Create or replace a text file. Missing folders are created.
Refuses to overwrite a file that changed since the last read_file, or that was only read in part, unless force=True.
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>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path inside the project, e.g. sections/intro.tex | |
| force | No | Overwrite even if the file changed since the last read | |
| content | Yes | Full new file contents (whole-file replace) | |
| project | Yes | Project id (24-char hex) or exact name |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||