themes_list_theme_files
List YAML theme files on disk to find themes that exist but are not yet loaded into Home Assistant.
Instructions
List YAML files under themes/. Useful when a theme exists on disk but isn't loaded yet.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/themes.py:137-146 (handler)The tool handler function 'list_theme_files' is decorated with @mcp.tool() and lists YAML files under the themes/ directory on disk. It returns relative paths to files matching .yaml or .yml extensions.
@mcp.tool() def list_theme_files() -> list[str]: """List YAML files under `themes/`. Useful when a theme exists on disk but isn't loaded yet.""" if not _THEMES_DIR.exists(): return [] return [ str(p.relative_to(_CONFIG_PATH)) for p in _THEMES_DIR.rglob("*") if p.is_file() and p.suffix in {".yaml", ".yml"} ] - server.py:57-57 (registration)The themes MCP server is mounted under the 'themes' namespace, meaning the tool is accessible as 'themes_list_theme_files' via the MCP protocol.
mcp.mount(themes_mcp, namespace="themes") - server.py:30-30 (registration)The themes_mcp FastMCP instance is imported from tools.themes, which contains the @mcp.tool() registered functions.
from tools.themes import mcp as themes_mcp