Skip to main content
Glama

cleanup

Remove all undo checkpoints from the stack to free resources and reset the undo history in the MCP server’s checkpoint-based system for Claude Code editing.

Instructions

Clear all undo checkpoints from the stack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `cleanup()` method of the ChangeTracker class, which executes the core tool logic by clearing the entire undoStack array of all checkpoints.
    cleanup(): void { this.undoStack = []; console.error("[DEBUG] All checkpoints cleared"); }
  • src/index.ts:61-68 (registration)
    Registration of the "cleanup" tool in the TOOLS array, which provides the tool name, description, and input schema for the ListToolsRequestHandler.
    { name: "cleanup", description: "Clear all undo checkpoints from the stack", inputSchema: { type: "object", properties: {}, }, },
  • The switch case handler in the CallToolRequestSchema request handler that invokes changeTracker.cleanup() and returns the success response.
    case "cleanup": { changeTracker.cleanup(); return { content: [ { type: "text", text: "✅ All undo checkpoints cleared", }, ], }; }

Other Tools

Related 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