Skip to main content
Glama
Home Assistant MCP Server

Home Assistant MCP Server

Official

Manage Frontend Themes

ha_manage_theme
DestructiveIdempotent

List installed Home Assistant themes, set the backend default theme per light or dark mode, and inspect or restore the screenshot engine account's per-user theme.

Instructions

Manage Home Assistant frontend themes.

When NOT to use: themes are YAML files - Home Assistant has no API to create or edit them. Installing community themes goes through HACS (the Marketplace on 2026.11+, both via ha_manage_hacs); editing custom theme files goes through ha_config_set_yaml (beta, edits themes/.yaml keyed by theme name and attempts an automatic theme reload).

When to use: action='list' discovers installed theme names and the current defaults; action='set' selects the backend default theme (optionally per light/dark mode).

SCREENSHOT-ENGINE ACTIONS (per-user, not the backend default): Taking a dashboard screenshot makes the Puppet engine write the saved theme of the Home Assistant user its token belongs to, which also flips that user's live web and mobile sessions. The screenshot tools are read-only and only report this; use action='set_engine_theme' with the value quoted in their warning to put it back, and action='get_engine_theme' to inspect it. These act on that engine account's per-user profile via frontend/set_user_data, which is a different layer from the backend default that action='set' changes. Giving the engine its own dedicated user and token avoids the issue entirely.

Caveats: action='set' changes the backend-selected default only - users who explicitly picked a theme in their profile keep their choice. Theme names are validated by Home Assistant at call time.

EXAMPLES:

  • List themes: ha_manage_theme(action="list")

  • Set default theme: ha_manage_theme(action="set", theme_name="nord")

  • Set dark-mode theme: ha_manage_theme( action="set", theme_name="nord", mode="dark")

  • Restore built-in default: ha_manage_theme( action="set", theme_name="default")

  • Inspect the engine account's theme: ha_manage_theme( action="get_engine_theme")

  • Undo a screenshot's theme change (pass BOTH values from the warning, so a theme changed since then is not overwritten): ha_manage_theme(action="set_engine_theme", value={"theme": "", "dark": False}, expected_current={"theme": "default", "dark": True})

If a Claude Desktop user gets a 4-minute timeout with no result on this call, read the target back before repeating it, and tell them to wait a few seconds before clicking the manual-approve button, as clicking it too quickly is known to cause hangs in Claude Desktop. This workaround is specific to Claude Desktop.

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": {
      "action": "<action>"
    },
    "name": "ha_manage_theme"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoWhich mode the theme applies to when action='set'. Defaults to light.
