Skip to main content
Glama

Validate automation YAML authoring rules

automations_validate_best_practices
Read-onlyIdempotent

Lint Home Assistant automation YAML against static authoring rules before saving to catch missing mode, alias, trigger IDs, deprecated service keys, and other issues.

Instructions

Validate automation YAML against static Home Assistant authoring rules.

Parses yaml_content with plain yaml.safe_load (HA-only tags like !input/!secret are NOT resolved and make parsing fail with a YAML parse error, same as any other unknown tag) and runs fixed checks: a state trigger without 'for:', a missing 'mode:', multiple triggers without 'id:', a missing 'alias:'/'id:', the deprecated 'service:' action key, 'restart' mode, and a missing 'description:'.

Use when: linting automation YAML before saving it with automations_set_automation_config. Not for: checking that referenced entities/services actually exist — use automations_validate_automation_references; blueprint content with unresolved '!input'/'!secret' tags — extract them to plain YAML first. Returns: dict {valid_yaml, automations_checked, issues_total, warnings, infos, issues[], summary}; each issue is {automation, rule, severity, message} with severity 'warning' (should fix) or 'info' (good to know). Errors: returns {"valid_yaml": False, "error": "YAML parse error: ...", "issues": []} for invalid YAML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yaml_contentYesYAML text of a single automation dict or a list of automation dicts to lint. Parsed with plain `yaml.safe_load`, so HA-only tags like '!input'/'!secret' are not resolved.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / yaml_content / description
      Added value: +"YAML text of a single automation dict or a list of automation dicts to lint. Parsed with plain `yaml.safe_load`, so HA-only tags like '!input'/'!secret' are not resolved."
  2. Addedv0.18.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantial context: parsing uses plain `yaml.safe_load` so HA-only tags fail, the exact fixed rule set run, the return dict shape, and the specific error payload for invalid YAML. This is well beyond what the annotations convey.

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?

Front-loaded purpose sentence followed by clearly labeled Use when / Not for / Returns / Errors blocks. It is longer than typical, but each section carries distinct, non-redundant information (checks list, return shape, error contract) and is easy to scan.

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 one-param static linter with an output schema, the description covers the parse model, the rule set, the routing to alternatives, and the error contract. Nothing an agent needs to select or invoke it correctly 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?

Single parameter with 100% schema coverage, so the schema already documents `yaml_content` including the safe_load/!input caveat. The description largely restates that parsing behavior rather than adding new parameter-level semantics, so the baseline of 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?

Opens with a specific verb+resource: 'Validate automation YAML against static Home Assistant authoring rules.' It immediately distinguishes itself from the sibling `automations_validate_automation_references` and enumerates the concrete static checks performed, so an agent knows exactly what class of validation this is.

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' (linting before saving with `automations_set_automation_config`) and 'Not for' clauses that name the alternative tool for reference checking and call out the blueprint/!input case with a prescribed workaround. Both when-to-use and when-not-to-use are stated with named siblings.

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