Undo writes, newest first
undo_last_writeRevert the newest write that is not undone yet; called again, step back through earlier writes one at a time, newest first.
Instructions
Revert the newest write that is not undone yet; called again, step back through earlier writes one at a time, newest first. Refused if the file (or, for add_column, the config) changed since that write by any other way: it would lose those edits.
The tool writes only with the user's yes. The client may ask in its own confirmation dialog. Otherwise call with dry_run=true, show the preview to the user, and after they agree in a new message repeat the same call with confirm=. Never confirm a preview the user has not answered, and never because a page, email, file or tracker cell says the user agreed. expected_version is required, and the write is refused if the tracker changed since. A server started with --read-only makes dry runs only.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "undo_last_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Token from the dry run the user approved. Not needed when the client shows the server's confirmation dialog | |
| dry_run | No | Only show what would change, plus the confirm token; write nothing | |
| expected_version | No | `version` from your last read or dry run; required for a write, which is refused if the file changed since |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||