undo_last
Reverses your last n changes from this session, restoring exact prior state after a wrong-condition commit, bad batch edit, or accidental shape delete. Only gestures that modified data count.
Instructions
Step back over your OWN last n mutations, newest first — a committed measure_polygon, an edit_shape, a delete_shape, an edit_materials call, an edit_condition call, or an RFI verb (create_rfi / resolve_rfi / delete_rfi). Each step is reversed exactly (a commit is removed, an edit is restored verbatim, a delete is re-inserted where it was, a materials edit's whole array is restored, a condition edit's waste/multiplier pair is restored), so this restores state rather than approximating it. Reads are never journaled, so n counts gestures that changed something, not tool calls you made. Use it when a sweep committed against the wrong condition or a batch went in on the wrong sheet — one call instead of N deletes. Scope: this session's own history only. It is not the browser canvas's undo stack, and load_plan clears it along with the shapes it refers to.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | How many steps to reverse (1–100) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| steps | Yes | Newest first | |
| undone | Yes | Steps actually reversed | |
| remaining | Yes | Steps still available to undo | |
| shape_count | Yes | Committed shapes after the undo |