Skip to main content
Glama

Undo

undo
Destructive

Revert file creates, edits, moves, or deletes made through this server by undo id or the newest N calls. Preview changes with a dry run that lists available ids.

Instructions

Revert create, edit, replace_text, patch, move, or delete calls by undo id or the newest N calls. Use when a change made by this server must be reverted. Do not use for outside changes or expired ids; rewrite those with edit or create. Preview with dryRun, which lists ids. A path changed since that call is skipped while the rest revert; it stays under its id for a retry. The in-memory journal keeps up to 64 calls for 30 minutes, fewer when FS_MAX_UNDO_BYTES fills. No redo. Unknown ids fail NOT_FOUND. Returns steps[] of {id, tool, results[]}, each path restored or with an error code. A long list is cut (failures kept), marked truncated with totalResults. Errors only if every path fails.

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
idNoUndo id from a mutating tool result. Required over HTTP, where all clients share the journal.
stepsNoRevert the newest N calls, newest first. Not with id; rejected over HTTP. Omit both to revert the newest call.
dryRunNoPreview without changing anything. With no id or steps, previews every journaled call and lists their ids.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.20.0
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview which calls would restore, changing nothing. A preview of the whole history assumes each call is reverted after the newer ones, so a file changed since can still show as restored; previewing one id shows that call alone."New value: +"Preview without changing anything. With no id or steps, previews every journaled call and lists their ids."
    • changedInput schema / properties / id / description
      Previous value: -"The undo id from a tool result"New value: +"Undo id from a mutating tool result. Required over HTTP, where all clients share the journal."
    • changedInput schema / properties / steps / description
      Previous value: -"Revert the last N calls (not over HTTP)"New value: +"Revert the newest N calls, newest first. Not with id; rejected over HTTP. Omit both to revert the newest call."
  2. Changed1 schema field changedv2.18.2
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview which calls would restore, changing nothing"New value: +"Preview which calls would restore, changing nothing. A preview of the whole history assumes each call is reverted after the newer ones, so a file changed since can still show as restored; previewing one id shows that call alone."
  3. Addedv2.10.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and non-idempotent; the description goes well beyond them with journal capacity (64 calls / 30 minutes / FS_MAX_UNDO_BYTES), no-redo, skip-and-retain semantics for paths changed since the call, NOT_FOUND on unknown ids, and partial-failure behavior. This is exactly the operational context an agent needs before a destructive revert.

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 purpose and exclusions, then safety constraints, then return/error behavior. Information-dense with almost no filler, though several short clauses are packed together mid-paragraph, which makes it read as a run-on in places.

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?

There is no output schema, so the description carries the return contract itself: steps[] of {id, tool, results[]}, truncation with totalResults and failures retained, and errors only when every path fails. Combined with the journal lifetime limits, an agent has everything needed to call and interpret results.

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%, so baseline is 3, but the description adds real meaning: the id/steps relationship for retries ('it stays under its id for a retry'), what a bare dryRun enumerates, and that omitting both reverts the newest call. It does not add format details for the id string, but the interplay between parameters is clarified.

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?

Opens with a precise verb ('Revert') plus the exact set of sibling operations it reverses (create, edit, replace_text, patch, move, delete) and the two addressing modes (undo id or newest N). An agent can immediately distinguish it from every sibling listed.

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 explicit when ('a change made by this server must be reverted'), when-not ('outside changes or expired ids'), and the alternative for those cases ('rewrite those with `edit` or `create`'). It also names the preview path via dryRun, leaving nothing to inference.

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