Skip to main content
Glama

Undo

undo
Destructive

Revert the last change or changes on a BPMN diagram, including a full tool call, user gesture, or layout change. Restore a known-good state after verifying the result was wrong.

Instructions

Undoes the last changes on the diagram, like the editor's Undo button (Ctrl+Z): a whole tool call, or a user gesture, per step, including a layout or a replaced diagram. Use it to back out of your own last call when its result is wrong, after checking with get_shapes or get_diagram_image. It also undoes the user's own edits if they come last: read the diagram first. Returns how many steps were undone and whether more can be undone or redone.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsNoNumber of steps to undo. Default: 1

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.6

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=false, so the safety profile is covered. The description adds context beyond that: that undo operates at the granularity of whole tool calls or user gestures, that it can roll back a layout or a replaced diagram, and that pre-reading the diagram is needed because the user's edits may be the most recent. It does not discuss failure modes (e.g., nothing to undo) or limits like the 20-step cap.

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?

Three sentences, each doing distinct work: definition and scope first, then when to use it plus the prerequisite read, then what it returns. Front-loaded and free of filler, though the Ctrl+Z parenthetical is slightly redundant with 'like the editor's Undo button'.

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

Completeness4/5

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

With no output schema, the description carries the return contract and does so ('how many steps were undone and whether more can be undone or redone'). Combined with the destructive annotation and full schema coverage, an agent has enough to call this correctly; only error/empty-history behavior is unspecified.

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% for the single 'steps' parameter, so baseline is 3. The description earns above baseline by defining what a step actually means — a whole tool call or a user gesture, including a layout or a replaced diagram — a unit the schema's 'Number of steps to undo' leaves undefined.

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

Purpose4/5

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

Names a specific verb and resource ('Undoes the last changes on the diagram') and pins the granularity precisely: one tool call or one user gesture per step, including layout or replaced-diagram operations. The editor/Ctrl+Z analogy makes the semantics immediately legible. It does not explicitly route to the 'redo' sibling, only referencing it inside the return-value sentence, so sibling differentiation is implied rather than stated.

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 an explicit trigger ('back out of your own last call when its result is wrong') and a required pre-check ('after checking with get_shapes or get_diagram_image'), naming the sibling tools to consult first. It also flags the risk case for using it ('it also undoes the user's own edits if they come last: read the diagram first'), which functions as a when-not-to-act-blindly condition.

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