Skip to main content
Glama

list_undos

View all saved undo checkpoints to restore previous file states after AI-driven edits in Claude Code.

Instructions

List all undo checkpoints in the stack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:53-60 (registration)
    Registration of the 'list_undos' tool in the TOOLS array, including name, description, and empty input schema.
    {
      name: "list_undos",
      description: "List all undo checkpoints in the stack",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Tool handler for 'list_undos': invokes changeTracker.listUndoStack() and returns formatted response content.
    case "list_undos": {
      const undoList = changeTracker.listUndoStack();
      return {
        content: [
          {
            type: "text",
            text: `Undo Stack:\n${undoList.join('\n\n')}`,
          },
        ],
      };
    }
  • Implementation of listUndoStack() in ChangeTracker class: deduplicates checkpoints, formats and returns list of undo stack entries with details.
    listUndoStack(): string[] {
      // Deduplicate checkpoints before listing
      this.deduplicateCheckpoints();
      
      if (this.undoStack.length === 0) {
        return ["No undo checkpoints available"];
      }
    
      const list: string[] = [];
      this.undoStack.forEach((checkpoint, index) => {
        const fileCount = checkpoint.files.size;
        const createdFileCount = checkpoint.createdFiles.size;
        const totalFiles = fileCount + createdFileCount;
        const timeAgo = this.getTimeAgo(checkpoint.timestamp);
        
        const filesList = Array.from(checkpoint.files.keys()).map(f => `    - ${f} (modified)`).join('\n');
        const createdFilesList = Array.from(checkpoint.createdFiles).map(f => `    - ${f} (created)`).join('\n');
        
        const allFilesList = [filesList, createdFilesList].filter(Boolean).join('\n');
        
        const isNext = index === this.undoStack.length - 1;
        const prefix = isNext ? "⭐ NEXT TO UNDO" : "";
        
        list.push(
          `[${index + 1}] ${checkpoint.description}${prefix ? ` ${prefix}` : ""}\n` +
          `    Created: ${timeAgo} | Files: ${totalFiles} (${fileCount} modified, ${createdFileCount} created)\n${allFilesList}`
        );
      });
    
      return list;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but doesn't explain what 'undo checkpoints' are, how the stack works, whether this is a read-only operation, or what the output format looks like. This leaves significant gaps for an agent to understand the tool's behavior.

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, clear sentence with no wasted words, making it highly concise and front-loaded. Every part of the sentence contributes directly to understanding the tool's purpose.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'undo checkpoints' or 'the stack' mean, nor does it describe the return values or behavioral context, leaving the agent with insufficient information to use the tool effectively beyond its basic purpose.

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?

The tool has 0 parameters, and the schema description coverage is 100%, so there's no need for parameter details in the description. The description appropriately doesn't mention parameters, earning a high baseline score for not adding unnecessary information.

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 clearly states the verb ('List') and resource ('undo checkpoints in the stack'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'checkpoint' or 'undo', which likely have related but distinct functions, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'checkpoint' or 'undo', nor does it mention any prerequisites or context for usage. It simply states what the tool does without indicating appropriate scenarios.

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/khalilbalaree/undo-mcp'

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