Skip to main content
Glama

revert_last_changes

Revert the last 1–10 file changes made by Claude Code CLI by analyzing session JSONL and applying structured patch data, with automatic active-session detection and sequential undo.

Instructions

Intelligently reverts the last N changes made by Claude Code CLI by analyzing conversation JSONL files. Automatically finds the active session and reverts file modifications using structured patch data.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "revert_last_changes"
  }
}

Input Schema

NameRequiredDescriptionDefault
countNoNumber of recent changes to revert (1-10)
user_messageNoThe message you sent to Claude Code that triggered this revert request
conversation_historyNoConversation history to track previous revert operations

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations at all, the description carries the full behavioral burden. It adds genuinely useful context beyond the schema — automatic active-session discovery and patch-based reversion — but omits the critical traits for a mutation tool: whether changes are recoverable, what happens when files were edited after the change, and whether the operation can partially fail.

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?

Two tight sentences, front-loaded with the action and followed by the mechanism. 'Intelligently' is a filler modifier, but the rest is efficient and well-ordered.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, zero-annotation tool with no output schema, the description explains the machinery but not the outcome an agent needs to decide safely: what state the files end up in, what the tool reports back, and how failure is surfaced. Adequate but with meaningful gaps.

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 all three parameters are already documented in structured form. The description only echoes the 'last N changes' concept tied to count and says nothing about the roles of user_message or conversation_history, so it adds no meaning beyond the schema; baseline 3 applies.

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?

The description pairs a specific verb ('reverts') with a specific resource ('the last N changes made by Claude Code CLI') and even names the mechanism (conversation JSONL files). It's clear what the tool does, though with no siblings listed there is no differentiation to make.

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

Usage Guidelines2/5

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

There is no explicit statement of when to use this versus other approaches, no prerequisites (an active session, unmodified files), and no guidance on choosing the count value beyond what the schema already says. The agent must infer that this is the tool for undoing recent Claude Code edits.

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

Deploy Server

Other Tools