Manage Backups
ha_manage_backupCreate, list, restore, and delete Home Assistant backups at two scopes: full snapshots for system-wide recovery, or per-entity edit backups to undo recent changes without an HA restart.
Instructions
Manage Home Assistant backups — both full HA snapshots AND per-edit auto-backups.
Pick the scope first, then the action. Wrong scope routes through the wrong code path:
scope | action | What it does |
|
| Without any |
|
| List full HA tarball snapshots as Home Assistant reports them (id, name, date, per-location size). Read-only — use to discover a |
|
| Restore from a full HA tarball. Replaces Home Assistant's configuration plus what |
|
| Delete one full HA tarball by |
|
| On-demand snapshot of one entity ( |
|
| List per-entity auto-backups (lightweight). Filter by |
|
| Read one auto-backup file by name; returns YAML and parsed |
|
| Compare one auto-backup against the entity's current config. RFC 6902 JSON-Patch + add/remove/replace counts; bounded output. Read-only — fetches the live config, makes no changes. |
|
| Re-apply one auto-backup. Existing flow helpers (template, group, utility_meter, …), config subentries and integration config entries require a fresh per-entity backup; other domains follow auto-backup settings and may proceed without one. A deleted flow helper is recreated with a new config-entry ID and its saved entity IDs are restored if unoccupied; a deleted subentry is recreated with a new subentry ID. An integration config entry's snapshot holds its metadata, its enabled state and its options, which are kept only when the ha_mcp_tools component serves the read, its |
|
| Delete one auto-backup by |
When to use which scope:
scope="edits": ha-mcp's own per-entity YAML backups of automations, scripts, scenes, dashboards and helpers. Use them to undo a recent edit by the agent. Lightweight, fast, no restart.scope="snapshot": Home Assistant's own backups — a full backup (createwithoutinclude_*), or a custom backup of some parts, such as one or more apps (include_addons). Restore one only for system-wide recovery (mass config corruption, a broken app update with that app inrestore_addons, etc.).
A snapshot backup is the user's call: before a change that cannot be undone, you may ask the user whether they want one first; make it only when they say so. A full backup is large, and an unrequested one can push an older backup out of retention.
(snapshot, delete) is off by default and layered even when enabled: a human must
set enable_snapshot_delete=true (env var, web settings UI, or add-on Supervisor
options) — an agent cannot turn this on itself. When enabled, a delete call is still
refused if: the target is a scheduled/automatic backup; it's younger than
snapshot_delete_min_age_days (default 7, 0 disables the floor); or it's the single
newest snapshot remaining. These guarantee at least one recovery point always
survives an agent's own mistakes.
Human-managed backup controls: enable_snapshot_actions=false (ENABLE_SNAPSHOT_ACTIONS) blocks every snapshot action, including listing. backup_read_only=true (BACKUP_READ_ONLY) allows edits list/view/diff and snapshot list when snapshots are enabled; it blocks explicit create/restore/delete in both scopes. Automatic pre-edit capture still follows enable_auto_backup. A human must change these controls in the Backups tab, app configuration, or environment; developer tools cannot change them. Global and connection Read Only Mode still restrict writes.
enable_auto_backup and scope="edits": the automatic-on-write capture (every wrapped tool call) is gated by enable_auto_backup=true — if the listing is empty, check the toggle (web settings UI or ENABLE_AUTO_BACKUP=true env var). The explicit (edits, create) action bypasses the toggle since the request is explicit; list / view / restore / delete operate on whatever's already on disk regardless of the toggle's current state.
Flow-helper filters: edits.create accepts a flow helper's entity ID and returns its stable config-entry ID as entity_id. Use that returned ID for edits.list and bulk edits.delete; those filters do not resolve entity aliases. After recreation, the restore result reports the replacement config-entry ID and entity_id_mapping separately.
Examples:
Full backup, when the user asks for one:
ha_manage_backup(scope="snapshot", action="create")Backup of one app:
ha_manage_backup(scope="snapshot", action="create", include_addons=["core_mosquitto"])List snapshots (to discover a backup_id or confirm one landed):
ha_manage_backup(scope="snapshot", action="list")Restore a snapshot's configuration (the database follows the backup):
ha_manage_backup(scope="snapshot", action="restore", backup_id="dd7550ed")Restore a snapshot with one of its apps:
ha_manage_backup(scope="snapshot", action="restore", backup_id="dd7550ed", restore_addons=["core_mosquitto"])Restore after a backup of what it replaces, when the user chose one:
ha_manage_backup(scope="snapshot", action="restore", backup_id="dd7550ed", safety_backup=True)Delete an old snapshot (requires
enable_snapshot_delete=true):ha_manage_backup(scope="snapshot", action="delete", backup_id="dd7550ed", confirm=True)On-demand entity snapshot before a manual UI edit:
ha_manage_backup(scope="edits", action="create", domain="helper_input_boolean", entity_id="welcome_home_active")List recent auto-backups for one automation:
ha_manage_backup(scope="edits", action="list", domain="automation", entity_id="welcome_home")View an auto-backup:
ha_manage_backup(scope="edits", action="view", backup_name="automation.welcome_home.20260521_153000.yaml")Diff an auto-backup vs current state:
ha_manage_backup(scope="edits", action="diff", backup_name="automation.welcome_home.20260521_153000.yaml")Restore an auto-backup:
ha_manage_backup(scope="edits", action="restore", backup_name="automation.welcome_home.20260521_153000.yaml")Delete one auto-backup:
ha_manage_backup(scope="edits", action="delete", backup_name="...")Bulk-delete old auto-backups:
ha_manage_backup(scope="edits", action="delete", older_than_days=30)
If a Claude Desktop user gets a 4-minute timeout with no result on this call, read the target back before repeating it, and tell them to wait a few seconds before clicking the manual-approve button, as clicking it too quickly is known to cause hangs in Claude Desktop. This workaround is specific to Claude Desktop.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scope": "<scope>",
"action": "<action>"
},
"name": "ha_manage_backup"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | (snapshot.create) Tarball name. Auto-generated if not provided. Home Assistant names a full backup made with its automatic-backup settings itself. | |
| limit | No | (edits.list / snapshot.list) Maximum number of entries to return. | |
| scope | Yes | 'snapshot' for full HA tarballs; 'edits' for per-entity auto-backups. | |
| action | Yes | Operation to perform. Valid (scope, action) combinations are listed in the tool description. | |
| domain | No | (edits.create / edits.list / edits.delete) Filter auto-backups by domain (e.g. 'automation', 'helper_timer'). Required for edits.create. | |
| confirm | No | (snapshot.delete) Must be True to confirm deletion. | |
| backup_id | No | (snapshot.restore / snapshot.delete) Tarball ID (e.g. 'dd7550ed'). | |
| entity_id | No | (edits.create / edits.list / edits.delete) Filter auto-backups by entity ID. Required for edits.create. | |
| backup_name | No | (edits.view / edits.restore / edits.delete) Auto-backup filename (format '<domain>.<entity_id>.<timestamp>[_NN].yaml'). Not a tarball ID. | |
| safety_backup | No | (snapshot.restore) Back up what the restore replaces (configuration, plus the database, apps and folders it restores) first, as a manual backup on the default location. Off by default; offer it to the user, who decides. Needs the default backup password. | |
| include_addons | No | (snapshot.create) Custom backup: slugs of the installed apps (add-ons) to include. Supervisor installs only. | |
| restore_addons | No | (snapshot.restore) Slugs of apps (add-ons) in the backup to restore, from its `addons` in the snapshot list. Default: none. Supervisor installs only. | |
| include_folders | No | (snapshot.create) Custom backup: folders to include (`share`, `addons/local`, `ssl`, `media`). Supervisor installs only. | |
| older_than_days | No | (edits.delete) Bulk-delete auto-backups older than this many days. | |
| restore_folders | No | (snapshot.restore) Folders in the backup to restore, from its `folders` in the snapshot list (`share`, `addons/local`, `ssl`, `media`). Default: none. Supervisor installs only. | |
| include_database | No | (snapshot.create) Custom backup: include the database (history); needs include_homeassistant=True. | |
| restore_database | No | (snapshot.restore) Include the database in the restore. Default: restore it when the backup contains it. Must be false for a backup without one; on Supervisor installs it must match the backup. | |
| include_all_addons | No | (snapshot.create) Custom backup: include every app (add-on); not together with include_addons. Supervisor installs only. | |
| include_homeassistant | No | (snapshot.create) Custom backup: include Home Assistant's configuration. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||