Skip to main content
Regular backups protect your UniFi configuration against accidental changes, hardware failure, and human error. The backup tools let your AI assistant trigger on-demand backups, list what’s available, download files to local storage, and configure recurring backup schedules — all without leaving your conversation.
Restore operations are destructive. Restoring a backup will overwrite your current controller configuration and may cause a controller restart, temporarily disconnecting managed devices. Always pass confirm=True explicitly and consider leaving create_pre_restore_backup=True (the default) enabled so you have a rollback point.

Tools

trigger_backup

Creates a new backup immediately. The operation completes synchronously and returns the backup filename and a download URL.
string
required
The site identifier.
string
required
The scope of the backup. Accepted values:
  • network — network settings and device configurations only. Faster and smaller (typically under 10 MB).
  • system — complete OS, application, and device configurations. Comprehensive but larger (can exceed 100 MB).
integer
How many days to keep the backup on the controller before automatic deletion. Use -1 for indefinite retention. Defaults to 30.
boolean
required
Must be true to trigger the backup.
boolean
When true, returns what would be created without actually creating the backup.
Example response

list_backups

Returns all backup files available on the controller, including filename, size, creation date, type, and whether each backup is valid.
string
required
The site identifier.
Example response

get_backup_details

Returns detailed metadata for a single backup file identified by filename.
string
required
The site identifier.
string
required
The exact filename of the backup (e.g., "backup_2025-11-15_03-00-00.unf").

download_backup

Downloads a backup file from the controller and saves it to a local path. Optionally calculates a SHA-256 checksum to verify file integrity.
string
required
The site identifier.
string
required
The exact filename of the backup to download.
string
required
The local filesystem path where the backup should be saved (e.g., "/backups/unifi_2025-11-15.unf"). Parent directories are created automatically.
boolean
When true, a SHA-256 hash of the downloaded file is calculated and returned. Defaults to true.
Example response

delete_backup

Permanently removes a backup file from the controller. This cannot be undone.
string
required
The site identifier.
string
required
The exact filename of the backup to delete.
boolean
required
Must be true to delete the backup.
boolean
Preview the deletion without applying it.

restore_backup

Restores the controller from a backup file. This is a destructive operation — the current configuration will be overwritten. By default, the tool creates a safety backup of the current state before initiating the restore, giving you a rollback option if anything goes wrong.
string
required
The site identifier.
string
required
The exact filename of the backup to restore from.
boolean
When true (the default), the tool automatically creates a network backup of the current state before restoring. This backup is retained for 7 days.
boolean
required
Must be true to initiate the restore. This is intentionally a hard requirement given the destructive nature of the operation.
boolean
Preview what the restore would do without initiating it.
After calling restore_backup, the controller may restart. Managed devices may temporarily disconnect during the restart. Expect a connection gap of 2–5 minutes. Do not close your MCP session immediately — wait for the controller to come back online before verifying the result.

validate_backup

Checks a backup file for integrity and reports any warnings or errors before you commit to restoring it.
string
required
The site identifier.
string
required
The exact filename of the backup to validate.
Example response

schedule_backups

Configures a recurring automated backup schedule. Once set, the controller will trigger backups automatically at the specified frequency and time without further intervention.
string
required
The site identifier.
string
required
Scope of scheduled backups: network or system.
string
required
How often to run. Accepted values: daily, weekly, monthly.
string
required
The time to run the backup in 24-hour HH:MM format (e.g., "03:00" for 3 AM). Schedule during low-traffic hours.
boolean
Whether the schedule is active. Defaults to true.
integer
How long to keep each backup (1–365). Defaults to 30.
integer
Maximum number of backups to keep on the controller (1–100). Older backups are deleted when this limit is reached. Defaults to 10.
integer
Required when frequency is weekly. The day to run: 0 = Monday through 6 = Sunday.
integer
Required when frequency is monthly. The day of the month to run (1–31).
boolean
When true, syncs each completed backup to the UniFi cloud. Requires a linked UniFi account.
boolean
required
Must be true to configure the schedule.
boolean
Preview the schedule configuration without applying it.

get_backup_schedule

Returns the currently configured automated backup schedule for a site, or indicates that no schedule is set.
string
required
The site identifier.

Schedule examples


Example: safe backup before a config change

This workflow shows the recommended practice of creating a backup, verifying it, making your configuration change, and then cleaning up older backups.
For production environments, use frequency="daily" with cloud_backup_enabled=True. System backups are heavier but provide full recovery; network backups are sufficient for most configuration-only changes.