stageEdit
Stage file edits inside a transaction using line range or search/replace operations, without writing changes to disk.
Instructions
Stage a file edit inside a transaction. Supports lineRange and searchReplace operations (same params as previewEdit). Does NOT write to disk.
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": {
"transactionId": "<transactionId>",
"filePath": "<filePath>",
"operation": "<operation>"
},
"name": "stageEdit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Pattern to search for (searchReplace only) | |
| endLine | No | End line inclusive (1-based, lineRange only) | |
| replace | No | Replacement text (searchReplace only) | |
| filePath | Yes | Workspace-relative or absolute path to the file | |
| useRegex | No | Treat search as regex (searchReplace only) | |
| operation | Yes | Type of edit | |
| startLine | No | Start line (1-based, lineRange only) | |
| newContent | No | Replacement content for the line range | |
| caseSensitive | No | Case-sensitive match (searchReplace only, default true) | |
| transactionId | Yes | Transaction ID from beginTransaction |