Skip to main content
Glama

undo_last

Reverse your last n mutations in exact order—removing commits, restoring edits and re-inserting deletes—to recover from wrong-condition sweeps or mis-sheeted batches without manual cleanup.

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.

Input Schema

NameRequiredDescriptionDefault
nNoHow many steps to reverse (1–100)

Output Schema

NameRequiredDescriptionDefault
noteNo
stepsYesNewest first
undoneYesSteps actually reversed
remainingYesSteps still available to undo
shape_countYesCommitted shapes after the undo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.29
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "scale",
      -  "edit",
      -  "annotation_text",
      -  "delete",
      -  "materials",
      -  "condition",
      -  "approval",
      -  "duplicate_condition",
      -  "split_condition",
      -  "cutout",
      -  "cutout_restore",
      -  "runcut",
      -  "rfi_create",
      -  "rfi_resolve",
      -  "rfi_delete",
      -  "proposal_open",
      -  "proposal_revise",
      -  "proposal_withdraw",
      -  "condition_proposal",
      -  "condition_proposal_withdraw",
      -  "condition_proposal_accept"
      -]New value: +[
      +  "commit",
      +  "scale",
      +  "edit",
      +  "annotation_text",
      +  "delete",
      +  "materials",
      +  "condition",
      +  "approval",
      +  "duplicate_condition",
      +  "split_condition",
      +  "cutout",
      +  "cutout_restore",
      +  "runcut",
      +  "rfi_create",
      +  "rfi_resolve",
      +  "rfi_delete",
      +  "proposal_open",
      +  "proposal_revise",
      +  "proposal_withdraw",
      +  "condition_proposal",
      +  "condition_proposal_withdraw",
      +  "condition_proposal_accept",
      +  "pricing",
      +  "estimate_settings"
      +]
  2. Changed1 schema field changedv0.1.21
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "edit",
      -  "delete",
      -  "materials",
      -  "condition",
      -  "approval",
      -  "duplicate_condition",
      -  "split_condition",
      -  "cutout",
      -  "cutout_restore",
      -  "runcut"
      -]New value: +[
      +  "commit",
      +  "scale",
      +  "edit",
      +  "annotation_text",
      +  "delete",
      +  "materials",
      +  "condition",
      +  "approval",
      +  "duplicate_condition",
      +  "split_condition",
      +  "cutout",
      +  "cutout_restore",
      +  "runcut",
      +  "rfi_create",
      +  "rfi_resolve",
      +  "rfi_delete",
      +  "proposal_open",
      +  "proposal_revise",
      +  "proposal_withdraw",
      +  "condition_proposal",
      +  "condition_proposal_withdraw",
      +  "condition_proposal_accept"
      +]
  3. Changed1 schema field changedv0.1.19
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "edit",
      -  "delete",
      -  "materials",
      -  "condition",
      -  "approval",
      -  "duplicate_condition",
      -  "split_condition",
      -  "cutout",
      -  "cutout_restore"
      -]New value: +[
      +  "commit",
      +  "edit",
      +  "delete",
      +  "materials",
      +  "condition",
      +  "approval",
      +  "duplicate_condition",
      +  "split_condition",
      +  "cutout",
      +  "cutout_restore",
      +  "runcut"
      +]
  4. Changed1 schema field changedv0.1.15
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "edit",
      -  "delete",
      -  "materials",
      -  "condition",
      -  "approval",
      -  "duplicate_condition",
      -  "split_condition"
      -]New value: +[
      +  "commit",
      +  "edit",
      +  "delete",
      +  "materials",
      +  "condition",
      +  "approval",
      +  "duplicate_condition",
      +  "split_condition",
      +  "cutout",
      +  "cutout_restore"
      +]
  5. Changed1 schema field changedv0.1.14
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "edit",
      -  "delete",
      -  "materials",
      -  "condition",
      -  "approval"
      -]New value: +[
      +  "commit",
      +  "edit",
      +  "delete",
      +  "materials",
      +  "condition",
      +  "approval",
      +  "duplicate_condition",
      +  "split_condition"
      +]
  6. Changed2 schema fields changedv0.1.12
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "edit",
      -  "delete",
      -  "materials",
      -  "condition"
      -]New value: +[
      +  "commit",
      +  "edit",
      +  "delete",
      +  "materials",
      +  "condition",
      +  "approval"
      +]
    • changedOutput schema / properties / steps / items / properties / shapes / description
      Previous value: -"Shapes affected by reversing this step — 0 for a materials step (it restores a condition's supporting-materials rows, not shapes) and for a condition step (it restores the waste/multiplier pair)"New value: +"Shapes affected by reversing this step — 0 for a materials step (it restores a condition's supporting-materials rows, not shapes), for a condition step (it restores the waste/multiplier pair), and for an approval step (it re-seats or removes a verdict mark)"
  7. Changed2 schema fields changedv0.1.8
    • changedOutput schema / properties / steps / items / properties / op / enum
      Previous value: -[
      -  "commit",
      -  "edit",
      -  "delete",
      -  "materials"
      -]New value: +[
      +  "commit",
      +  "edit",
      +  "delete",
      +  "materials",
      +  "condition"
      +]
    • changedOutput schema / properties / steps / items / properties / shapes / description
      Previous value: -"Shapes affected by reversing this step — 0 for a materials step (it restores a condition's supporting-materials rows, not shapes)"New value: +"Shapes affected by reversing this step — 0 for a materials step (it restores a condition's supporting-materials rows, not shapes) and for a condition step (it restores the waste/multiplier pair)"
  8. Addedv0.1.6

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and meets it: it discloses that reversal is exact rather than approximate, per gesture type (commit removed, edit restored verbatim, delete re-inserted in place, arrays/pairs restored wholesale), and that reads are never journaled so n counts mutations not calls. It also warns that load_plan invalidates the history.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The verb and scope are front-loaded, and every sentence adds real information. It is dense and slightly long due to the parenthetical enumeration of reversal behaviors, but nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists so return values needn't be described, and the description covers what an agent needs: coverage list, exactness guarantee, counting semantics, scope boundaries, and an invalidation warning. Nothing material is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single param has a range description, so the schema does the heavy lifting. The description still adds non-obvious semantics: n counts gestures that changed something, not tool calls made — a distinction the schema cannot express.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('step back over') and an explicit resource scope ('your OWN last n mutations'), then enumerates exactly which gesture types are reversible, which distinguishes it from siblings like delete_shape and edit_shape that perform the forward operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete trigger scenario ('a sweep committed against the wrong condition or a batch went in on the wrong sheet') and the value proposition ('one call instead of N deletes'). It also states scope limits explicitly: session-local history only, not the browser canvas undo stack, and load_plan clears it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.