undo_last
Reverse the last n edits to restore exact previous state, undoing mistaken sweeps or batch changes in one call.
Instructions
Step back over your OWN last n mutations, newest first — a committed one_click, a whole detect_rooms sweep, an edit_shape, a delete_shape, an edit_materials call, or an edit_condition call. 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.
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 |