Create or overwrite a file
write_fileCreates a new text file (.tex, .bib, .sty, .cls, .txt, .md and the like), or replaces a whole existing one. For a change to part of a file use edit_file instead; images and PDF figures go in with add_image. Overwriting changes only the parts that differ, tracked or not as the person's switch for you in this project says, and the previous text stays in History.
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_id": "<project_id>",
"path": "<path>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The file's path in the project, e.g. sections/method.tex; folders are created as needed. | |
| content | Yes | The file's complete new text. | |
| project_id | Yes | The project's id, from list_projects. |