fs_patch_file
Atomically replace an exact text block in a workspace file, with optional SHA-256 concurrency checks and idempotency keys to prevent conflicting or duplicate edits.
Instructions
Atomically replace an exact target text block inside a workspace file with optional SHA-256 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>",
"target": "<target>",
"replacement": "<replacement>"
},
"name": "fs_patch_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative file path inside the workspace root. | |
| target | Yes | Exact contiguous block of existing text to replace (must appear exactly once). | |
| replacement | Yes | Replacement text block. | |
| 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. |