write_file
Write content to a file atomically, creating parent directories as needed. Uses a temporary file and rename to prevent partial writes.
Instructions
Write content to a file atomically.
Creates parent directories by default. Uses atomic write (temp file + rename) by default to prevent partial writes. Supports configurable encoding.
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": {
"request": "<request>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | Request model for write_file tool. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path that was written. | |
| size | Yes | Number of bytes written. | |
| encoding | Yes | Encoding used to write the file. |