Skip to main content
Glama

undo_edit

Revert only the most recent file write, preserving other changes. Refuses to overwrite external edits unless forced, and removes newly created files.

Instructions

Revert plumb's most recent write to a file — the safe alternative to git checkout <file>, which discards EVERY uncommitted change in the file. undo_edit restores only what plumb's last edit_file/write_file changed, and refuses by default if the file was modified since (an external or peer edit), so it never silently clobbers someone else's work (pass force:true to override). If the last write created the file, undo removes it. Single-level per file: it undoes the last write; a fresh write re-arms it. Undo history is per session and cleared on a workspace switch. Very large files (pre-write content over 1 MiB) are not snapshotted, so undo is unavailable for them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoRevert even if the file changed since plumb's last write to it (an external or peer edit). Default false — the undo is refused in that case so it cannot silently discard someone else's change.
file_pathNoAbsolute path, file:// URI, or workspace-relative path of the file to revert.
Behavior5/5

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

With no annotations provided, the description fully carries the burden and excels: it discloses the refusal default, force override, file-creation removal, single-level undo behavior, per-session history clearing, and the 1 MiB snapshot limit. This gives the agent a complete mental model of side effects and constraints.

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?

The description is a single dense paragraph, but every sentence earns its place: main purpose, safety comparison, refusal behavior, force override, creation removal, re-arm behavior, session scope, and size limit. It is front-loaded with the primary action and logically organized from common to edge cases.

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?

This is a moderately complex tool with no output schema and no annotations, yet the description covers all essential behavioral aspects: what it undoes, safety guards, force semantics, file lifecycle, undo depth, session lifetime, and availability limitations. It is complete enough for an agent to correctly decide when to call it and predict outcomes.

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 description coverage is 100%, so the baseline is 3, but the description adds meaningful context for `force` by elaborating when and why to use it (to override refusal after external edits) and warns about the 1 MiB limit affecting undo availability. It does not add much for `file_path` beyond the schema, but the added force context justifies a 4.

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 action and resource: 'Revert plumb's most recent write to a file.' It clearly distinguishes itself from `git checkout <file>` by framing it as the safe alternative, and the detail about restoring only plumb's last edit removes ambiguity about scope.

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 explicitly names `git checkout <file>` as an alternative and explains the safety tradeoff, giving clear context for when this tool is appropriate. It also describes refusal conditions (file modified since, no snapshot over 1 MiB), but does not explicitly state 'use this instead of X when...' or cover scenarios like undoing multiple edits, so it stops short of full usage-exclusion guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server