Skip to main content
Glama

Validate YAML syntax

files_validate_yaml_content
Read-onlyIdempotent

Validate a YAML string's syntax without writing, accepting Home Assistant tags as opaque values. Use before writing config files or automation configs to catch parse errors.

Instructions

Check YAML syntax for a string without writing anything.

Parses content with a Home-Assistant-tolerant YAML loader that accepts !include*/!secret/!env_var/!input as opaque values, and reports only whether parsing succeeded and the top-level type.

Use when: checking a YAML snippet's syntax before calling files_write_config_file or automations_set_automation_config. Not for: full HA schema validation — use system_check_config; HA tags here are accepted but not resolved, so only syntax is checked, not HA schema validity. Returns: dict {"valid": True, "type": ...} (top-level type name only, not the parsed content) or {"valid": False, "error": ...}. Errors: returns {"valid": False, "error": str(e)} for a YAML parse error rather than raising.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesYAML text to check for syntax errors; nothing is written or read from disk.

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 / content / description
      Added value: +"YAML text to check for syntax errors; nothing is written or read from disk."
  2. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent/non-destructive, but the description adds materially more: the loader tolerates !include*/!secret/!env_var/!input as opaque (not resolved), only syntax is checked, and parse failures return a dict rather than raising. That error-disclosure is precisely the kind of behavior an annotation cannot express.

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

Conciseness5/5

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

Front-loaded purpose sentence, then clearly labeled Use when / Not for / Returns / Errors blocks. Every line carries information; nothing is padding.

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 single-parameter validation tool, the definition covers purpose, routing, tolerance rules, return shape and error behavior. Even though an output schema exists, the inline description of the valid/error dict adds helpful redundancy without bloating.

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?

Only one parameter and schema coverage is 100%, so the schema already documents `content`. The description adds the useful nuance that HA tags inside the string are accepted as opaque values, but does not extend parameter meaning much beyond the schema, warranting the baseline 3.

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 (validate/check) plus resource (YAML syntax for a string) and immediately scopes it as non-writing. It contrasts sharply with siblings like files_write_config_file and system_check_config, so an agent can discriminate 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' clause names the exact downstream tools it precedes (files_write_config_file, automations_set_automation_config), and the 'Not for' clause routes full HA schema validation to system_check_config. When and when-not are both spelled out.

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