Skip to main content
Glama

Undo recent writes

undo_writes
Destructive

Revert file writes made by the MCP server, restoring previous content or removing created files. Undo multiple steps or roll back to a specific index.

Instructions

Step the last writes back, newest first, each file restored to the bytes it had before that write — which is what Ctrl+Z stands in for here, since the editor keeps its undo stack in a process this server cannot reach. A write that created a file removes it again. Pass steps to undo several, or since with the index a previous write_history reported to land exactly back at that point whatever was written in between; check write_history first, because one tool call can touch more than one file and a half-undone operation is worse than the mistake you meant to take back.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoUndo back to this journal length, the `index` write_history reported, instead of counting steps
stepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the bar is lower, but the description adds real substance: it discloses that undoing a file-creating write deletes the file, and warns that a half-undone operation is worse than the original mistake. It does not cover error behavior or what happens if the journal is shorter than requested.

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?

Core purpose is front-loaded in the first clause, and the Ctrl+Z aside earns its place by explaining why a server-side undo exists at all. The remaining text is one dense, comma-chained block that takes effort to parse, but there is little outright filler.

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?

No output schema exists, so the description carries the return-behavior burden, and it does tell the agent what state results (files restored, created files removed). Combined with the `write_history` prerequisite and the multi-file hazard warning, an agent has enough to call it correctly, though failure modes and the neither-parameter default remain unstated.

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 50% (`steps` is undocumented in the schema), and the description compensates by explaining both parameters: `steps` as a count of writes to reverse, `since` as a journal index from `write_history` that lands exactly at a prior point regardless of intervening writes. It doesn't state the default when neither is supplied, leaving the single-step default implicit in 'the last writes'.

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 ('step the last writes back, newest first, each file restored to the bytes it had before that write') and pins down the scope of what 'undo' means here. The Ctrl+Z analogy plus the note that the server cannot reach the editor's undo stack cleanly separates it from rollback_data and list_backups in the sibling set.

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?

Explicitly names both control paths and the condition that selects each: `steps` to undo several, `since` with the `index` a previous `write_history` reported to land exactly at a point 'whatever was written in between'. It also states the prerequisite ('check `write_history` first') and the reason (one call can touch more than one file).

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