Skip to main content
Glama

Read a config file

files_read_config_file
Read-onlyIdempotent

Read a Home Assistant config file's raw UTF-8 text before editing, resolving relative paths inside the config directory while blocking secrets.yaml, .storage, and disallowed extensions.

Instructions

Read one config file's raw text from the HA config directory.

Resolves relative_path under HA_CONFIG_PATH via _safe_path (blocking paths outside the directory, disallowed extensions, and secrets.yaml/ .storage) and returns its content as a UTF-8 string; nothing is parsed or validated.

Use when: reading the current text of a YAML/JSON/txt file before editing it. Not for: checking whether that text is valid YAML — pass it to files_validate_yaml_content; discovering which files exist first — use files_list_config_files. Returns: str, the file's raw text (UTF-8). Errors: raises FileNotFoundError when the file does not exist, and raises PermissionError (from _safe_path) when relative_path resolves outside the config directory, uses a disallowed extension, or targets secrets.yaml/.storage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relative_pathYesPath to the file relative to the HA config directory (HA_CONFIG_PATH), e.g. 'automations.yaml' or 'packages/lights.yaml'. Must resolve inside that directory, use an allowed extension (.yaml/.yml/.json/.txt), and not touch secrets.yaml or .storage/.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / relative_path / description
      Added value: +"Path to the file relative to the HA config directory (HA_CONFIG_PATH), e.g. 'automations.yaml' or 'packages/lights.yaml'. Must resolve inside that directory, use an allowed extension (.yaml/.yml/.json/.txt), and not touch secrets.yaml or .storage/."
  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 cover the safety profile (readOnly, idempotent, non-destructive, closed-world), yet the description adds substantive behavior beyond them: path resolution via _safe_path, blocking of out-of-directory paths, disallowed extensions, secrets.yaml/.storage, unparsed raw UTF-8 return, and the two specific exception types raised. This is well past 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.

Conciseness5/5

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

Front-loaded with the core purpose, then cleanly sectioned into Use when / Not for / Returns / Errors. Every sentence carries distinct information; nothing is redundant 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?

Despite an output schema existing, the description complements it with error semantics and the no-parsing guarantee. For a one-parameter read tool with annotations already covering safety, nothing an agent needs to 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?

Schema description coverage is 100% and the single parameter's description already covers relative-path semantics, allowed extensions, and the secrets/.storage restriction. The description largely restates those constraints rather than adding syntax or format detail, so the 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 ('Read one config file's raw text from the HA config directory') and explicitly distinguishes itself from siblings by naming files_validate_yaml_content and files_list_config_files. An agent can select it without opening any other 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?

Provides explicit 'Use when' (reading current text of a YAML/JSON/txt before editing) and 'Not for' with concrete alternatives for validation and discovery. The routing conditions are stated rather than inferred.

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