Skip to main content
Glama

Undo or Redo Rack State Mutation

undo_redo

Traverse the per-project in-memory history ring buffer of up to 50 snapshots to revert the latest rack mutation or reapply a reverted mutation, updating rack.yaml atomically. Setting 'action' to 'undo' steps backward across rack-state mutations—excluding catalog-only define_custom_blueprint calls and read-only tools—and pushes the displaced state onto the redo stack, whereas 'redo' is available only immediately after 'undo' because any new rack mutation flushes the redo stack. Calling either action when its target stack is empty is a safe no-op returning applied=false without throwing. Use to roll back an unintended batch change or accidental init_rack reset; use modify_equipment or disconnect_cables instead to edit specific items without reverting intermediate steps.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "undo_redo"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYesHistory traversal direction: "undo" reverts the most recent state mutation, "redo" reapplies a reverted mutation.

Output Schema

NameRequiredDescriptionDefault
dataYesUndo/redo history traversal result payload.
issuesYesStructured diagnostic findings (ERROR, WARNING, INFO) with actionable remediation_suggestions.
statusYesDeterministic execution outcome: "VALID" when the operation succeeded with 0 validation errors; "INVALID" when precondition or engineering validation errors are present in issues[].
summaryYesConcise human- and agent-readable summary of the tool result and validation status.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Goes well past the annotations: discloses the 50-snapshot ring buffer bound, atomic rack.yaml writes, redo-stack flush on any new mutation, and the safe no-op with applied=false on empty stacks. The annotations only cover readOnly/idempotent/destructive flags, so this added context is substantive; the only minor gap is not saying what payload accompanies applied=true.

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-loads the core action and keeps every sentence load-bearing, including the empty-stack no-op and exclusion rules. It is one dense paragraph rather than a structured list, which makes the conditional redo-availability clause slightly harder to scan, but there is little wasted wording.

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?

With an output schema present and annotations covering the safety profile, the description supplies exactly the residual information an agent needs: scope, exclusions, stack semantics, idempotency of empty-stack calls, and alternatives. Nothing required to invoke it correctly is missing.

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

Parameters3/5

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

Schema coverage is 100% and the single enum parameter is already documented, so the description only needs to add value. It does add the traversal semantics (undo steps backward across state mutations and pushes displaced state to the redo stack) that the schema's terse enum description does not convey, but this is modest given only one parameter.

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 pair and resource — "revert the latest rack mutation or reapply a reverted mutation" — and explicitly scopes it to rack-state mutations while excluding catalog-only define_custom_blueprint calls and read-only tools. An agent can distinguish it from every named sibling without opening a 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 an affirmative case (rolling back an unintended batch change or an accidental init_rack reset) and names concrete alternatives for the edit-single-item case (modify_equipment, disconnect_cables) with the reason to prefer them — no intermediate steps reverted. Preconditions for 'redo' availability are stated outright.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources