undo_run
Revert an agent run in one atomic commit: undo its edits, remove created docs, and restore moved or deleted files, with optional commit or path scoping and a dry-run preview.
Instructions
Undo a run (an id from agent_runs) in one commit, all or nothing: its edits reverted, the docs it created removed, those it moved or deleted put back. from keeps the run up to that commit and undoes the rest; paths undoes only those docs. Refused, with nothing changed, if a later change touches the same lines. Only the person the run was for may, or someone with the rights each change takes by hand. dry_run=true lists what it would revert.
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": {
"run": "<run>",
"ai": "<ai>"
},
"name": "undo_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ai | Yes | Your AI family in lowercase (claude, chatgpt, gemini), not the model name. Attributes the change. | |
| run | Yes | The run id, from agent_runs. | |
| from | No | A commit sha from the run's `log`: undo it and every later commit of the run, keep the earlier ones. | |
| paths | No | Undo only these docs, as the run lists them; the rest of the run stays. | |
| dry_run | No | List what would be reverted; change nothing. |