node_patch_file
Atomically replace a target block in a remote UTF-8 file with new content, optionally enforcing a SHA-256 precondition to prevent concurrent overwrite.
Instructions
Atomically replace a target block inside a remote UTF-8 file on '@appliance', '@bastion', or a TargetNode with optional SHA-256 precondition check.
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": {
"node": "<node>",
"remote_path": "<remote_path>",
"target": "<target>",
"replacement": "<replacement>"
},
"name": "node_patch_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | Yes | Target node identifier ('@appliance', '@bastion', or TargetNode name). | |
| tx_id | No | Optional stable transaction id. Reuse retrieves the original operation and never replays ambiguous work. | |
| target | Yes | Exact substring/block to replace. | |
| as_root | No | Write with elevated sudo privileges on a Linux TargetNode. | |
| remote_path | Yes | Path to the file on the remote node. | |
| replacement | Yes | Replacement content. | |
| expected_sha256 | No | Optional SHA-256 precondition from node_read_file to prevent concurrent overwrite. |