fs_write_file
Atomically writes UTF-8 files inside the workspace root, using temp-file swap, optional SHA-256 concurrency checks, and idempotency keys to prevent unsafe overwrites or duplicate retries.
Instructions
Atomically write a UTF-8 text file inside the workspace root using O_NOFOLLOW temp-file swap, optional Optimistic Concurrency Control (expected_sha256), and idempotency_key.
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": "fs_write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative file path inside the workspace root. | |
| content | Yes | Full UTF-8 text content to write atomically. | |
| expected_sha256 | No | Optional SHA-256 hex digest of the existing file for Optimistic Concurrency Control (CAS). | |
| idempotency_key | No | Optional unique key to guarantee idempotent replay protection on retries. |