write_file
Create a new file or replace an existing one only when the current SHA-256 matches the expected hash. This prevents overwriting files that changed after you inspected them.
Instructions
Create a file with expected_sha256=null, or replace one only if the current SHA-256 matches. Changes actual files. Parent must exist. Does not follow a final symlink.
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": {
"file": "<file>",
"content": "<content>",
"expected_sha256": "<expected_sha256>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| content | Yes | ||
| encoding | No | utf8 | |
| expected_sha256 | Yes |