Skip to main content
Glama

undo_file_change

Destructive

Undo one retained file edit/write, move or copy by changeId. Pass the original workSessionId. Refuses if the contents changed afterward, the original move location is occupied, or a crash left the outcome unknown. Does not undo terminal commands or permanent deletions.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "changeId": "<changeId>"
    },
    "name": "undo_file_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
changeIdYes
deviceIdNoComputer name or id
workSessionIdNoFrom create_work_session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id; optional with one computer or a default"New value: +"Computer name or id"
  2. Changed2 schema fields changed
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id from list_devices. Optional with one computer online or a default set."New value: +"Computer name or id; optional with one computer or a default"
    • changedInput schema / properties / workSessionId / description
      Previous value: -"Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work."New value: +"From create_work_session"
  3. Added

TDQS

A4.4/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, so the mutation risk is known; the description goes further by disclosing the exact refusal conditions the tool enforces at runtime. Those guardrails (stale contents, occupied move target, indeterminate crash state) are behavioral facts an agent cannot infer from the schema and directly shape whether it should call the tool or re-check state first.

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

Conciseness3/5

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

Three tight sentences, front-loaded with the core action before the caveats, with no filler. However, it omits any mention of what a successful undo returns or how the agent should recover from each refusal, leaving the definition thinner than its complexity warrants.

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?

For a destructive, non-readonly tool with no output schema and only three parameters, the description covers the action, the key input, the failure modes, and the out-of-scope operations. The remaining gap is post-call behavior: what a successful undo yields and what the agent should do after a refusal.

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 67%, and the description adds real meaning for the two uuid parameters: changeId identifies which single change is reverted, and workSessionId must be the *original* session rather than the current one. deviceId is left entirely to its schema text ('Computer name or id'), so the description does not fully cover all three parameters.

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 first sentence gives a specific verb (undo) and a precisely scoped resource: one retained file edit/write, move or copy, keyed by changeId. The closing exclusion ('Does not undo terminal commands or permanent deletions') further narrows the operation so an agent can distinguish it from other mutation or listing tools without opening the 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?

It states the precondition for use (pass the original workSessionId) and enumerates three explicit when-not conditions: contents changed afterward, original move location occupied, or an unknown outcome after a crash. It does not name an alternative tool to use when one of those refusals applies, which keeps it short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources