Backup Tools
Overview
Section titled “Overview”Complete backup system with risk assessment and recovery capabilities, unified into 1 tool.
backup
Section titled “backup”Manage all backup operations. Auto-deduces action from the parameters you provide.
Actions:
List backups (no params)
Section titled “List backups (no params)”backup()// Returns: all recent backupsOptional filters:
limit(number): Max backups to return (default: 20)filter_operation(string): Filter by type:edit,delete,batch,allfilter_path(string): Filter by file path (substring match)newer_than_hours(number): Only recent backups
Get backup details (backup_id)
Section titled “Get backup details (backup_id)”backup({ backup_id: "20260301-abc123" })// Returns: full backup metadata, files, timestampsCompare 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 backupClean up old backups (cleanup: true)
Section titled “Clean up old backups (cleanup: true)”backup({ cleanup: true, older_than_days: 7, dry_run: true })// Returns: preview of backups to be removedParameters:
cleanup(boolean): Set true to clean upolder_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 restoredbackup({ action: "restore", backup_id: "20260301-abc123", preview: true })
// Restore all files from backupbackup({ action: "restore", backup_id: "20260301-abc123" })
// Restore specific filebackup({ action: "restore", backup_id: "20260301-abc123", file_path: "main.go" })Restore parameters:
action(required):"restore"backup_id(required): Backup ID frombackup()file_path(optional): Specific file to restore (default: all files in backup)preview(optional): Show diff without restoring (default: false)
Workflow Example
Section titled “Workflow Example”1. backup() → List recent backups2. backup({ backup_id: "...", file_path: "main.go" }) → Compare changes3. backup({ action: "restore", backup_id: "...", preview: true }) → Preview restore4. backup({ action: "restore", backup_id: "..." }) → Execute restoreMigration from v3
Section titled “Migration from v3”| v3 Tool | v4 Equivalent |
|---|---|
list_backups | backup() (no params) |
get_backup_info | backup({ backup_id: "..." }) |
compare_with_backup | backup({ backup_id: "...", file_path: "..." }) |
cleanup_backups | backup({ cleanup: true }) |
restore_backup | backup({ action: "restore", backup_id: "..." }) |
See Backups & Recovery Guide for detailed usage.