Delete a config file
files_delete_config_filePermanently delete a Home Assistant config file after explicit confirmation. Requires confirm=True; deletion is immediate and irreversible with no backup or undo.
Instructions
Permanently delete one config file under /config after an explicit confirmation.
Without confirm=True returns a confirmation prompt and does not
resolve or touch relative_path at all. With confirm=True, resolves
relative_path via _safe_path and calls Path.unlink(); there is no
backup or trash in this tool — deletion is immediate and irreversible
from here alone.
Use when: removing a YAML/JSON/txt file that HA no longer needs, once
that removal is confirmed.
Not for: keeping the ability to undo — commit the config to git first
(git_git_commit_all) or write through
git_safe_write_with_checkpoint so a rollback stays possible.
Returns: dict {"success": True, "deleted": ...} when confirmed,
otherwise a confirmation prompt.
Errors: returns {"error": "confirmation_required", "message": ..., "action": ...} when confirm is false; raises FileNotFoundError
when the file does not exist, and raises PermissionError (from
_safe_path) for a path outside the config directory, a disallowed
extension, or secrets.yaml/.storage.
Limits: requires confirm=True; the deletion runs immediately with no
undo once confirmed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Set true to actually delete the file. False (default) performs no action and instead returns a confirmation prompt; `relative_path` is not resolved or touched in that case. | |
| relative_path | Yes | Path to the file relative to the HA config directory (HA_CONFIG_PATH) to delete, e.g. 'packages/old.yaml'. Must use an allowed extension (.yaml/.yml/.json/.txt) and not touch secrets.yaml or .storage/. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||