Delete a config file
files_delete_config_filePermanently deletes one YAML, JSON, or TXT file under /config only after explicit confirmation, so you can remove Home Assistant config files no longer needed.
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_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.
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": {
"relative_path": "<relative_path>"
},
"name": "files_delete_config_file"
}
}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 | |||