Skip to main content
Glama

undo_write

Destructive

Revert a journaled write to restore touched files to their exact pre-write state, including moves, renames, and permanent deletes. Defaults to last journal entry; force restores despite later changes.

Instructions

Revert a journaled write: restores every file it touched to its byte-identical pre-write state (a multi-file move or heading rename is restored whole; a delete is restored even if it was permanent). Defaults to the most recent undoable write. Refuses with undo_conflict if a file changed since that write, unless force: true. The undo is itself journaled — undo it to redo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seqNoJournal entry to revert (from list_writes). Defaults to the most recent undoable write.
forceNoRestore even if a file changed after the journaled write; the clobbered state is journaled first so nothing is lost. Defaults to false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.22

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description adds substantial behavioral detail beyond that: byte-identical restoration, whole-operation restoration for multi-file changes, handling of permanent deletes, the undo_conflict guard, the effect of force, and the fact that the undo is itself journaled and can be undone to redo. This is exemplary disclosure of side effects and edge cases.

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?

Every sentence carries necessary information, and key facts are front-loaded: what the tool does, how it handles tricky cases, then defaults and conflict behavior. Despite covering complex semantics, the description remains compact and well-ordered with no filler.

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?

Given that there is no output schema, the description still tells the agent everything needed to invoke the tool correctly: default target, failure mode, force escape hatch, permanent-delete restoration, and redo possibility. The reference to list_writes in the schema completes the workflow context.

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%, so the baseline is 3. The description reinforces the schema's default behavior for seq and explains the force semantics, but it does not add significantly new parameter-level information beyond what the input schema already provides. The description's added value is mostly behavioral, not parameter-specific.

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?

The description opens with a specific verb and resource: 'Revert a journaled write' and precisely defines the effect ('restores every file it touched to its byte-identical pre-write state'). It also distinguishes the tool's scope by giving concrete examples like multi-file moves, heading renames, and permanent deletes, leaving no ambiguity about what the tool does.

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?

The description gives clear operational guidance: it defaults to the most recent undoable write, explains the undo_conflict refusal condition, and clarifies how force:true changes the behavior. While it does not explicitly state 'use list_writes to find a seq,' the schema parameter references list_writes, and there is no competing sibling tool for undo operations, so the context is clear enough.

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