safe_write_file
Overwrite an existing text file only when its current SHA-256 matches the expected hash, then verify the stored result to prevent accidental or conflicting changes.
Instructions
Overwrite an existing text file only when its current SHA-256 matches expected_sha256, then verify the stored result. Prefer this over write_file for existing files; requires WISP_ALLOW_FILE_WRITES.
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>",
"expected_sha256": "<expected_sha256>"
},
"name": "safe_write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path in the selected server filesystem, starting from its root. | |
| content | Yes | Complete replacement UTF-8 text content. | |
| server_id | No | Wisp server ID. Omit to use the configured WISP_SERVER_ID default. | |
| expected_sha256 | Yes | 64-character SHA-256 from the most recent read or fingerprint of the same file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||