forceNoaction='set_engine_theme' only: skip the expected_current guard and overwrite unconditionally.
valueNoFrontend user-data theme object when action='set_engine_theme', e.g. {'theme': '', 'dark': False}. An empty dict restores default/auto behavior.
actionYesTheme operation: 'list' installed themes, 'set' the backend default theme, or read/restore the screenshot engine account's own per-user theme with 'get_engine_theme' / 'set_engine_theme'.
theme_nameNoTheme name when action='set'. Must be an installed theme; 'default' restores the built-in theme, 'none' resets the chosen mode to the built-in default.
expected_currentNoGuard for action='set_engine_theme': the stored theme is read immediately before the write and the write is skipped if it no longer equals this. Omitting this value or passing null both mean 'expect no stored theme', enforced like any other value; the guard is always applied unless force is set. Best-effort, not atomic: a change landing between that read and the write is not caught.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv8.6.0
    • changedInput schema / properties / action / description
      Previous value: -"Theme operation: 'list' installed themes, 'set' the backend default theme, or read/restore the screenshot engine account's own per-user theme with 'get_engine_theme' / 'set_engine_theme' (a different layer from the backend default)."New value: +"Theme operation: 'list' installed themes, 'set' the backend default theme, or read/restore the screenshot engine account's own per-user theme with 'get_engine_theme' / 'set_engine_theme'."
    • changedInput schema / properties / expected_current / description
      Previous value: -"Guard for action='set_engine_theme': the stored theme is read immediately before the write and the write is skipped if it no longer equals this. Omitting this value or passing null both mean 'expect no stored theme', enforced like any other value; the guard is always applied unless force is set. Best-effort, not atomic -- Home Assistant exposes no conditional write, so a change landing between that read and the write is not caught. Pass the expected_current value quoted in the screenshot tool's warning."New value: +"Guard for action='set_engine_theme': the stored theme is read immediately before the write and the write is skipped if it no longer equals this. Omitting this value or passing null both mean 'expect no stored theme', enforced like any other value; the guard is always applied unless force is set. Best-effort, not atomic: a change landing between that read and the write is not caught."
    • changedInput schema / properties / force / description
      Previous value: -"action='set_engine_theme' only: skip the expected_current guard and overwrite unconditionally. Leave false unless you intend to discard whatever is stored."New value: +"action='set_engine_theme' only: skip the expected_current guard and overwrite unconditionally."
    • changedInput schema / properties / value / description
      Previous value: -"Frontend user-data theme object when action='set_engine_theme', e.g. {'theme': '', 'dark': False}. An empty dict restores default/auto behavior. Take this verbatim from the warning a screenshot tool emitted."New value: +"Frontend user-data theme object when action='set_engine_theme', e.g. {'theme': '', 'dark': False}. An empty dict restores default/auto behavior."
  2. Changed5 schema fields changedv8.4.1
    • changedInput schema / properties / action / description
      Previous value: -"Theme operation: list installed themes or set the default theme."New value: +"Theme operation: 'list' installed themes, 'set' the backend default theme, or read/restore the screenshot engine account's own per-user theme with 'get_engine_theme' / 'set_engine_theme' (a different layer from the backend default)."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "list",
      -  "set"
      -]New value: +[
      +  "list",
      +  "set",
      +  "get_engine_theme",
      +  "set_engine_theme"
      +]
    • addedInput schema / properties / expected_current
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Guard for action='set_engine_theme': the stored theme is read immediately before the write and the write is skipped if it no longer equals this. Omitting this value or passing null both mean 'expect no stored theme', enforced like any other value; the guard is always applied unless force is set. Best-effort, not atomic -- Home Assistant exposes no conditional write, so a change landing between that read and the write is not caught. Pass the expected_current value quoted in the screenshot tool's warning."
      +}
    • addedInput schema / properties / force
      Added value: +{
      +  "default": false,
      +  "description": "action='set_engine_theme' only: skip the expected_current guard and overwrite unconditionally. Leave false unless you intend to discard whatever is stored.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / value
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Frontend user-data theme object when action='set_engine_theme', e.g. {'theme': '', 'dark': False}. An empty dict restores default/auto behavior. Take this verbatim from the warning a screenshot tool emitted."
      +}
  3. First observedv7.14.2

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=true, and the description adds real context beyond them: action='set' only changes the backend default so users with explicit profile choices are unaffected, theme names are validated server-side at call time, and the screenshot engine's token-owned user theme gets flipped as a side effect of screenshots. It also discloses the expected_current guard's non-atomic, best-effort nature and an operational timeout/hang workaround, none of which is derivable from annotations.

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?

The text is front-loaded with purpose, then when-not/when-to, then the specialized screenshot-engine layer, caveats, and examples, so an agent can stop reading early once it has what it needs. It is on the long side and repeats the expected_current guard behavior already spelled out in the schema, and the trailing Claude Desktop timeout paragraph is operationally useful but stylistically tacked on.

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 6-parameter, four-action tool with destructive side effects, the description covers the alternative tools, the two distinct theme layers (backend default vs per-user engine profile), the guard semantics, and usage examples. An output schema exists, so return values need not be described, and nothing an agent needs to call this correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and each parameter already has a detailed description, so the baseline is 3. The description adds cross-parameter workflow semantics the schema cannot convey on its own — e.g. passing BOTH the value and expected_current from a screenshot warning so a subsequently changed theme is not clobbered — plus worked examples for each action/mode combination.

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 states a specific verb and resource ('Manage Home Assistant frontend themes') and then enumerates the four concrete operations (list, set, get_engine_theme, set_engine_theme), which lets an agent distinguish this tool from siblings without opening the schema. It also explicitly disambiguates from ha_manage_hacs and ha_config_set_yaml for the theme-file workflows this tool cannot do.

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?

There is an explicit 'When NOT to use' block naming the correct alternative tools (ha_manage_hacs for installing, ha_config_set_yaml for editing), and a 'When to use' block mapping each action to its purpose. The screenshot-engine section further explains when to reach for get_engine_theme/set_engine_theme versus the backend default action='set'.

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