Create or overwrite a file
write_fileWrites text content to a file, creates missing parent folders, and can overwrite existing files while keeping a backup for undo.
Instructions
Writes text to a file. Creates missing parent folders. By default overwrites an existing file and keeps a backup (restorable via undo_last_change).
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 | File path | |
| content | Yes | Text content of the file | |
| overwrite | No | false — do not overwrite if the file already exists | |
| create_parents | No | Create missing parent folders |