Create or exactly edit one file
edit_fileEdit files in a bounded workspace with conflict-safe updates, using exact replacements and SHA verification for atomic changes.
Instructions
Atomically create a UTF-8 file, or edit one using unique exact replacements and a current whole-file SHA-256. workspace(read) returns that SHA for small files; use file_info for larger files. When multiple workspaces are configured, pass the same workspace_id used for inspection. Cannot delete files, edit the local task config, follow links, or access credential-like paths.
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>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| replacements | No | ||
| workspace_id | No | Required when server_info lists multiple workspaces. | |
| create_content | No | Used only when creating a new file. | |
| expected_sha256 | No | Required when editing an existing file. |