Skip to main content
Glama
sangingeum
by sangingeum

undo_operation

Destructive

Revert a recorded filesystem operation by checking affected paths against recorded before/after states; if any path changed since, refuse the undo and leave files untouched.

Instructions

Undo one recorded operation and return the new operation_id and undo_available.

    Before writing, every affected path is compared with the operation's
    recorded before and after state. A path that matches neither was changed
    afterwards: the whole undo is refused with UNDO_CONFLICT and nothing is
    modified. A recorded move, copy or multi-file patch is undone as one
    operation. Undoing a create removes the file only while it still matches
    what was created. The undo is itself recorded; a refusal is recorded as an
    undo_refused row carrying the conflict code and the blocking paths, and
    that row is never offered as undoable.
    

Input Schema

NameRequiredDescriptionDefault
operation_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A3.9/5.0
Behavior5/5

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

Substantially exceeds the annotations (destructive=true, idempotent=false) by describing the before/after verification pass, all-or-nothing refusal with UNDO_CONFLICT and zero modification, atomic handling of moves/copies/multi-file patches, the create-undo precondition, and that refusals are logged as undo_refused rows that are never offered as undoable. This is exactly the kind of consequence-level detail an agent needs 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.

Conciseness4/5

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

Front-loaded with the action and return values, then the failure modes. Dense but every sentence adds behavioral information; slightly verbose in the multi-file/move-copy enumeration but not padded.

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, yet the description names the returned fields (operation_id, undo_available) and explains conflict/refusal outcomes thoroughly. The remaining hole is provenance of the operation_id, which an agent must guess.

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?

With one parameter and 0% schema description coverage, the description carries the burden; it only conveys indirectly that operation_id identifies 'one recorded operation'. It never states the id format, source (history_list?), or whether cross-workspace ids are valid, so the gap is only partially closed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Undo one recorded operation') plus the return values, which is unambiguous about what the tool does. It implicitly separates itself from undo_last by emphasizing 'one recorded operation' (id-driven) but never names that sibling, so it falls short of full differentiation.

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

Usage Guidelines3/5

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

Usage is only implied: taking an operation_id suggests the caller already has a recorded operation from history, but the description never says where to get that id or when to prefer this over undo_last. No exclusions or prerequisites are stated.

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