Skip to content

Backup Tools

Complete backup system with risk assessment and recovery capabilities, unified into 1 tool.

Manage all backup operations. Auto-deduces action from the parameters you provide.

Actions:

backup()
// Returns: all recent backups

Optional filters:

  • limit (number): Max backups to return (default: 20)
  • filter_operation (string): Filter by type: edit, delete, batch, all
  • filter_path (string): Filter by file path (substring match)
  • newer_than_hours (number): Only recent backups
backup({ backup_id: "20260301-abc123" })
// Returns: full backup metadata, files, timestamps

Compare with current file (backup_id + file_path)

Section titled “Compare with current file (backup_id + file_path)”
backup({ backup_id: "20260301-abc123", file_path: "main.go" })
// Returns: diff showing changes since backup
backup({ cleanup: true, older_than_days: 7, dry_run: true })
// Returns: preview of backups to be removed

Parameters:

  • cleanup (boolean): Set true to clean up
  • older_than_days (number): Delete older than N days (default: 7)
  • dry_run (boolean): Preview without deleting (default: true)

Restore from backup (action: “restore”)

Section titled “Restore from backup (action: “restore”)”

Restore file(s) from a backup. Creates a safety backup before restoring.

// Preview what will be restored
backup({ action: "restore", backup_id: "20260301-abc123", preview: true })
// Restore all files from backup
backup({ action: "restore", backup_id: "20260301-abc123" })
// Restore specific file
backup({ action: "restore", backup_id: "20260301-abc123", file_path: "main.go" })

Restore parameters:

  • action (required): "restore"
  • backup_id (required): Backup ID from backup()
  • file_path (optional): Specific file to restore (default: all files in backup)
  • preview (optional): Show diff without restoring (default: false)

1. backup() → List recent backups
2. backup({ backup_id: "...", file_path: "main.go" }) → Compare changes
3. backup({ action: "restore", backup_id: "...", preview: true }) → Preview restore
4. backup({ action: "restore", backup_id: "..." }) → Execute restore
v3 Toolv4 Equivalent
list_backupsbackup() (no params)
get_backup_infobackup({ backup_id: "..." })
compare_with_backupbackup({ backup_id: "...", file_path: "..." })
cleanup_backupsbackup({ cleanup: true })
restore_backupbackup({ action: "restore", backup_id: "..." })

See Backups & Recovery Guide for detailed usage.