Write file
write_fileCreate or overwrite files securely within an allowed directory, with options to create parent folders and append content.
Instructions
Create or overwrite a file inside an allowed root. createDirectories mkdir -p the parent. append adds to an existing file.
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 | Absolute or ~ path to write | |
| append | No | ||
| content | Yes | File contents (text or base64) | |
| encoding | No | How to interpret content | utf8 |
| createDirectories | No |