Skip to main content
Glama

undo_last

Reverse your last n takeoff mutations—polygon commits, shape edits, deletes, material changes—to restore exact session state when a sweep hits the wrong sheet or condition.

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

TableJSON Schema
NameRequiredDescriptionDefault
nNoHow many steps to reverse (1–100)

Output Schema

TableJSON 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.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"
      +]
  2. 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"
      +]
  3. 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"
      +]
  4. 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"
      +]
  5. 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)"
  6. 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)"
  7. Addedv0.1.6

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does so: it explains that each step is reversed exactly (commit removed, edit restored verbatim, delete re-inserted in place, arrays and waste/multiplier pairs restored whole), that reads are never journaled so n counts mutations not calls, and how load_plan interacts with 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?

Front-loaded with the action, and nearly every clause is load-bearing (reversal fidelity, journaling rule, scope caveat). The mid-sentence enumeration of reversal semantics is dense but informative rather than repetitive, so the length is justified with only minor tightening possible.

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?

For a one-parameter mutation-reversal tool with no annotations, the description supplies everything an agent needs: what is reversible, how precisely, the counting rule, scope limits, and interaction with load_plan. The output schema covers return values, so 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 n parameter is documented in-schema, so the baseline is 3. The description earns an extra point by clarifying that n counts state-changing gestures rather than tool calls made, which is a semantic distinction the schema's '1–100 steps' wording does not capture.

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 (undo) and resource (last n mutations) and enumerates exactly which gestures count: measure_polygon commits, edit_shape, delete_shape, edit_materials, edit_condition, and RFI verbs. An agent can distinguish this from delete_shape or the RFI delete siblings without opening another schema.

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 concrete triggering scenarios (a sweep committed against the wrong condition, a batch on the wrong sheet) and states the payoff (one call instead of N deletes). It also draws explicit boundaries: session history only, not the browser canvas undo stack, and cleared by load_plan.

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