Skip to main content
Glama

Delete a config file

files_delete_config_file
DestructiveIdempotent

Permanently 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

TableJSON Schema
NameRequiredDescriptionDefault
confirmNoSet 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_pathYesPath 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.25.1
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "description": "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.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / relative_path / description
      Added value: +"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/."
  2. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, but the description goes well beyond them: it explains the two-phase confirm gate, that relative_path is not even resolved when confirm is false, that there is no backup or trash, and the specific error behaviors (_safe_path PermissionError for secrets.yaml/.storage, FileNotFoundError). This is richer behavioral context than the annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well structured with labeled sections (Use when / Not for / Returns / Errors / Limits) and front-loaded with the destructive framing. Slightly long since it restates return and error details that partly duplicate annotations and output schema, but every section is purposeful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, confirm-gated tool, the description covers confirmation semantics, irreversibility, alternatives, error conditions, and limits. With an output schema present it need not explain returns, yet adds a useful one-line summary; nothing an agent needs is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: the concrete error payload ({"error": "confirmation_required", ...}) returned when confirm is false, and the side effect that relative_path is untouched in that path. That is genuine added semantic value over the field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with scope: 'Permanently delete one config file under /config'. It also distinguishes itself from sibling tools that offer undo (git_git_commit_all, git_safe_write_with_checkpoint), so an agent can route correctly without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use when' and 'Not for' sections, with named alternatives for the rollback case. The confirmation prerequisite and the irreversible nature are stated as gating conditions, which is exactly what a destructive tool needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools