Skip to main content
Glama
Vortitron

home-assistant-mcp

by Vortitron

Create or update script

ha_set_script
Destructive

Create or update a Home Assistant script by ID to reuse a sequence of actions across multiple automations. Requires write access.

Instructions

Create or update a script by id. 'config' is the script body ({ alias, sequence, fields, mode, ... }); Home Assistant reloads scripts after saving. Use it for a step several automations share, then call it from each with action 'script.'. Requires HA_ALLOW_WRITE=true and HA_ALLOW_CONFIG_WRITE=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configYesScript config object: { alias, sequence, fields, mode, ... }.
script_idYesScript id: the key in scripts.yaml and the object id of script.<id>, e.g. 'raise_heat'. 'script.raise_heat' also works.
instance_idNoOptional: the instance you mean (as listed by vomehome_list_instances). When given, the call is refused if this session is targeting a different home, instead of answering from it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutation profile is covered. The description adds real value beyond that: HA reloads scripts after saving, and the call requires HA_ALLOW_WRITE=true and HA_ALLOW_CONFIG_WRITE=true. It does not spell out what an overwrite of an existing script_id destroys, which keeps it from a 5.

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?

Four compact sentences with the create/update purpose front-loaded, followed by config semantics, side effect, usage pattern, and prerequisites. Each sentence carries information, with only mild redundancy between the description's config gloss and the schema's own.

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?

For a nested-object mutation tool with no output schema, the description covers purpose, the auto-reload side effect, the shared-step use case, and the required write flags. The nested config body is only sketched, but the 100%-covered schema carries that detail, so nothing critical is missing.

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 the schema already documents script_id (key in scripts.yaml, 'script.<id>' form) and instance_id semantics thoroughly. The description's restatement of config as the '{ alias, sequence, fields, mode, ... }' body mirrors the schema description rather than extending it, so the baseline of 3 applies.

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

Purpose4/5

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

The description leads with a specific verb+resource pairing ('Create or update a script by id') that is immediately distinguishable from the sibling getters/deleters (ha_get_script, ha_delete_script). It is clear, though it does not name any sibling explicitly to route the agent, so it stops short of a 5.

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

Usage Guidelines4/5

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

It gives genuine when-to-use guidance: 'Use it for a step several automations share, then call it from each with action script.<id>.' That is a concrete scenario an agent can act on. It offers no explicit exclusions or named alternatives (e.g. ha_update_entity), so it is not a full 5.

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