Skip to main content
Glama
homeassistant-ai

Home Assistant MCP Server

Official

Remove Script

ha_config_remove_script
DestructiveIdempotent

Delete a Home Assistant script created via the UI. Scripts defined in YAML files cannot be removed through the API; edit those configuration files directly.

Instructions

Delete a Home Assistant script.

EXAMPLE: ha_config_remove_script("old_script")

Only scripts created via the Home Assistant UI can be deleted. Scripts defined in YAML configuration files (scripts.yaml or configuration.yaml) cannot be deleted through the API and return a 405 Method Not Allowed error; edit the configuration file directly instead.

WARNING: Deleting a script that is used by automations may cause those automations to fail.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
waitNoWait for script to be fully removed before returning.
script_idYesScript identifier to delete — bare storage key ('old_script') or entity_id form ('script.old_script'); a leading 'script.' prefix is stripped before lookup.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv8.6.0
    • changedInput schema / properties / wait / description
      Previous value: -"Wait for script to be fully removed before returning. Default: True."New value: +"Wait for script to be fully removed before returning."
  2. First observedv7.14.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=true, but the description adds failure modes the annotations cannot convey: the 405 for YAML scripts, the risk that dependent automations break, and a client-specific timeout/hang workaround. This is well beyond the annotation baseline.

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?

The headline, example, constraint paragraph and warning are front-loaded and each earns its place. The closing Claude Desktop workaround paragraph is long and reads as client-specific troubleshooting rather than tool-selection guidance, slightly diluting an otherwise tight entry.

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

Completeness4/5

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

With annotations covering the safety profile and an output schema present, the description need not explain return values. It covers restrictions, risk and example usage, leaving only minor gaps around the wait parameter's practical effect.

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

Parameters3/5

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

Schema description coverage is 100%, so both script_id (bare key vs entity_id, prefix stripping) and wait are already documented in the schema. The description's example reinforces the id form but adds no syntax or semantics beyond what the schema states; baseline 3 applies.

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 ('Delete a Home Assistant script') and immediately supplies a concrete example call. An agent can distinguish this from the sibling ha_config_set_script / ha_config_get_script without opening any 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?

Explicitly defines the negative condition: only UI-created scripts can be deleted, while YAML-defined scripts return 405 and must be edited in the config file instead. That is a real usability boundary with an alternative path, not just implied context.

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