edit
Modify files precisely by matching old text exactly, verifying expected revision, and returning the actual diff. Read first to ensure accuracy.
Instructions
Precisely edit a file using Pi's real edit implementation. All oldText entries match the original file. Read first and provide expected_revision; returns the actual diff.
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": {
"workspace_id": "<workspace_id>",
"request_key": "<request_key>",
"path": "<path>",
"expected_revision": "<expected_revision>",
"edits": "<edits>"
},
"name": "edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path or path relative to the workspace. Home is a starting directory, not a sandbox. | |
| edits | Yes | ||
| request_key | Yes | Unique operation key within this workspace. Reuse only for the exact same request; uncertain outcomes must not be blindly retried. | |
| workspace_id | Yes | ||
| expected_revision | Yes |