status
Check the current state of undo operations, including checkpoint count, stack size, and undo availability, to manage file modifications effectively in the undo-mcp system.
Instructions
Get current status of the undo system (checkpoint count, number of checkpoints in the stack, and whether undo is possible)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:143-153 (handler)Handler logic for the 'status' tool within the CallToolRequestSchema handler. It retrieves the status from the ChangeTracker instance and returns a formatted text response.case "status": { const status = changeTracker.getStatus(); return { content: [ { type: "text", text: `📊 Undo System Status:\nCheckpoints: ${status.checkpointCount}\nCan Undo: ${status.canUndo}`, }, ], }; }
- src/index.ts:69-76 (registration)Registration of the 'status' tool in the TOOLS array, used for ListToolsRequestSchema response. Includes name, description, and empty input schema.{ name: "status", description: "Get current status of the undo system (checkpoint count, number of checkpoints in the stack, and whether undo is possible)", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:72-75 (schema)Input schema definition for the 'status' tool (empty object, no parameters required).inputSchema: { type: "object", properties: {}, },
- src/changeTracker.ts:177-188 (helper)Helper method 'getStatus()' in ChangeTracker class. Deduplicates checkpoints and returns the current checkpoint count and undo availability.getStatus(): { checkpointCount: number; canUndo: boolean; } { // Deduplicate checkpoints before returning status this.deduplicateCheckpoints(); return { checkpointCount: this.undoStack.length, canUndo: this.undoStack.length > 0, }; }