Skip to main content
Glama
Home Assistant MCP Server

Home Assistant MCP Server

Official

Get Script Config

ha_config_get_script
Read-onlyIdempotent

Retrieve a Home Assistant script's complete configuration, including sequence, mode, and fields, by bare storage key or entity ID to inspect or verify its logic.

Instructions

Get Home Assistant script configuration.

Returns the complete configuration for a script, including sequence, mode, fields, and other settings.

The returned config_hash stays the same across consecutive reads of an unchanged config.

The returned script_id is the canonical bare storage key resolved by the REST client (matching what ha_config_set_script / ha_config_remove_script expect), falling back to the input identifier on the rare path where the REST envelope omits it. Prefix handling matches ha_config_get_automation in behavior (mechanism differs: automations resolve through the entity registry; scripts strip the prefix).

EXAMPLES:

  • Get script (bare form): ha_config_get_script("morning_routine")

  • Get script (entity_id form): ha_config_get_script("script.morning_routine")

For detailed script configuration help, use ha_get_skill_guide.

read inspect fetch view existing script config sequence actions get show detail

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": {
      "script_id": "<script_id>"
    },
    "name": "ha_config_get_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
script_idYesScript identifier — bare storage key ('morning_routine') or entity_id form ('script.morning_routine'); a leading 'script.' prefix is stripped before lookup.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv7.14.2

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description goes beyond that with genuinely useful behavior: config_hash is stable across consecutive reads of an unchanged config (enabling change detection), and the returned script_id is canonicalized by the REST client with a documented fallback path. It omits error behavior when the script does not exist.

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

Conciseness3/5

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

The core purpose is front-loaded and the examples are cheap and useful, but the paragraph on script_id resolution and prefix-handling mechanism is dense implementation detail for a lookup tool, and the trailing keyword list ("read inspect fetch view existing...") is pure noise. Roughly a third of the text could be cut without losing call-relevant information.

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 single-parameter read tool with full annotation coverage and an output schema, the definition supplies everything needed to invoke it correctly: lookup forms, id normalization, and hash stability semantics. Only the failure mode (unknown script_id) is left unaddressed, which is a minor gap given the output schema exists.

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 coverage is 100% and the schema's script_id description already documents the bare-key and entity_id forms plus the stripping of a leading 'script.' prefix. The description's restatement and its two examples duplicate that schema content rather than adding new parameter meaning, so the baseline 3 applies; the canonicalization notes are about the return value, not the input.

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?

The description opens with a specific verb and resource ("Get Home Assistant script configuration") and then enumerates what the config contains (sequence, mode, fields). It also distinguishes itself from ha_config_set_script, ha_config_remove_script, and ha_config_get_automation by name, so an agent can place it among the ~60 siblings 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 Guidelines4/5

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

The purpose is unambiguous read-only retrieval, the two call forms (bare key vs. entity_id) are demonstrated, and an explicit alternative is offered for a related need ("For detailed script configuration help, use ha_get_skill_guide"). It stops short of stating when NOT to use it, e.g. that ha_get_state should be used for runtime state rather than configuration.

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