Skip to main content
Glama

undo_edit

Destructive

Revert the latest edit made by the server's write tools, or a specific edit by ID. Refuses to undo when affected files changed afterward, preventing newer work from being overwritten.

Instructions

Revert an edit applied by the write tools (the latest one by default). The undo history keeps the last 20 edits of this server session; older ones, and ids that were already undone, cannot be reverted.

Refuses when any of its files was changed after the edit, so later work is never overwritten. An edit blocked by a newer one names that edit, which must be undone first.

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

Input Schema

NameRequiredDescriptionDefault
idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.4

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: annotations only flag destructive/not-idempotent/not-read-only, while the description discloses the 20-edit session-bounded history, the irreversibility of expired or previously undone ids, the conflict precondition (files changed after the edit), and the refusal message semantics. These are exactly the failure modes an agent needs to predict before invoking a destructive tool.

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

Conciseness5/5

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

Two short paragraphs, front-loaded with the primary action and default, followed by the constraints. Every sentence conveys a distinct operational fact (scope, limit, staleness check, ordering rule) with no repetition of the annotations or schema.

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 single-optional-parameter destructive tool with no output schema, this covers purpose, preconditions, scope limits, failure handling, and ordering — everything needed to call it correctly or to recover from a refusal. The annotations already carry the safety profile, and nothing material appears 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 description coverage is 0%, so the description must carry the load; it does explain that omitting the optional id reverts the latest edit, which is the key semantic of the single parameter. However, it never says where an id comes from or its shape, leaving the agent to infer that ids are returned by the write tools. Minimal but adequate for a one-parameter tool.

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 and resource ('Revert an edit applied by the write tools') plus the default targeting behavior ('the latest one by default'). This cleanly positions it as the inverse of the write tools in the sibling list (edit, apply_edit, batch) so an agent can distinguish it without opening any schema.

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

Usage Guidelines4/5

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

Gives concrete applicability conditions: only the last 20 edits of the current server session, never already-undone ids, and refusal when files changed after the edit. It also explains the dependency rule that a blocked edit 'names that edit, which must be undone first,' which effectively tells the agent to undo in reverse order. It stops short of naming an alternative sibling to use when the target is out of range (e.g., re-applying a write instead), so it is not a full 5.

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