MCP ScannerCustom audit
All servers

homeassistant-ai/ha-mcp

Configure and automate Home Assistant with Claude, ChatGPT, and other AI assistants.

Packageha-mcp
Version9.2.0 in pyproject.toml
Publisherhomeassistant-ai community
MCP Registryio.github.homeassistant-ai/ha-mcp
Scanned2026-11-25
Scannerv1.3.0
Methodologyv1.2
Stars 7,867Forks 479Last push 2026-11-15
Python 98.0%JavaScript 1.9%TypeScript 0.1%by source files the scanner reads
Code safetypartly tracedExposure6.1Prompts10.0Supply chain7.0Secrets10.0Transparency10.0
Analysis confidence80%
How much of the server the scanner could read: tools analyzed, files parsed, limits hit.
Code Safetypartly traced—

Paths from tool input into commands, SQL, files and URLs

Capability Exposure6.1/10Fair

How much power the tools give an agent over the machine

Prompt Integritynothing published yet10.0/10

Hidden instructions and poisoning in text for the model

Supply Chain7.0/10Fair

Known vulnerabilities in the packages the server uses

Secrets & Credentialsnothing published yet10.0/10

How the server reads credentials and where they can go

Behavior Transparencynothing published yet10.0/10

Whether the tools do only what their descriptions say

How far the analysis went

The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.

  • Some paths pass through more than 8 functions one inside another; the scanner stops there
  • In 3,583 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
  • 57 of 217 tools, prompts and resources could not be followed through the code
  • 4 places in the code register tools whose names are computed at run time; how many tools that makes cannot be read from the code
  • 84 tools, prompts and resources registered only in the repository's tests are not counted on this page

Top risks in plain words

  • MEDIUM4 security advisories have been published for this server itself (worst: medium).

How to use it safely

Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.

  • Give it a narrowly scoped token

    Its code reads credentials or environment variables. Use a key limited to what this server needs, not your main one.

  • Use a fixed version

    Versions before ha-mcp 7.5.0 have a published vulnerability that is fixed in 7.5.0.

  • Keep confirmations on

    Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.

What its tools can do on your machine

The server offers 110 tools, 13 resources, 10 prompts. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.

Read or write filesopen, create, change or delete files
ha_bulk_control, ha_call_event, ha_call_service, ha_config_delete_dashboard, ha_config_delete_dashboard_resource, ha_config_get_automation and 80 more
86 of 133
Connect to the internet or other hostssend requests or open connections
ha_bulk_control, ha_call_event, ha_call_service, ha_config_delete_dashboard, ha_config_delete_dashboard_resource, ha_config_get_automation and 78 more
84 of 133
Read passwords, tokens or keysload secrets such as API keys
ha_bulk_control, ha_call_event, ha_call_service, ha_config_delete_dashboard, ha_config_delete_dashboard_resource, ha_config_get_automation and 80 more
86 of 133
Read environment variablesoften where API keys are kept
ha_bulk_control, ha_call_event, ha_call_service, ha_config_delete_dashboard, ha_config_delete_dashboard_resource, ha_config_get_automation and 80 more
86 of 133
Touch sensitive locationssuch as ~/.ssh, cloud credentials or browser data
ha_bulk_control, ha_call_event, ha_call_service, ha_config_delete_dashboard, ha_config_delete_dashboard_resource, ha_config_get_automation and 80 more
86 of 133

No tool was seen to: start other programs on the machine.

Where its requests and secrets go

Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.

Hosts written in the code

The literal addresses the tools' requests name.

  • None: no request names a fixed host.
Addresses from settings

Constants or settings that start an address; the value comes from configuration.

  • None seen.
Secrets it reads

Credential-like environment variables. Give the server a key with the least access it needs.

  • SUPERVISOR_TOKEN · ha_bulk_control, ha_call_event, ha_call_service +81

102 request addresses could not be settled from the code (built at run time).

Text it brings in from outside

Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.

  • files86 tools · ha_bulk_control, ha_call_event, ha_call_service +83
  • web or API responses83 tools · ha_bulk_control, ha_call_event, ha_call_service +80

Tool annotations

No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.

Tools, prompts and resources (133: 110 tools, 13 resources, 10 prompts)

Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.

(name computed at run time)prompt
No description.
(name computed at run time)prompt
No description.
componentprompt
No description.
first_promptprompt First prompt description.
First prompt description.
fnprompt
No description.
name_or_fnprompt
No description.
promptprompt
No description.
promptprompt
No description.
promptprompt
No description.
promptprompt
No description.
(name computed at run time)resource
No description.
componentresource
No description.
first_resourceresource First resource description.
First resource description.
fnresource
No description.
get_greetingresource Provides a simple greeting message.
Provides a simple greeting message.
htmlresource
No description.
resourceresource
No description.
resourceresource
No description.
resourceresource
No description.
resourceresource
No description.
resourceresource
No description.
resource.resourceresource
No description.
uriresource
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
call_tool_bulktool Call a single tool registered on this MCP server multiple times with a single request.
Call a single tool registered on this MCP server multiple times with a single request.
         Each call can include different arguments. Useful for speeding up what would otherwise
         take several individual tool calls.

        Args:
            tool: The name of the tool to call.
            tool_arguments: A list of dictionaries, where each dictionary contains the arguments for an individual run of the tool.
call_tools_bulktool Call multiple tools registered on this MCP server in a single request. Each call can
Call multiple tools registered on this MCP server in a single request. Each call can
         be for a different tool and can include different arguments. Useful for speeding up
         what would otherwise take several individual tool calls.
componenttool
No description.
echo_tooltool Echo the input text
Echo the input text
first_tooltool First tool description.
First tool description.
fntool
No description.
fntool
No description.
fntool
No description.
fntool
No description.
greetingtool Provides a simple info.
Provides a simple info.
ha_bulk_controltool Manage explicit operations or one deterministic structural bulk action.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage explicit operations or one deterministic structural bulk action.

        When NOT to use: use ``ha_call_service`` for service-specific payloads or
        backend-native group targeting, and ``ha_search`` for fuzzy name discovery.

        **Operations mode** (``operations``, no ``selector``): put every target in
        this one call. Parallel execution is the default, and invalid items are
        reported without aborting valid operations in the same batch — but a batch
        in which every item fails validation dispatches nothing and fails the call.
        A batch that targets a group/aggregate entity together with one or more of
        its own individual members also fails closed (nothing dispatched): Home
        Assistant applies the action to every member when the group is targeted
        regardless of what else is listed, so a member row cannot exclude that
        member from the group's own action. Use selector mode with
        ``exclude_entity_ids`` when a group action must exclude specific members.

        **Selector mode** (``selector`` + ``action``): use exact area or floor IDs
        when exclusions must be applied after recursively expanding generic
        aggregate membership. Resolves a frozen visible leaf set before dispatch;
        it is not transactional, so Home Assistant may still report per-leaf
        failures. A selector resolving to more than 100 entities fails closed
        instead of dispatching a partial/oversized batch — narrow it (a more
        specific area/floor, or add ``exclude_entity_ids``) and retry. Set
        ``dry_run`` to preview the resolved set without changing state.
ha_call_eventtool Execute a custom event on the Home Assistant event bus.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Execute a custom event on the Home Assistant event bus.

        When NOT to use: for controlling entities (lights, switches, climate) — use
        ha_call_service instead. To run an automation now, use
        ha_config_set_automation(entity_id=..., run_actions=True).

        Use this to publish custom event types consumed by event-triggered automations,
        Node-RED flows, or custom integrations that subscribe to specific event types.

        Caveats: Events are fire-and-forget; a successful dispatch reports the
        bus accepted the event and how many listeners were registered for it,
        not that any of them acted. A timeout means dispatch is unconfirmed.
        listener_count covers the exact event type; wildcard_listener_count
        covers match-all listeners (the recorder is one, and it only stores the
        event). The counts come from the component's dispatch reply when it
        serves the fire, otherwise from a GET /api/events lookup taken before
        dispatch; a route that cannot report them omits both fields.

        The response carries the event's context_id (and context) when Home
        Assistant reports it. An automation triggered by this event records that
        id as the parent_id of its run's context, so looking up that automation
        trace proves whether a listener acted — which the counts cannot show,
        because an event trigger that filters on event_data still registers as a
        listener when the payload does not match.

        Events fire in-process through the ha_mcp_tools component when it is
        installed, otherwise over Home Assistant's own WebSocket fire_event
        command; both carry the event type in the message body, so any type Core
        accepts fires as written and Core's rejection comes back as the error
        text (for example its 64-character event-type limit). state_changed
        alone keeps the REST route, because only that route rebuilds its
        old_state/new_state payloads into State objects; there event_type must
        be a plain name with no / \\ ? # or % characters.
ha_call_servicetool Call any Home Assistant service or one-shot WebSocket command: the catch-all escape hatch.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Call any Home Assistant service or one-shot WebSocket command: the catch-all escape hatch.

        When NOT to use: a dedicated tool that covers the job. It validates the
        request, reports the outcome in its own terms, and stays available where
        a security policy gates this tool. For example: turn an automation on or
        off or run it now with ha_config_set_automation (enabled / run_actions);
        start or stop a script with ha_config_set_script (run); activate a scene
        with ha_config_set_scene (activate); manage apps (add-ons) with
        ha_manage_app; handle updates and Repairs issues with ha_manage_updates;
        set an integration's log level with ha_set_integration (log_level).

        When to use: a service no dedicated tool covers. Services follow the
        pattern domain.service (e.g., light.turn_on, climate.set_temperature);
        ha_list_services lists them with their fields.

        EXAMPLES:
        - ha_call_service("light", "turn_on", entity_id="light.living_room")
        - ha_call_service("climate", "set_temperature", entity_id="climate.thermostat", data={"temperature": 22})

        Result compaction (default ON): ``result`` is trimmed to the targeted
        entity's record (drops parent-group propagation) and stripped of
        ``context`` / ``last_*`` metadata and heavy attribute lists
        (``effect_list``, ``hue_scenes``).

        For detailed service documentation, use ha_get_skill_guide.

        **WebSocket command escape hatch (advanced):**
        Some Home Assistant operations are WebSocket-only commands, not
        registered services. Pass ``ws_command`` (instead of domain/service) to
        send one no dedicated tool covers, with its parameters in ``data``:
        ha_call_service(ws_command="<command type>", data={...}). Only one-shot
        request/response commands are supported, and the other service
        parameters (entity_id, return_response, etc.) don't apply.

        Unavailable in Read Only Mode, including read-like services and WebSocket
        commands. Use dedicated read tools while that mode is enabled.
ha_config_delete_dashboardtool Delete a storage-mode dashboard completely.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a storage-mode dashboard completely.

        WARNING: This deletes the dashboard and all its configuration; with auto-backup
        on, ha_manage_backup(scope='edits', action='restore') re-creates it. YAML-mode
        dashboards are defined in configuration.yaml and cannot be deleted via the API.

        HA internal IDs may differ from url_path (e.g. hyphens → underscores); the tool resolves
        either form to the actual registry ID before deletion. 'default' is an
        alias for 'lovelace'.

        EXAMPLES:
        - Delete dashboard: ha_config_delete_dashboard("mobile-dashboard")
ha_config_delete_dashboard_resourcetool Delete a dashboard resource.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a dashboard resource.

        Removes a resource from Home Assistant. The resource will no longer
        be loaded on dashboards.

        WARNING: Deleting a resource used by custom cards in your dashboards
        will cause those cards to fail to load.

        EXAMPLES:
        ha_config_delete_dashboard_resource(resource_id="abc123")

        Note: Use ha_config_list_dashboard_resources() to find resource IDs
        before deleting. Ensure no dashboards depend on the resource.
ha_config_get_automationtool Get a Home Assistant automation's stored configuration.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get a Home Assistant automation's stored configuration.

        `config` is the body Home Assistant stores, as it stores it; its
        `config_hash` stays the same across reads of an unchanged automation.
        `entity` is the automation's entity registry row, `validation` holds
        Home Assistant's status and error when the automation failed to load
        (None when it loaded), and `references` lists the entities, devices,
        areas, floors, labels and blueprint it uses. `references` is None
        without the ha_mcp_tools component's automation_config bridge and
        while Home Assistant has not loaded the automation (disabled, or it
        failed to load); `warnings` says which. Without the bridge, `related`
        holds Home Assistant's Related set for the automation instead, keyed
        by item type: what it uses plus their devices, areas, floors and
        integrations. `automation_id` is the resolved entity_id, falling back
        to the input.

        EXAMPLES:
        - Get automation: ha_config_get_automation("automation.morning_routine")
        - Get by config id: ha_config_get_automation("1712345678901")

        For comprehensive automation documentation, use ha_get_skill_guide.
ha_config_get_calendar_eventstool Get calendar events from a calendar entity within a time range.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get calendar events from a calendar entity within a time range.

        Returns each event's summary, start, end, description and location,
        plus the uid, recurrence_id and rrule when the calendar provides them
        (the edit and remove tools use uid and recurrence_id). To find calendar
        entities, use ha_search(domain_filter='calendar').

        EXAMPLES:
        - Next week (defaults): ha_config_get_calendar_events("calendar.family")
        - Date range: ha_config_get_calendar_events("calendar.work", start="2024-01-01T00:00:00", end="2024-01-31T23:59:59")
ha_config_get_categorytool Get category info - list all categories for a scope or get a specific one by ID.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get category info - list all categories for a scope or get a specific one by ID.

        Without a category_id: Lists all Home Assistant categories for the given scope.
        With a category_id: Returns configuration for that specific category.

        Categories are domain-scoped organizational groups for automations, scripts, scenes, and helpers.

        EXAMPLES:
        - List helper categories: ha_config_get_category("helpers")
        - Get specific category: ha_config_get_category("automation", category_id="my_category_id")

        Use ha_config_set_category() to create or update categories.
        Use ha_set_entity(categories={"automation": "category_id"}) to assign categories to entities.
ha_config_get_dashboardtool Get Lovelace dashboards: list them, read one config, or search their cards.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get Lovelace dashboards: list them, read one config, or search their cards.

        Not for a render alone: ha_get_dashboard_screenshot (screenshot beta
        feature) returns images without the config. Not for entity discovery:
        use ha_search.

        The parameters pick the mode:
        - list_only=True: storage and YAML dashboards alike.
        - Any of query / entity_id / card_type / heading searches cards and
          header cards, AND-ing the criteria, in url_path or, when it is
          omitted, every storage dashboard. View badges answer entity_id and
          query, and heading excludes them.
          Cards nested at any depth count, including
          custom cards' own keys such as groups[].cards[].card. Nesting is
          found heuristically, under the keys cards, card, custom_fields and
          states; a card under any other key is read only as its parent's
          text, by query. Each match has a
          jq_path and a python_path to append to `config` in
          ha_config_set_dashboard(python_transform=...), e.g.
          f'config{m["python_path"]}["icon"] = "mdi:x"'. Each match carries its
          dashboard's url_path and config_hash; a one-dashboard search also
          returns the config_hash at the top level.
        - Otherwise the full config of url_path (the default dashboard when
          omitted) is returned; with view_path only that view, while config_hash
          still covers the full config. stored_config is false (config null)
          when Home Assistant holds no config for the dashboard.

        Caveats: config_hash stays the same across reads of an unchanged config.
        Searches stop at 200 matches (`truncated`). A search across dashboards
        skips YAML dashboards (HA resolves !secret in them) and, without a
        current ha_mcp_tools component, the default dashboard (with a warning);
        name either by url_path.
        Strategy dashboards have no stored cards to search. An unknown view_path
        errors and lists the available ones.

        EXAMPLES:
        - List all dashboards: ha_config_get_dashboard(list_only=True)
        - Get one view only: ha_config_get_dashboard(url_path="lovelace-mobile", view_path="office")
        - Find cards by entity (wildcards allowed): ha_config_get_dashboard(url_path="my-dash", entity_id="sensor.temperature_*")
        - Find heading: ha_config_get_dashboard(url_path="my-dash", heading="Climate", card_type="heading")
        - Which dashboards use an entity: ha_config_get_dashboard(query="light.bedroom")
        - Fields of a card type before writing one (omit card_type to list types):
          ha_config_get_dashboard(card_type="tile", describe=True)
ha_config_get_labeltool Get label info - list all labels or get a specific one by ID.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get label info - list all labels or get a specific one by ID.

        Without a label_id: Lists all Home Assistant labels with their configurations.
        With a label_id: Returns that label and, as `related`, Home Assistant's
        Related set for it: the areas, devices and entities that carry it (an
        automation, script, scene, group or person that carries it is also listed
        under its own key), the automations and scripts that target it, and the
        areas, floors, devices, config entries and integrations of the carrying
        items. A template that uses the label (for example `label_entities('x')`)
        is not listed. `related` is None, with a warning, when Home Assistant
        cannot answer; that does not mean the label is unused.

        EXAMPLES:
        - List all labels: ha_config_get_label()
        - Get specific label: ha_config_get_label("my_label_id")

        Use ha_config_set_label() to create or update labels.
        Use ha_set_entity(labels=["label1", "label2"]) to assign labels to entities,
        ha_set_device(labels=[...]) for devices, or
        ha_set_area_or_floor(kind="area", labels=[...]) for areas.
ha_config_get_scenetool Get a scene's complete configuration, or list and search scenes without scene_id.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get a scene's complete configuration, or list and search scenes without scene_id.

        Use ha_search for cross-domain discovery and dependency searches. For ordinary
        scene discovery, use this tool and pass a returned scene_id back to retrieve
        the complete entities dict and config_hash for editing (pass that hash to
        ha_config_set_scene for python_transform updates).

        Listing returns compact metadata. Integration-managed scenes have no editable
        storage config or scene_id. Partial content-search results explicitly
        report unread configs and are not exhaustive.

        EXAMPLES:
        - Get scene: ha_config_get_scene("movie_night")
        - Find scenes: ha_config_get_scene(query="movie")
        - Find attribute values: ha_config_get_scene(query="rainbow", search_in_config=True)

        For detailed scene configuration help, use ha_get_skill_guide.
ha_config_get_scripttool Get Home Assistant script configuration.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get Home Assistant script configuration.

        Returns the complete configuration for a script, including sequence, mode, fields, and other settings.

        The returned `config_hash` stays the same across consecutive reads of an unchanged config.

        The returned `script_id` is the canonical bare storage key resolved by the REST client (matching what `ha_config_set_script` / `ha_config_remove_script` expect), falling back to the input identifier on the rare path where the REST envelope omits it. A bare id names the script stored under that key first; `script.<x>` names that entity's script, or the script stored under key `<x>` when no entity has that id.

        EXAMPLES:
        - Get script (bare form): ha_config_get_script("morning_routine")
        - Get script (entity_id form): ha_config_get_script("script.morning_routine")

        For detailed script configuration help, use ha_get_skill_guide.
ha_config_get_yamltool Get the current YAML fragment under a key, from one config file or across a glob.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get the current YAML fragment under a key, from one config file or across a glob.

        Use before ha_config_set_yaml to inspect what a key currently holds, and
        to find which file defines it — when ha_config_set_yaml accepts this
        ``yaml_path`` for the returned ``file``, the two are exactly the
        arguments that address the same fragment for an edit. To change a value
        nested below such a key, read the whole key and replace it.

        Not for storage-mode items: automations, scripts and scenes created
        through the UI live outside YAML — read those with ha_config_get_automation,
        ha_config_get_script and ha_config_get_scene. This tool sees only what is
        written in the config files themselves.

        Reads the file, so it reflects what is on disk rather than what Home
        Assistant currently has loaded; a fragment edited but not yet reloaded
        differs from the running config. Comments and HA tags survive as written
        and a ``!secret`` is never resolved to its value, so ``content`` can be
        handed back to ha_config_set_yaml unchanged. Files outside the read
        allowlist stay unreadable, and secrets.yaml reads back with its values
        masked.
ha_config_list_dashboard_resourcestool List Lovelace dashboard resources (custom cards, themes, CSS/JS).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
List Lovelace dashboard resources (custom cards, themes, CSS/JS).

        Returns one page of registered resources; `total_count` and `has_more`
        report the full set, and `inline_count` and `by_type` summarise every
        resource, not just this page. Each resource has a unique ID for
        update/delete operations. For inline resources (created with
        ha_config_set_dashboard_resource(content=...)), shows a preview of the
        content instead of the full encoded URL to save tokens.
        `resource_mode` is Core's lovelace resource mode; in 'yaml' mode
        resources cannot be created, updated or deleted through the API.

        EXAMPLES:
        - Next page: ha_config_list_dashboard_resources(offset=100)
        - List with full content: ha_config_list_dashboard_resources(include_content=True)
        - Verify an edit by hash: ha_config_list_dashboard_resources(include_hash=True)

        Home Assistant exposes resource management in the UI by default;
        API access works regardless of UI availability.
ha_config_list_groupstool List Home Assistant entity groups with their member entities.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
List Home Assistant entity groups with their member entities.

        Returns one page of old-style groups created via the group.set service
        or YAML configuration (platform-specific groups such as light or cover
        groups are separate entities); `total_count` and `has_more` report the
        full set. Each group carries Core's state fields and attributes, its
        members as `entity_ids`, and its object_id. `auto` is true for a group
        created by ha_config_set_group (group.set) and false for a YAML group.
        Core does not expose a group's all/any mode.
        Without the ha_mcp_tools component, `last_reported` comes from Core's
        REST API, can lag the live time, and the reply says so.

        EXAMPLE: ha_config_list_groups(offset=100)
ha_config_list_helperstool List Home Assistant helpers of a specific type with their configurations.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
List Home Assistant helpers of a specific type with their configurations.

        Returns one page of helpers; `total_count` and `has_more` report the full
        set. Each record carries the configuration for its helper:
        id (immutable storage key), entity_id (current — address the helper by
        this, where available), name (current display name), original_name
        (creation-time name), icon, type-specific settings, and area and label
        assignments. A flow helper record carries entry_id and options instead of
        id; a custom helper integration's options are withheld, marked
        `options_withheld`.

        For a helper renamed in the UI, id/original_name keep the storage values while
        entity_id/name reflect the current entity registry (entity_id is the identifier
        ha_config_set_helper resolves against, so prefer it over id for a renamed helper).
        entity_id/original_name are present only for storage-collection helpers matched in
        the entity registry — types with no backing entity (e.g. tag), and every record when
        the registry read degrades, carry only id/name (a warning flags the degraded case).

        Storage types list what HA's ``{type}/list`` command returns: the
        storage-backed helpers (created via UI/API), not the YAML-defined ones.
        ``person`` is the exception — HA lists its YAML-configured persons
        alongside the storage ones, so both appear here.

        Listing flow types requires the ha_mcp_tools custom component (>= 1.1.0);
        without it, such a listing returns a COMPONENT_NOT_INSTALLED error.

        With helper_type="all", each record carries its own ``helper_type``.
        This mode is component-only (there is no single built-in command that
        lists all types): without the ha_mcp_tools component it returns a
        COMPONENT_NOT_INSTALLED error rather than a partial or empty list.

        describe=True returns each field's name, type, required flag, options,
        default and (with helper_id) current value, the later_forms of a
        helper with several forms, or the menu_options a menu-based helper
        needs a menu_choice from. Call it before ha_config_set_helper.

        EXAMPLES:
        - List all counters: ha_config_list_helpers("counter")
        - List every helper type at once: ha_config_list_helpers("all")
        - Next page: ha_config_list_helpers("input_boolean", offset=100)
        - Fields for a template sensor:
          ha_config_list_helpers("template", describe=True, menu_choice="sensor")

        For detailed helper documentation, use ha_get_skill_guide.
ha_config_remove_automationtool Delete a Home Assistant automation permanently.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a Home Assistant automation permanently.

        A disabled automation is removed too. The returned `automation_id` is
        the resolved entity_id, falling back to the input.

        EXAMPLES:
        - Delete automation: ha_config_remove_automation("automation.old_automation")
        - Delete by config id: ha_config_remove_automation("1712345678901")
ha_config_remove_calendar_eventtool Delete an event from a calendar.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete an event from a calendar.

        Get the event UID from ha_config_get_calendar_events().

        EXAMPLES:
        - Delete a single event: ha_config_remove_calendar_event("calendar.family", uid="event-12345")
        - Delete one occurrence and all later ones: ha_config_remove_calendar_event("calendar.work", uid="recurring-event-67890", recurrence_id="20240115T100000", recurrence_range="THISANDFUTURE")
ha_config_remove_categorytool Delete a Home Assistant category.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a Home Assistant category.

        Removes the category from the category registry for the given scope, and
        from every entity in that scope that had it. The auto-backup of this call
        restores the category itself, under a new id, not the entities that had it.

        To move one entity to another category or out of its category and keep the
        category, use ha_set_entity(categories=...) instead.

        EXAMPLES:
        - Delete category: ha_config_remove_category("automation", "my_category_id")

        Use ha_config_get_category() to find category IDs.
ha_config_remove_grouptool Remove a service-based Home Assistant entity group via the group.remove service.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove a service-based Home Assistant entity group via the group.remove service.

        **When NOT to use:** for groups created through `ha_config_set_helper(helper_type="group", ...)`,
        use `ha_remove_helpers_integrations`. Those config-entry-backed groups are not reachable via the
        group.remove service.

        **When to use:** removing groups created with `ha_config_set_group` or defined in YAML
        via `group:` configuration. Config-entry-backed deletion tools cannot find these.

        EXAMPLES:
        - Remove group: ha_config_remove_group("living_room_lights")

        Use ha_config_list_groups() to find existing groups.

        **WARNING:**
        - Removing a group used in automations may cause those automations to fail.
        - Groups defined in YAML can be removed at runtime but come back on group.reload
          or a restart.
        - This only removes old-style groups, not platform-specific groups.
ha_config_remove_labeltool Delete a Home Assistant label.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a Home Assistant label.

        Removes the label from the label registry. Home Assistant also takes it off
        every entity, device and area that carries it. Automations and scripts that
        target the label keep the reference, which then matches nothing.

        To take a label off one item and keep it, use ha_set_entity,
        ha_set_device or ha_set_area_or_floor instead. Before deleting, call
        ha_config_get_label(label_id): its `related` lists what carries or
        targets the label, but not a template that uses it, so an empty `related`
        does not prove the label unused. The auto-backup of this call restores
        the label itself, under the id its current name gives it (a new one if
        it was renamed since it was created), not what carried it.

        EXAMPLES:
        - Delete label: ha_config_remove_label("my_label_id")

        Use ha_config_get_label() to find label IDs.
ha_config_remove_scenetool Delete a Home Assistant scene.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a Home Assistant scene.

        EXAMPLE: ha_config_remove_scene("old_scene")

        Deletes a scene from Home Assistant's editable scene storage
        (``scenes.yaml`` entries with an ``id``, as the UI and
        ha_config_set_scene write them) or one made by ``scene.create``
        (through Core's ``scene.delete``); a scene defined elsewhere in YAML or
        by an integration is CONFIG_NOT_FOUND.

        The scene is deleted even when automations or scripts reference it;
        the ones Home Assistant's related search finds are listed in
        ``referenced_by``, with a warning.
ha_config_remove_scripttool Delete a Home Assistant script.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a Home Assistant script.

        EXAMPLE: ha_config_remove_script("old_script")

        Only scripts created via the Home Assistant UI can be deleted. Scripts
        defined in YAML configuration files (scripts.yaml or configuration.yaml)
        cannot be deleted through the API and return a 405 Method Not Allowed
        error; edit the configuration file directly instead.

        WARNING: Deleting a script that is used by automations may cause those automations to fail.
ha_config_set_automationtool Create or update a Home Assistant automation.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant automation.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.

        Prefer native triggers/conditions/actions over templates in logic
        positions; templates belong only in `data.*`, notification text,
        `event_data` and `variables`. The best-practice checker reports
        violations under `best_practice_warnings` — fix them before
        re-submitting. `triggers-and-conditions.md`, `automation-actions.md` and
        `template-guidelines.md` ship under `skill_content` by default. Test any unavoidable template
        with ha_eval_template first.

        Consider a dedicated tool first: a state snapshot with no trigger ->
        ha_config_set_scene; a value derived from other entities ->
        ha_config_set_helper(helper_type='template'); a counter / timer /
        schedule / boolean -> ha_config_set_helper.

        MODES (pick one; each can also take `enabled`, which alone with
        `entity_id` turns the automation on or off without touching config):
        - python_transform: surgical edits to an existing automation. Requires
          entity_id and config_hash from ha_config_get_automation(). Operates on
          the stored config exactly as ha_config_get_automation returns it, e.g.
          python_transform="config['triggers'].append({'trigger': 'state', 'entity_id': 'binary_sensor.motion', 'to': 'on'})"
        - config: new automations or full restructures. Regular automations have
          triggers and actions; blueprint automations have use_blueprint
          {path, input}. Home Assistant validates the config, and a rejection
          carries its own error text.
        - take_control_of_blueprint: convert a blueprint-backed automation into a
          standalone one. Takes no config of its own.

        IDENTITY: omit entity_id and config['id'] to create with a generated ID.
        Reusing an entity_id targets the same automation even if the alias
        changes; to rename or replace it, read it first and pass its
        config_hash — a changed alias without that hash is rejected before
        writing. `operation` says whether the write created or updated it.

        EXAMPLES:
        - Create: ha_config_set_automation(config={"alias": "Morning Lights", "triggers": [{"trigger": "time", "at": "07:00:00"}], "actions": [{"action": "light.turn_on", "target": {"area_id": "bedroom"}}]})
        - From a blueprint: ha_config_set_automation(config={"alias": "Motion Light Kitchen", "use_blueprint": {"path": "homeassistant/motion_light.yaml", "input": {"motion_entity": "binary_sensor.kitchen_motion", "light_target": {"entity_id": "light.kitchen"}}}})
        - Update: current = ha_config_get_automation(entity_id="automation.x"); ha_config_set_automation(entity_id="automation.x", config_hash=current["config_hash"], config={...})
        - Disable: ha_config_set_automation(entity_id="automation.x", enabled=False)
        - Run now: ha_config_set_automation(entity_id="automation.x", run_actions=True)
        - Take control: ha_config_set_automation(entity_id="automation.x", take_control_of_blueprint=True)

        TAKE CONTROL is one-way: later blueprint edits stop reaching the
        automation; to change an input value, update 'use_blueprint.input'
        instead. It does NOT free the blueprint — Home Assistant keeps counting
        the converted automation as a user, so deleting that blueprint stays
        refused until the automation is removed (an automation reload does not
        clear it). The response names the blueprint in
        `took_control_of_blueprint`. To preview the rendering without writing
        anything, use ha_manage_blueprints(action="substitute", path=..., input=...).
ha_config_set_calendar_eventtool Create a new event in a calendar, or update an existing one.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create a new event in a calendar, or update an existing one.

        Passing ``uid`` switches to update mode.

        **When NOT to use:**
        - To retrieve calendar events, use ``ha_config_get_calendar_events``.
        - To delete an event, use ``ha_config_remove_calendar_event``.
        - To find the ``uid`` of an event to update, use
          ``ha_config_get_calendar_events``; this tool does not search.

        Passing date-only values (``YYYY-MM-DD``) for both ``start`` and
        ``end`` creates an all-day event; passing full ISO datetimes creates
        a timed event. Home Assistant refuses a mix of the two.

        An update replaces the whole event rather than patching it, so
        ``summary``, ``start`` and ``end`` stay required in update mode, and a
        ``description`` or ``location`` that is not re-supplied is cleared.
        An ``rrule`` is the exception: Home Assistant accepts a new rule but
        has no way to express "no recurrence", so an existing rule survives an
        update that omits it. Delete the event and create it again to drop the
        recurrence.

        Which writes a calendar accepts depends on its integration; Home
        Assistant refuses a create or update the calendar does not support,
        and its error says so.

        EXAMPLES:
        - Create: ha_config_set_calendar_event("calendar.family", summary="Doctor appointment", start="2024-01-15T14:00:00", end="2024-01-15T15:00:00")
        - Recurring (every Monday, 10 occurrences): ha_config_set_calendar_event("calendar.work", summary="Team meeting", start="2024-01-15T10:00:00", end="2024-01-15T11:00:00", rrule="FREQ=WEEKLY;BYDAY=MO;COUNT=10")
        - Update this and all later occurrences: ha_config_set_calendar_event("calendar.work", summary="Team meeting (new time)", start="2024-02-05T11:00:00", end="2024-02-05T12:00:00", uid="recurring-event-67890", recurrence_id="20240205T100000", recurrence_range="THISANDFUTURE")
ha_config_set_categorytool Create or update a Home Assistant category.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant category.

        Creates a new category if category_id is not provided, or updates an existing category if category_id is provided.

        Categories are domain-scoped organizational groups for automations, scripts,
        scenes, and helpers. Unlike labels (which are cross-domain), categories are
        specific to a single domain scope.

        EXAMPLES:
        - Create automation category: ha_config_set_category(scope="automation", name="Lighting")
        - Create with icon: ha_config_set_category(scope="automation", name="Security", icon="mdi:shield")
        - Update category: ha_config_set_category(scope="automation", category_id="my_category_id", name="Updated Name")

        After creating a category, use ha_set_entity(categories={"automation": "category_id"}) to assign it.
ha_config_set_dashboardtool Create or update a Home Assistant dashboard.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant dashboard.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.
        `dashboard-guide.md` ships under `skill_content` by default. A card's
        fields: ha_config_get_dashboard(card_type=..., describe=True).

        MODES (pick one):
        - patch: edit known paths with literal values using JSON Patch
          add/remove/replace/test and config_hash, e.g.
          patch=[{"op": "replace", "path": "/views/0/title", "value": "Home"}].
          move/copy are unsupported. Full guide:
          https://github.com/homeassistant-ai/ha-mcp/blob/master/docs/dashboard-edits.md
        - python_transform: loops or pattern-based changes across cards and views,
          e.g. 'config["views"][0]["cards"].append({"type": "button", "entity": "light.bedroom"})'.
          After delete/add operations indices shift, so chain multiple ops in ONE
          expression where possible; a later call needs a fresh config_hash from
          ha_config_get_dashboard().
        - config: new dashboards only, or a full restructure. Replaces everything.
          Omit it to create a dashboard without initial config.

        Use ha_config_get_dashboard(entity_id=...) to get the path of any card,
        and ha_search / ha_get_overview to find entity IDs — never guess them.
        For visual re-checks after the write, use ha_get_dashboard_screenshot
        (when available) instead of re-sending config.

        title/icon/require_admin/show_in_sidebar can be updated in a
        metadata-only call or alongside a full config replacement; with
        python_transform or patch, update metadata in a separate call (combining
        it with patch is rejected). Strategy dashboards (config
        {"strategy": {...}}) cannot be converted to custom dashboards here; use
        "Take Control" in the Home Assistant UI.

        EXAMPLE:
        ha_config_set_dashboard(url_path="home-dashboard", title="Home Overview",
            config={"views": [{"title": "Home", "type": "sections", "sections": [{"title": "Climate", "cards": [{"type": "tile", "entity": "climate.living_room"}]}]}]})

        This tool manages storage-mode dashboards only. YAML-mode dashboards (a
        .yaml file registered under ``lovelace: dashboards:`` in
        configuration.yaml) and dashboards inlined under ``lovelace:`` are
        edited in their .yaml file; ``ha_config_set_yaml`` can update the
        ``lovelace:`` registration but not the dashboard body.
ha_config_set_dashboard_resourcetool Create or update a dashboard resource (inline code or external URL).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a dashboard resource (inline code or external URL).

        Provide exactly one of:
        - edits: Search/replace edits on an existing inline resource. Any
          failing edit (or a config_hash mismatch) aborts the whole call
          and saves nothing. Prefer this over content= for small changes to a
          large card: only the changed text is sent.
        - content: Inline JavaScript or CSS code (embedded in the resource URL
          as a data: URI — no file storage or external hosting involved).
          Supports 'module' and 'css' types only; URLs are
          deterministic (same content = same URL); up to ~128KB. Content must be
          self-contained: a data: URI has no base URL, so relative imports inside
          a module and relative url() references inside CSS cannot resolve (use
          fully-qualified URLs instead). If Home Assistant is behind a reverse
          proxy that injects a Content-Security-Policy without 'data:' in
          script-src/style-src, the browser blocks these resources: this call
          still succeeds and the card simply never renders. Register the code as
          a file and use url='/local/...' on such a deployment. (HA itself ships
          no CSP.)
        - url: External resource URL — /local/... (/config/www/; Marketplace
          cards: /local/community/...), /hacsfiles/... (the older path
          for the same folder) or https://... (CDN). Supports all types:
          'module', 'js', 'css', 'html'.

        EXAMPLES:
        - Inline: ha_config_set_dashboard_resource(content="class MyCard extends HTMLElement { ... } customElements.define('my-card', MyCard);", resource_type="module")
        - Store cards need no call: in storage mode the Marketplace registers the resource on install (adding it again duplicates it); with YAML-mode resources, list it under lovelace: resources: in configuration.yaml instead.
        - Update: ha_config_set_dashboard_resource(url="/local/my-card-v2.js", resource_type="module", resource_id="abc123")
        - Patch: ha_config_set_dashboard_resource(resource_id="abc123", edits=[{"old": "color: red", "new": "color: blue"}], config_hash="<_config_hash from the list>")

        Inline writes return the stored content's config_hash.

        After adding a resource, a browser cache clear or hard refresh
        (Ctrl+Shift+R) is needed to load it.
ha_config_set_grouptool Create or update a service-based Home Assistant entity group via the group.set service.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a service-based Home Assistant entity group via the group.set service.

        **When NOT to use:** for typical "combine these entities into one controllable group"
        requests, prefer `ha_config_set_helper(helper_type="group", ...)`. Config-entry-backed
        groups are registered in the entity registry, so `ha_set_entity` can assign them to
        areas and they are deletable via `ha_remove_helpers_integrations`.

        **When to use:** compatibility with existing groups already configured via group.set
        or YAML, or the rare case where entity-registry membership is explicitly unwanted.
        Groups created here are only removable via `ha_config_remove_group` —
        `ha_remove_helpers_integrations` will not find them. They survive group.reload but
        not a restart.

        Core creates group.<object_id> when it does not exist (members from entities or
        add_entities) and updates it otherwise. entities, add_entities, and remove_entities
        are mutually exclusive.

        EXAMPLES:
        - Create: ha_config_set_group("bedroom_lights", entities=["light.lamp", "light.ceiling"], name="Bedroom Lights")
        - Add entities: ha_config_set_group("lights", add_entities=["light.extra"])
ha_config_set_helpertool Create or update Home Assistant helpers: storage types, every helperFilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update Home Assistant helpers: storage types, every helper
        flow HA lists, and config subentries.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.
        ``helper-selection.md`` ships under ``skill_content`` by default.

        SIMPLE types, written in one call: input_boolean, input_button,
        input_select, input_number, input_text, input_datetime, counter, timer, schedule,
        zone, person, tag.

        FLOW types: every helper flow Home Assistant lists, read from it at
        call time — template, group, utility_meter, derivative, min_max,
        threshold, integration, statistics, trend, ... and custom helper
        integrations. Creating one runs its config flow; `helper_id` (the
        config entry id) runs its options flow instead.
        Do not create `otp` here although Home Assistant lists it: the user sets
        it up in the HA UI, since its secret is a credential they enroll in an
        authenticator app.

        CONFIG_SUBENTRY type: pass `entry_id` and `subentry_type`; with
        `subentry_id` the subentry's reconfigure flow runs, without it its
        create flow.

        Flows, one step per call, as the HA UI runs them: a call answers the
        step the flow is at and returns Home Assistant's next answer. A form
        comes back with its fields (type, default, current value, Home
        Assistant's help text) and flow_id; a menu with menu_options. Answer
        with flow_id and config (a form) or menu_choice (a menu); flow_id alone
        returns the step again, and flow_id with abort=True ends the flow.
        Without flow_id a new flow starts: menu_choice answers its opening
        menu and config the form after it, so a one-form helper is created or
        updated in one call; without config the call returns the form, and
        its later_forms when the helper has more than one (statistics,
        history_stats, generic_thermostat, ...). With a config list the call
        answers form after form and returns at the first one Home Assistant
        rejects, or once the answers run out. A rejected form is an error
        with Core's text, and the flow stays open to correct it. Nothing is
        saved until the flow finishes.

        WHEN NOT TO USE:
        - An integration that is not a helper: ha_set_integration.
        - Removing a helper: ha_remove_helpers_integrations.
        - Renaming a flow helper's entity, or its registry settings alone:
          ha_set_entity.

        Behavior:
        - A SIMPLE update preserves type-specific fields not re-passed (a rename
          never wipes initial/icon/etc.).
        - Omitted `action`: update when `helper_id` (for a config subentry,
          `subentry_id`) is given, else create.
        - area_id, labels, category and icon are applied to a flow helper's
          entities by the call that finishes the flow.
        - A progress step (Home Assistant working in the background) is waited
          out for up to 120 s. When Home Assistant does not answer a submit,
          the error carries status applied_but_unverified: check the helper
          before retrying.

        EXAMPLES:
        - input_number: ha_config_set_helper(helper_type="input_number", name="Target", config={"min": 0, "max": 100, "step": 5})
        - template sensor: ha_config_set_helper(helper_type="template", menu_choice="sensor", config={"name": "Room Temp", "state": "{{ states('sensor.x')|float }}", "unit_of_measurement": "°C"})
        - group: ha_config_set_helper(helper_type="group", menu_choice="light", config={"name": "Kitchen Lights", "entities": ["light.a", "light.b"]})
        - see a form first: ha_config_set_helper(helper_type="statistics"), then answer it: ha_config_set_helper(helper_type="statistics", flow_id="...", config={...})
        - several forms in one call: ha_config_set_helper(helper_type="statistics", config=[{"name": "Temp Mean", "entity_id": "sensor.temp"}, {"state_characteristic": "mean"}, {"sampling_size": 20}])
        - update one option: ha_config_set_helper(helper_type="group", helper_id="01HXYZ...", config={"hide_members": true})
        - config subentry: ha_config_set_helper(helper_type="config_subentry", entry_id="01HXYZ...", subentry_type="conversation", config={"name": "Local agent", "model": "gemma3:27b"})
ha_config_set_labeltool Create or update a Home Assistant label.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant label.

        Creates a new label if label_id is not provided, or updates an existing
        label if label_id is provided. Labels are a cross-domain tagging system
        for entities, devices, and areas.

        EXAMPLES:
        - Create: ha_config_set_label(name="Security", color="red", icon="mdi:shield", description="Security-related devices")
        - Update: ha_config_set_label(label_id="my_label_id", color="blue")
        - Create and apply to areas: ha_config_set_label(name="Site Home", areas=["kitchen", "living_room"])

        After creating a label, use ha_set_entity(labels=["label_id"]) to assign it to entities,
        ha_set_device(labels=["label_id"]) for devices, or
        ha_set_area_or_floor(kind="area", labels=["label_id"]) for areas (replaces the area's set).
ha_config_set_scenetool Create or update a Home Assistant scene.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant scene.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.

        Supports two modes: full config replacement (``config``) or
        Python transformation of an existing scene (``python_transform``).
        See the field descriptions for ``python_transform`` examples and
        the ``config`` shape contract. Either mode can also take
        ``activate``, which can be passed alone with ``scene_id`` to activate
        a scene without touching its config.

        WHEN TO USE:
        - ``python_transform``: surgical edits to an existing scene
          (add/remove/update a single entity entry).
        - ``config``: creating a new scene, or wholesale replacement; with
          ``capture_entities`` or ``capture_devices``, from current states.
        - ``activate`` (with scene_id, no config): activate any scene,
          e.g. ha_config_set_scene(scene_id="scene.movie_night", activate=True).

        WHEN NOT TO USE:
        - To list or look up existing scenes, use ha_config_get_scene.

        SCENE SHAPE: Automations use a list of actions; scenes capture a snapshot
        of states as a dict.

        EXAMPLE:

        ha_config_set_scene(scene_id="movie_night", config={
            "name": "Movie Night",
            "entities": {
                "light.living_room": {"state": "on", "brightness": 50},
            },
            "icon": "mdi:movie",
        })

        The top-level ``SKILL.md`` for home-assistant-best-practices ships in
        this response under ``skill_content`` by default — generic
        best-practice index covering entity-naming and
        safe-refactoring patterns that intersect with scene authoring. For
        detailed scene configuration help beyond that, use ha_get_skill_guide.
ha_config_set_scripttool Create or update a Home Assistant script.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant script.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.

        Prefer native actions (`choose` / `if`, `wait_for_trigger`, `repeat`,
        `for:`) over templates in logic positions; templates belong only in
        `data.*`, notification text, `event_data` and `variables`. The
        best-practice checker reports violations under `best_practice_warnings`.
        `automation-actions.md`, `triggers-and-conditions.md` and
        `template-guidelines.md` ship under `skill_content` by default.

        Scripts use 'sequence', NOT 'trigger' or 'action'; for trigger-based
        execution use ha_config_set_automation.

        MODES (pick one):
        - python_transform: surgical edits to an existing script. Requires
          config_hash from ha_config_get_script(), e.g.
          python_transform="config['sequence'].append({'delay': {'seconds': 5}})"
        - config: new scripts or full restructures. Needs 'sequence' (regular) or
          'use_blueprint' {path, input} (blueprint-based).
        - take_control_of_blueprint: convert a blueprint-backed script into a
          standalone one. Takes no config of its own.
        - run (alone with script_id): 'start' runs the script (optional
          variables), 'stop' stops its running executions. Write config changes
          in a separate call first: Home Assistant signals no completion of the
          script reload a write triggers.

        EXAMPLES:
        - Create: ha_config_set_script(script_id="blink_light", config={"alias": "Light Blink", "sequence": [{"action": "light.turn_on", "target": {"entity_id": "light.living_room"}}, {"delay": {"seconds": 2}}, {"action": "light.turn_off", "target": {"entity_id": "light.living_room"}}]})
        - From a blueprint: ha_config_set_script(script_id="notification_script", config={"alias": "My Notification Script", "use_blueprint": {"path": "notification_script.yaml", "input": {"message": "Hello World"}}})
        - Take control: ha_config_set_script(script_id="notification_script", take_control_of_blueprint=True)

        TAKE CONTROL is one-way: later blueprint edits stop reaching the script;
        to change an input value, update 'use_blueprint.input' instead. It does
        NOT free the blueprint — Home Assistant keeps counting the converted
        script as a user, so deleting that blueprint stays refused until the
        script is removed. To preview the rendering without writing anything,
        use ha_manage_blueprints(action="substitute", domain="script", path=..., input=...).
ha_config_set_yamltool Update raw YAML configuration in configuration.yaml, packages/*.yaml, or themes/*.yaml (LAST RESORT).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Update raw YAML configuration in configuration.yaml, packages/*.yaml, or themes/*.yaml (LAST RESORT).

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.
        ``template-guidelines.md`` ships under ``skill_content`` by default.

        Destructive, disabled by default. Prefer the dedicated tools:
        ha_config_set_helper for template sensors and every other helper type,
        ha_config_set_automation / ha_config_set_script / ha_config_set_scene
        for storage-mode items.

        Intended for YAML-only integrations with no config-flow or API
        equivalent (command_line, rest, shell_command, notify platforms),
        for integrations with significant YAML-only configuration (knx
        entities in package files), for registering YAML-mode dashboards via
        ``lovelace.dashboards.<url_path>`` (no other ``lovelace.*`` keys),
        and for editing theme files in ``themes/*.yaml``. Themes only load when
        configuration.yaml carries the ``frontend: themes:`` include (e.g.
        ``!include_dir_merge_named themes``); this tool cannot add that include
        (``frontend`` is not an allowed key). ``automation``, ``script`` and
        ``scene`` keys are accepted only when ``file`` is a ``packages/*.yaml``
        and the operator has turned on that key's packages setting (each is
        off by default); writes of those keys to ``configuration.yaml`` are
        rejected; use the storage-mode tools.

        Check ``post_action`` in the response. For ``themes/*.yaml`` this tool
        *performs* the reload itself (``frontend.reload_themes``), so
        ``post_action`` is ``reload_performed`` (or ``reload_available`` plus
        ``reload_error`` if that reload failed). For any other key it is
        ``reload_available`` with the ``reload_service`` to call yourself when
        Home Assistant has ``<key>.reload`` (the key's integration is loaded),
        and ``restart_required`` otherwise; the edit is on disk but not yet
        live. Preserves YAML comments and HA tags (``!include``,
        ``!secret``) on round-trip; ``replace`` swaps the subtree as-is.

        Two-step confirmation (default ON, toggle ENABLE_YAML_EDIT_CONFIRM /
        Server Settings): the first call returns ``preview: true`` with a
        unified ``diff`` of exactly what would change on disk and a
        ``confirm_token`` — nothing is written. Review the diff, then repeat
        the identical call adding ``confirm_token`` to apply. Every applied
        write also returns the final ``diff``. A token mismatch means the file
        changed since the preview (or the token was wrong); use the freshly
        returned token.
ha_delete_filetool Delete a file from allowed directories in the Home Assistant config.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Delete a file from allowed directories in the Home Assistant config.

        ha_manage_backup(scope="edits") can restore a text file from its most
        recent auto-backup snapshot; a binary file has no snapshot and its
        deletion is permanent. Allowed directories:
        `www/`, `themes/`, `custom_templates/`, `dashboards/`, plus any custom
        directories OR HAOS sibling volumes (`/share`, `/media`, `/ssl`) configured
        in the ha-mcp settings UI; `/ssl` is read-only on HAOS and Supervised.
        Configuration files cannot be deleted; path traversal (../) is blocked.

        EXAMPLE: ha_delete_file(path="www/deprecated-style.css", confirm=True)
ha_dev_manage_servertool Manage the running ha-mcp server itself (developer mode).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage the running ha-mcp server itself (developer mode).

        When NOT to use: to restart Home Assistant use ha_restart; to
        update Home Assistant Apps (add-ons) or Marketplace repositories use
        ha_manage_app / ha_manage_hacs.

        Caveats: update_source changes ONLY the ha_mcp_tools custom
        component's separate in-process server entry — it never updates
        the app (add-on), Docker, standalone, or PyPI server that may be
        serving this connection (update those via ha_manage_app /
        docker pull / pip). In embedded mode that entry IS this server,
        so the update self-interrupts; elsewhere this connection is
        untouched and keeps its current version. Success means the
        entry's options were applied — the component then reinstalls in
        the background, which can take minutes and can still fail
        (check HA logs). update_source requires the component's
        in-process server entry to exist. restart interrupts this MCP
        connection in embedded and app deployments (the reply
        arrives just before the server goes down) and supports those
        two deployments only (standalone processes must be restarted
        externally). approve/deny require the separate
        'dev_tools_security_policy_access' setting, off by default.

        EXAMPLES:
        ha_dev_manage_server("update_source", pip_spec="https://github.com/homeassistant-ai/ha-mcp/archive/refs/pull/1234/head.tar.gz")
        ha_dev_manage_server("update_source", pip_spec="clear")
        ha_dev_manage_server("approve", token="abc123")
ha_dev_manage_settingstool Manage ha-mcp server settings and the Tools/Policies/Backups surfaces (developer mode).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage ha-mcp server settings and the Tools/Policies/Backups surfaces (developer mode).

        Drives everything the web settings UI can change: the Server
        Settings matrix, the Tools tab, the Tool Security Policies editor,
        and agent-editable backup config. Snapshot Actions and Backup Read
        Only are human-only controls. Use ha_dev_manage_server for
        the live approval queue and to restart.

        When NOT to use: for HA entity/automation configuration use the
        ha_config_* tools.

        Caveats: enable/disable/pin and most server settings take effect
        only after a restart (ha_dev_manage_server action="restart");
        LLM-API exposure, security gates, and policy edits apply live.
        Env-pinned settings/tools are read-only until the env var is unset.
        These actions can flip security-sensitive state — treat with the
        same care as editing the web UI. The policy-override surfaces
        (set_policy, set_tool with gated=, and set/reset of
        enable_tool_security_policies) additionally require the
        'dev_tools_security_policy_access' setting, which is off by
        default; reads are always available. That setting itself is never
        writable by these tools — change it in the web settings UI or via
        HAMCP_DEV_SECURITY_POLICY_ACCESS.

        EXAMPLES:
        ha_dev_manage_settings("list_tools")
        ha_dev_manage_settings("set_tool", tool="ha_write_file", state="disabled")
        ha_dev_manage_settings("set_tool", tool="ha_call_service", gated=True)
        ha_dev_manage_settings("get_policy")
        ha_dev_manage_settings("set_backup_config", backup={"enable_auto_backup": False})
ha_eval_templatetool Execute a Jinja2 template render, or an automation condition check, in Home Assistant.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Execute a Jinja2 template render, or an automation condition check, in Home Assistant.

        Renders templates with Home Assistant's template engine (all states,
        functions and filters available), or checks a condition block the way
        an automation would and returns true/false.

        When to use: any one-shot answer DERIVED from current HA state (an
        average across sensors, a count of entities matching a condition, a
        rendered message with live values), and testing a template or condition
        before embedding it in an automation. One render beats fetching N states
        and doing the math yourself.

        When NOT to use: a plain single-entity value is ha_get_state /
        ha_search. Templates in automation `condition:` / `trigger:` positions
        or templated action names: prefer native constructs, which are validated
        at config load, where a template only errors at runtime and a non-truthy
        render is silently false — see ha_get_skill_guide for the anti-pattern
        list. Test the native condition here with `condition`.

        Results: a render that works but hits something suspect (an undefined
        variable, a missing attribute) still returns its result with the
        messages in `warnings`; strict=true makes those hard errors. A failed
        render returns Home Assistant's error text and, with the ha_mcp_tools
        component installed, the template `line` and `source_line` it failed on
        when the error names one.

        EXAMPLES:
        - ha_eval_template(template="{{ states.light | selectattr('state', 'eq', 'on') | list | count }}")
        - ha_eval_template(template="Hello {{ name }}", variables={"name": "Alice"})
        - ha_eval_template(condition={"condition": "numeric_state", "entity_id": "sensor.temperature", "above": 20})
ha_get_apptool Get installed or available Home Assistant apps (add-ons), or details for one.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get installed or available Home Assistant apps (add-ons), or details for one.

        Do not use this tool to change app state or configuration; use
        ``ha_manage_app``. Use ``slug`` for details, ``source="installed"`` for an
        inventory, or ``source="available"`` for store discovery.

        Requires Home Assistant OS or Supervised.
ha_get_automation_tracestool Get execution traces for automations and scripts to debug issues.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get execution traces for automations and scripts to debug issues.

        Traces show what triggered a run, which conditions passed or failed,
        which actions executed, any errors, and variable values during
        execution. Home Assistant keeps only the most recent runs of each
        automation or script (its stored_traces setting), so older runs are
        not available.

        Do not use this tool for general log history or recorder statistics;
        use `ha_get_logs` for logs and `ha_get_history` for history/statistics.

        USAGE MODES:
        1. List recent traces (omit run_id and context_id).
           ha_get_automation_traces("automation.motion_light")
           ha_get_automation_traces(domain="automation")
        2. Get a detailed trace (provide run_id): returns Core's extended trace
           dict unchanged, including config, raw step trace, context, errors
           and variables. Pass `sections` to keep only named top-level keys
           (plus 'logbook' for the run's logbook); a requested name the run
           lacks is reported in `warnings` and the run's own keys are listed.
           An empty `sections` string means omitted.
           ha_get_automation_traces("automation.motion_light", run_id="1705312800.123456")
           ha_get_automation_traces(domain="automation", item_id="uid", run_id="...")
        3. Resolve a trace by context (provide context_id): the response
           selects Core's run for that context and reports `context_match` as
           `trace` or `parent`. With the ha_mcp_tools component,
           `context_other_matches` lists the other runs that matched the
           context id (own or triggering parent); Core's own `trace/contexts`
           keeps one run per context id. A context Core does not hold is
           reported as not found with a hint that the component resolves
           triggering (parent) contexts.
           ha_get_automation_traces(context_id="01J...")

        RESPONSE FIELDS:
        - A detail response is Core's extended `trace/get` dict: `config`,
          `trace`, `context`, `timestamp`, `state`, `error`,
          `script_execution`, `blueprint_inputs` and any run-specific fields.
        - `success`, `run_id`, `domain` and `item_id` identify the run.
          `entity_id` is present when the caller supplied it; a context-only
          lookup returns Core's `domain`/`item_id` instead of inventing one.
        - `context_match` is `trace` or `parent`; `context_scanned` reports
          how many stored runs the ha_mcp_tools component inspected while
          resolving the context id, and is 0 when Core's own-context map
          answered.
        - `logbook_entries`, `logbook_transport`, `logbook_total` and
          `logbook_truncated` describe the run's logbook rows.
ha_get_camera_imagetool Get a snapshot image from a Home Assistant camera or image entity.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get a snapshot image from a Home Assistant camera or image entity.

        Returns the image in its served format, with its available dimensions
        and retrieval time in Home Assistant local time. Use ha_get_state for
        entity state and attributes. Use this tool to inspect a camera scene
        or view content such as a QR code, album cover, or map.

        EXAMPLES:
        ha_get_camera_image(entity_id="camera.backyard", width=640, height=480)
        ha_get_camera_image(entity_id="image.album_art")
ha_get_dashboard_screenshottool Get rendered images of a Home Assistant Lovelace dashboard view.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get rendered images of a Home Assistant Lovelace dashboard view.

        When not to use: while reading or writing dashboard configuration, use
        ha_config_get_dashboard(include_screenshot=True) or
        ha_config_set_dashboard(return_screenshot=True) for a single workflow.

        Use it for repeatable visual checks, including ordered mobile, tablet,
        and desktop captures. The engine returns image bytes but does not
        confirm that the frontend accepted a requested theme or language;
        structured metadata therefore records the values sent to the engine.
        WPE Screenshot Engine applies frontend preferences temporarily. Puppet
        may persist requested theme or dark-mode changes on the engine account;
        ha-mcp reports detected changes in warnings but does not undo them (see
        ha_manage_theme action='set_engine_theme').

        To change the screenshot engine app's own options or restart it, use
        ha_manage_app.
ha_get_devicetool Get device information with pagination, including Zigbee (ZHA/Z2M) and Z-Wave JS devices.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get device information with pagination, including Zigbee (ZHA/Z2M) and Z-Wave JS devices.

        Without device_id/entity_id: Lists devices with optional filters and pagination.
        With device_id or entity_id: Returns full detail for that specific device.

        **List devices (paginated):**
        - First page: ha_get_device()
        - Next page: ha_get_device(offset=50)
        - By area: ha_get_device(area_id="living_room")
        - By integration: ha_get_device(integration="zigbee2mqtt")
        - Full details in list: ha_get_device(detail_level="full", limit=10)

        **Single device lookup (Core's whole row, its entity rows and linked_devices):**
        - By device_id: ha_get_device(device_id="abc123")
        - By entity_id: ha_get_device(entity_id="light.living_room")

        **Zigbee:** integration="zha" or "zigbee2mqtt". Returns ieee_address, radio metrics.
        **Z-Wave:** integration="zwave_js". Single device lookup returns
        Z-Wave JS's node_id and node_status.
        **Matter:** integration="matter". Returns node_diagnostics (network type,
        reachability, IPs, fabrics). For management use ha_manage_radio.
ha_get_entitytool Get entity registry entries, or without an entity the registry settings and exposed entities.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get entity registry entries, or without an entity the registry settings and exposed entities.

        Returns each entry as Home Assistant's entity registry serves it
        (`config/entity_registry/get` / `get_entries`): area_id, name override,
        original_name, icon, disabled_by/hidden_by, aliases (a null alias is the
        entity's own name), labels, categories, device_class, capabilities,
        entity_category, per-domain options, platform, device_id,
        config_entry_id, unique_id and `next_name_part`. An entity with a
        device_id and no name of its own (`name: ""`, or `name: null` with no
        `original_name`) is the main entity of its device (the dialog's "Main
        entity of the device" switch). Plus the enrichment keys below.

        RESOLVER MODE:
        Pass unique_id to resolve it to its entity_id(s). Since the registry's
        unique key is (domain, platform, unique_id), the same unique_id can match
        multiple platforms — all matches are returned in entity_entries with a
        `matches` count. Narrow with domain/platform.

        When config_entry_id is non-null — e.g. for UI-created template / group /
        utility_meter / derivative helpers — pass it to
        ``ha_get_integration(entry_id=..., include_options=True)`` to read the
        helper's current config (template body, group members, etc.) without
        scanning a domain list.

        Resolved-name enrichment on an entity_id or unique_id lookup, served by the
        ha_mcp_tools component (absent without it, and a warning says which
        fields are missing and whether to install or update the component):
        `full_name` (the name Home Assistant shows, composed from the parent
        device, device and entity names; null when it has none),
        `area` (assigned area NAME, device-inherited when the entity has none),
        `floor`, and `label_names`. This tool's base `labels` carries the label ids;
        ha_search result_fields and the exposure listing's `entity_info`
        instead emit the resolved names under `labels`.

        VOICE ASSISTANT EXPOSURE:
        An entity with a registry entry keeps its exposure in the entry's
        `options` (`options.<assistant>.should_expose`; absent while nothing is
        stored); ha_set_entity(expose_to=...) sets it. An entity without a
        registry entry that has a state, or is stored as exposed, returns
        `entity_entry: null` with `exposed_to` (the assistants Home Assistant has
        stored as exposed) and
        `is_exposed_anywhere`; a list call returns such entities under
        `unregistered_entities`.

        WITHOUT entity_id AND unique_id: returns the registry-wide state:
        `settings` (Home Assistant's `config/entity_registry/settings/get`:
        `entity_id_parts`, the name parts new entity IDs are built from, null
        for Home Assistant's default) and `exposed_entities`, the entities
        exposed to at least one voice assistant as Home Assistant's
        `expose_entity/list` map, with `count` and a per-assistant `summary`
        (an assistant with no exposed entity is left out). An entity missing
        from that map is not stored as exposed: either it is stored as not
        exposed, or nothing is stored yet and Home Assistant applies its own
        default when an assistant first asks (it depends on the assistant's
        expose-new-entities flag and on the entity). When the ha_mcp_tools
        component advertises it, `entity_info` names each listed entity:
        domain, area, floor and labels (plus friendly_name and state when it
        has a state). Without it the listing has no `entity_info`, and a
        warning says whether to install or update the component.

        RELATED TOOLS: ha_set_entity() to modify these properties; ha_get_state()
        for current state/attributes; ha_search() to find entities.

        EXAMPLES:
        - Single entity: ha_get_entity("sensor.temperature")
        - Multiple entities: ha_get_entity(["light.living_room", "switch.porch"])
        - Resolve a unique_id: ha_get_entity(unique_id="00:11:22:33", domain="sensor")
        - Entities exposed to Alexa: ha_get_entity(exposed_to="cloud.alexa")
        - Registry settings and all exposed entities: ha_get_entity()
ha_get_hacs_infotool Get data from Home Assistant's Marketplace, what HACS became in 2026.11.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get data from Home Assistant's Marketplace, what HACS became in 2026.11.

        This tool only reads; to install, update, add or forget repositories
        use ``ha_manage_hacs``. Use ``search`` to browse, filter or list
        installed repositories: it filters and pages the store's own list, in
        the order Core lists it. Use ``info`` for one
        repository's full record as the store sends it (the README is
        ``additional_info``).

        **DASHBOARD TIP:** ``action="search", installed_only=True, category="lovelace"``
        finds installed custom cards to wire into ``ha_config_set_dashboard()``.

        **Examples:**
        - Search: ha_get_hacs_info(action="search", query="mushroom", category="lovelace")
        - Updates waiting: ha_get_hacs_info(action="search", status=["pending-upgrade"])
        - Details before an update: ha_get_hacs_info(action="info", repository_id="owner/repo", include_releases=True)
        - Before adding a repository: ha_get_hacs_info(action="detect", repository="owner/repo")

        **Caveats:** ``info`` marks the repository as seen (Core clears its
        ``new`` flag) and may fetch it from GitHub. ``detect`` needs the
        accepted first-run warning and a connected GitHub account.
        ``download_source`` opens and ends the Marketplace entry's options
        flow, as the panel's "Download source" does.
ha_get_historytool Get historical data from Home Assistant's recorder.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get historical data from Home Assistant's recorder.

        WHEN NOT TO USE:
        For current values, use ha_get_state. To inspect Energy Dashboard
        preferences and configured statistics, use
        ha_manage_energy_prefs(mode="get", include_statistics=True). To list the
        recorder's statistics, see Core's issues with them, or change recorded
        data, use ha_manage_logs.

        WHEN TO USE:
        Use source="history" (default) to troubleshoot why a value changed, check
        event sequences, or analyze recent patterns. Use summary=True when the
        question needs a count or a duration ("was it ever unavailable?") rather
        than the rows. Use source="statistics" for long-term trends and period
        averages.

        CAVEATS:
        When the recorder holds less than the requested window, the rows it has
        come back with the reason in warnings.
        History rows rename Core's compact keys once: s -> state, a -> attributes,
        lu -> last_updated, lc -> last_changed. History event times are ISO strings
        in HA's timezone (UTC if unavailable). When Core omits lc, last_changed
        falls back to last_updated; this may not be the actual state-change time
        with significant_changes_only (default) or a window-start snapshot.
        Attributes and unknown fields pass through unchanged.
        Statistics timestamps use Unix milliseconds. Minimal history may omit attributes.
        No duplicate compact aliases are added. include_schema=True
        retains core_contract even when fields selects other data keys.

        Output units come from
        Core recorder metadata and reflect its display-unit conversion; unresolved
        units include a reason. statistics_metadata preserves Core's native fields.

        All data is fetched from HA before slicing; limit/offset are client-side.
        With multiple entity_ids, offset must be 0 — use a single entity_id for
        offset > 0. Use has_more and next_offset from the response to paginate.
        summary=True does not combine with offset > 0.
        Administrators can optionally enable recorder workload guardrails in
        Advanced settings. When enabled, oversized entity/time workloads are
        rejected before the recorder query is issued; narrow the time range or
        entity list to stay within the budget. Calendar statistics may first
        read HA's configured timezone so the estimate follows local calendar
        boundaries.

        EXAMPLES:
        - ha_get_history(entity_ids="sensor.bedroom_temperature", start_time="24h")
        - Paginate oldest-first: ha_get_history(entity_ids="sensor.temperature", start_time="7d", limit=100, offset=100, order="asc")
        - Time per state: ha_get_history(entity_ids="binary_sensor.door", start_time="7d", summary=True)
        - ha_get_history(source="statistics", entity_ids="sensor.living_room_temperature", start_time="6m", period="month", statistic_types=["mean", "min", "max"])
ha_get_integrationtool Get integration (config entry) information with pagination.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get integration (config entry) information with pagination.

        Without an entry_id: Lists all configured integrations with optional filters.
        With an entry_id: Returns detailed information including full options/configuration.

        WHEN NOT TO USE:
        - Changing an entry, or describing a setup form or a form behind a
          menu: use ha_set_integration (without config it returns the form).

        EXAMPLES:
        - List / search: ha_get_integration(query="zigbee")
        - Get an entry with its editable fields: ha_get_integration(entry_id="abc123", include_schema=True)
        - Diagnostics dump, paged along a list-valued path: ha_get_integration(entry_id="abc123", include_diagnostics=True, diagnostics_data_path="<list-valued path>", diagnostics_data_limit=10, diagnostics_data_offset=20)
        - Inspect a subentry reconfigure schema: ha_get_integration(entry_id="abc123", include_subentry_schema=True, subentry_type="conversation", subentry_id="sub123")
        - Options flow that opens with a menu: ha_get_integration(entry_id="abc123", include_schema=True) lists menu_options; ha_set_integration(entry_id="abc123", menu_choice="<option>") opens that form
        - List template entries with their options: ha_get_integration(domain="template")
        - Only service integrations: ha_get_integration(integration_type="service")
        - An entry's panel commands: ha_get_integration(entry_id="abc123", include_ws_commands=True)

        OPTIONS: with the component, ``options`` are the stored mapping as-is,
        so a field never set may be absent and a section's fields stay nested
        under the section key (e.g. a template helper's ``additional_options``);
        values that match a ``secrets.yaml`` entry are returned as
        ``"**redacted**"``. Without it, include_schema=True reads ``options``
        from the options form: unset fields at their schema default, a
        section's fields at the top level. With redact_secrets on, every
        option value of an entry that has an options flow is redacted unless
        include_schema=True reads the form that names the password fields;
        an entry without an options flow has no such form, so its option
        values come back as stored.

        Each entry carries ``log_level``: the canonical Python logger level name
        (``DEBUG``/``INFO``/``WARNING``/``ERROR``/``CRITICAL``) when the
        integration has a log-level override (set one with
        ``ha_set_integration(log_level=...)``), or ``"DEFAULT"``
        (uppercase sentinel) when no override is set; and ``log_level_raw``: the
        original numeric level (e.g. ``10`` for DEBUG) when HA returned an int,
        ``None`` otherwise. This is distinct from the app side, where
        ``ha_get_app`` returns Supervisor's lowercase ``"default"`` literal — do
        not cross-compare.
ha_get_logstool Get Home Assistant logs from various sources.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get Home Assistant logs from various sources.

        Prefer source='system' for triage: it returns HA's own deduplicated
        system_log entries with counts, first_occurred and the full exception
        traceback, and its counts run since each error first occurred. error_log with
        structured=True counts only what is inside the fetched window (reported
        as window_start/window_end; every install reads a capped window) and
        drops tracebacks; structured=False returns the raw records instead, so
        it covers what falls outside system_log's WARNING+ in-memory buffer. Use
        structured=True for the per-component rollup; in structured mode
        limit/order do not apply: issues are ranked by count, then severity,
        then recency, over a fixed deep window.

        Raw-text sources (error_log, supervisor, system_service) read a bounded
        window per call, so level/search filter and limit slice within that
        window only; window_lines reports the size requested. With hours_back,
        supervisor and system_service read the journal's own time window
        instead. Logbook and hours_back responses carry has_more plus a
        pagination_hint; error_log, fault_log and supervisor/system_service
        page reads carry has_more with a next_offset to pass back while it
        stays true.
ha_get_operation_statustool Get the status of one or more device operations with real-time WebSocket verification.
Get the status of one or more device operations with real-time WebSocket verification.

        Bulk checks poll all operations concurrently under one shared
        timeout_seconds window and report per-item failures inside
        detailed_results instead of aborting the batch.

        Use this to track the operation_ids that ha_bulk_control returns.
        For current entity states, use ha_get_state instead.
ha_get_overviewtool Get AI-friendly system overview with intelligent categorization.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get AI-friendly system overview with intelligent categorization.

        Returns comprehensive system information at the requested detail level,
        including Home Assistant base_url, version, location, timezone, entity overview,
        and active persistent notifications (if any).
        Use 'minimal' (default) for most queries. Domain counts and states_summary
        are always complete regardless of entity pagination.

        Entities are listed by friendly_name, the legacy state attribute. A row
        also carries name where Home Assistant shows a different one, composed
        from the parent device, device and entity names (served by a current
        ha_mcp_tools component).

        Requests whose fields= are composed only of system_info, notification,
        repair, or server metadata fields skip the unrelated state, service, and
        registry reads.

        Do not use this tool to inspect a known entity or a narrow set of entities.
        Use ha_get_state for one entity, ha_get_entity for registry metadata, or
        ha_search with a domain or area filter. An unprojected overview collects
        system-wide state, service, and registry data and can be expensive on large
        Home Assistant installations.

        When the ha-mcp settings-UI sidecar is running (stdio mode, e.g. Claude
        Desktop / Claude Code) the response carries ``settings_url``, the local
        URL of the tool-configuration page; in standalone HTTP / Docker modes
        with an HTTP settings prefix it instead carries ``settings_url_hint``,
        saying where the page is mounted and how to construct the full URL. Hand
        whichever is present to the user when they ask how to enable or disable
        tools or change server settings.

        The response also carries ``ha_mcp_update`` ``{current, latest,
        update_available}`` (PyPI for pip/Docker, the Supervisor store for the
        app) — proactively tell the user when ``update_available`` is true.
        If it carries ``python_required``, the release needs that Python: give
        the user ``upgrade_command``.
        Omitted for the ``unknown`` version, when ``HA_MCP_DISABLE_UPDATE_CHECK``
        is set, or when the update check itself failed.

        ``mcp_client`` reports the MCP protocol version, client info and
        client capabilities this call arrived with, for diagnosing
        client-specific behaviour. ``capabilities: null`` means the request
        carried none to read, not that the client declared none.
ha_get_skill_guidetool FilesCredentialsEnv varsSensitive pathsoutside text
No description.
ha_get_statetool Get current status, state, and attributes of one or more entities (lights, switches, sensors, climate, covers, locks, fans, etc.).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get current status, state, and attributes of one or more entities (lights, switches, sensors, climate, covers, locks, fans, etc.).

        Pass a string entity_id for one entity, or a list (max 100, duplicates
        deduplicated) for several, fetched in parallel. A bulk call returns
        success=True if at least one state was retrieved; check 'error_count'
        for failed lookups.

        `fields=` projects the per-entity record keys, NOT the outer bulk
        response wrapper: in single-entity mode it filters the returned record;
        in bulk mode it filters each record inside `states[entity_id]` while
        outer keys (`success`, `count`, `states`, `errors`, ...) are always
        preserved. `attribute_keys=` further narrows the `attributes` sub-dict
        and is only applied when `"attributes"` is in `fields=` (or
        `fields=None`); otherwise it is a no-op and a `warnings` list is emitted
        at the top level of the result (sibling of `data`/`metadata`), outside
        the projected record(s), so `fields=["state"]` still returns a record
        with only `state`.

        EXAMPLES:
        - Single: ha_get_state("light.kitchen")
        - Multiple: ha_get_state(["light.kitchen", "light.living_room", "sensor.temperature"])
        - Slim bulk: ha_get_state(["light.kitchen", "sensor.temperature"], fields=["state", "attributes"], attribute_keys=["brightness"])
ha_get_system_healthtool Get Home Assistant system health, including Zigbee (ZHA), Z-Wave JS, Thread and Matter networks.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get Home Assistant system health, including Zigbee (ZHA), Z-Wave JS, Thread and Matter networks.

        Returns health check results from integrations, system resources, and
        connectivity; available information varies by installation type and
        loaded integrations. Each domain carries the ``name`` and key ``labels``
        the System information dialog shows. Checks that Home Assistant runs in
        the background are awaited up to a deadline; one still running shows as
        pending, with a warning. Optional sections are selected with `include`.

        Not for one integration's diagnostics: use
        ha_get_integration(include_diagnostics=True). Not for themes: use
        ha_manage_theme(action='list'). Not for a single device's radio state:
        use ha_get_device. Use this tool for the state of the whole
        installation: health checks, repairs, radio networks, Supervisor,
        startup times and the configuration check.

        The result may include ``ha_mcp_update`` ``{current, latest,
        update_available}``. When update_available is true, tell the user a newer
        ha-mcp release is available (with ``python_required``, give ``upgrade_command``).

        EXAMPLES:
        - ha_get_system_health(include="repairs,zha_network,zwave_network,config_check")
        - ha_get_system_health(include="supervisor,integration_startup")
ha_get_todotool Get todo lists or items - list all todo lists or get items from a specific list.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get todo lists or items - list all todo lists or get items from a specific list.

        Without an entity_id: lists every entity in the 'todo' domain (shopping
        lists and other todo-type integrations) with entity_id, friendly_name
        and state (number of incomplete items or current status).

        With an entity_id: returns that list's items as Home Assistant reports
        them — uid, summary, status, and description, due and completed where
        set.

        EXAMPLES:
        - List all todo lists: ha_get_todo()
        - Get incomplete items: ha_get_todo("todo.shopping_list", status="needs_action")
ha_get_zonetool Get zone information - list all zones or get details for a specific one.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get zone information - list all zones or get details for a specific one.

        Without a zone_id: Lists all Home Assistant zones with their coordinates and radius.
        With a zone_id: Returns detailed configuration for a specific zone.

        EXAMPLES:
        - List all zones: ha_get_zone()
        - Get specific zone: ha_get_zone(zone_id="office")
        - Same zone by entity_id: ha_get_zone(zone_id="zone.office")

        Zones outside the zone storage, the home zone (from the general
        settings) and YAML zones, are listed with ``editable=false`` /
        ``source="yaml"``; editable means ha_set_zone and ha_remove_zone can
        change the zone. Each zone carries its entity_id.

        A stored zone's ``icon`` is the one stored in the zone, which the
        Zones editor shows. ``entity_icon`` is an icon override in the zone
        entity's registry entry: the map and the zone's state show it instead.
        Set or clear the override with ha_set_entity.
ha_list_filestool List files in a directory within the Home Assistant config directory.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
List files in a directory within the Home Assistant config directory.

        Returns file names, sizes, and modification times for one of the allowed
        directories:
        - `www/` - Web assets (CSS, JS, images for dashboards)
        - `themes/` - Theme files
        - `custom_templates/` - Jinja2 template files
        - `dashboards/` - YAML-mode dashboard files
        - `blueprints/` - Automation/script blueprint sources (read-only)
        - `packages/`, plus the folder bound by `homeassistant: packages:` when
          it has another name
        - Plus any custom directories OR HAOS sibling volumes (`/share`,
          `/media`, `/ssl`) configured in the ha-mcp settings UI
        Path traversal (../) is blocked.

        EXAMPLE: ha_list_files(path="www/", pattern="*.css")
ha_list_floors_areastool List floors in the order Home Assistant keeps them, each with their assigned areas nested, plus areas without a floor.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
List floors in the order Home Assistant keeps them, each with their assigned areas nested, plus areas without a floor.

        Use for location-based reasoning where floor-to-area relationships matter, such as "which rooms are on the ground floor" or operations scoped to a level.

        ha_set_area_or_floor(order=...) sets the order of the floors, and of the areas within each group. Areas without a floor assignment appear in unassigned_areas; areas whose floor_id points to a non-existent floor appear in orphaned_areas. When the ha_mcp_tools component's registries capability is available, both registries come from a single in-process snapshot, so this classification is always consistent. Without it (legacy path), the two registries are fetched via independent WebSocket calls and a registry change between reads may transiently misclassify an area.
ha_list_servicestool List available Home Assistant services with optional pagination and detail control.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
List available Home Assistant services with optional pagination and detail control.

        Discovers services/actions that can be called via ha_call_service.

        EXAMPLES:
        - Light services with full parameter details: ha_list_services(domain="light", detail_level="full")
        - Search: ha_list_services(query="temperature")
        - Next page: ha_list_services(offset=50)
ha_manage_apptool Manage Home Assistant apps (add-ons) or proxy an app API.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant apps (add-ons) or proxy an app API.

        For app inventory, status, and Supervisor metadata, call ``ha_get_app``
        first; use proxy mode here for documented app-specific read APIs, and
        do not infer private app API schemas.

        Use exactly one mode: lifecycle/store action, configuration fields,
        ``path`` proxy, or ``path`` with ``array_patch``.

        Requires Home Assistant OS or Supervised. When ha-mcp itself runs as an
        app it cannot update its own running slug; update ha-mcp from the Home
        Assistant Apps UI. ``options`` merges top-level keys and one nested
        mapping level; supply complete values for deeper nested mappings
        because they are replaced. Prefer Ingress: direct-port access requires
        a shared container network and may require weakening the target app
        authentication. If a Supervisor lifecycle, configuration, or repository
        write has an unknown outcome, verify durable state with ``ha_get_app``
        before retrying. That cannot prove whether ``restart`` or ``rebuild``
        ran; inspect Supervisor jobs and logs and do not automatically replay
        them. For a proxy or array-patch write, query the target app's own read
        API before retrying.
ha_manage_backuptool FilesNetworkCredentialsEnv varsSensitive pathsoutside text
No description.
ha_manage_blueprintstool Manage Home Assistant blueprints — list, read, import, save, delete, or render a standalone config.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant blueprints — list, read, import, save, delete, or render a standalone config.

        One interface for the whole blueprint lifecycle in the ``automation``
        and ``script`` domains.

        DO NOT use this to create an automation or script FROM a blueprint —
        that is ``ha_config_set_automation`` / ``ha_config_set_script`` with a
        ``use_blueprint`` config.

        To duplicate a blueprint, ``get`` it and ``save`` its ``yaml`` under a
        new ``path``; to edit one in place, ``get`` it, change the text, and
        ``save`` it back to the same ``path`` with ``overwrite=True``.

        ``get`` also reports ``used_by``: the automations or scripts built on
        the blueprint, which is the UI's "Show automations using this
        blueprint". Check it before deleting — Home Assistant refuses to delete a
        blueprint anything still uses (the error lists the consumers), and it
        goes on counting a consumer that has since taken control of its own
        config until that consumer is removed.

        CAVEATS: ``get`` returns the on-disk YAML only when something can read
        it — an in-process server, the ha_mcp_tools component, the File & YAML
        Tools entry, or the blueprint's ``source_url``; ``yaml_source`` names
        which one answered, and ``source_url`` text is a fresh download that can
        differ from the installed file. Core's blueprint API alone exposes
        metadata only, so a locally authored blueprint on a bare install has no
        readable text. Both writes are snapshotted first when a copy can be
        read, so ``ha_manage_backup(scope="edits")`` can restore the previous
        file. ``substitute`` only renders — it writes nothing, so pass the
        returned config to ``ha_config_set_automation`` /
        ``ha_config_set_script`` to persist it. To convert an automation or
        script that ALREADY exists, prefer those tools' ``take_control_of_blueprint=True``:
        it renders with that item's own current inputs and saves the result over
        itself in one call.

        EXAMPLES:
        - Get one (with its consumers in ``used_by``): ha_manage_blueprints(action="get", path="homeassistant/motion_light.yaml")
        - Import: ha_manage_blueprints(action="import", url="https://example.com/bp.yaml")
        - Edit in place: ha_manage_blueprints(action="save", path="user/motion.yaml", yaml=<edited text>, overwrite=True)
        - Delete: ha_manage_blueprints(action="delete", path="user/motion.yaml", confirm=True)
        - Render standalone: ha_manage_blueprints(action="substitute", path="user/motion.yaml", input={"motion_sensor": "binary_sensor.hall"})

        RELATED TOOLS: ``ha_config_remove_automation`` / ``ha_config_remove_script``
        to clear consumers blocking a delete, ``ha_search`` to find them.
ha_manage_custom_tooltool Create and run a custom tool in a sandbox, or manage saved custom tools.
Create and run a custom tool in a sandbox, or manage saved custom tools.

        LAST RESORT — search for existing tools first.

        **Modes** (mutually exclusive): ``code`` + ``justification``;
        ``run_saved``; ``list_saved=True``.

        **Available functions in sandbox:**
        - ``api_get(endpoint)`` / ``api_post(endpoint, data)`` — HA REST API,
          for operations not covered by existing tools
        - ``ws_send(message)`` — send a HA WebSocket command, for operations
          only available over WebSocket (most registry CRUD, template rendering,
          Lovelace operations). ``message`` must include a ``"type"`` field; the
          MCP server adds ``id`` and handles auth.
        - ``call_tool(name, args)`` — call a registered MCP tool
        - ``delete_saved_tool(name)`` — remove a previously saved custom tool.
          Returns ``{"deleted": True, "name": name}`` or ``{"error": ...}``.

        Saved tools persist across server restarts when
        ``CODE_MODE_SAVED_TOOLS_PATH`` is set (the app sets this by default to
        ``/data/saved_tools.json``).

        Example — list areas via WebSocket:
        ```python
        result = await ws_send({"type": "config/area_registry/list"})
        result.get("result", [])
        ```

        Example — chain existing tools:
        ```python
        result = await call_tool("ha_search", {"query": "light", "limit": 5})
        lights = result.get("entities", [])
        for e in lights:
            await call_tool("ha_call_service", {"domain": "light", "service": "turn_off", "entity_id": e["entity_id"]})
        {"turned_off": len(lights)}
        ```
ha_manage_energy_prefstool Manage the Home Assistant Energy Dashboard preferences: grid / solar /FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage the Home Assistant Energy Dashboard preferences: grid / solar /
        battery / gas / water energy sources, device consumption sensors for
        electricity and water, and cost tariffs.

        WHEN NOT TO USE:
        - To create the underlying statistics themselves — they must already
          exist as HA entities before being referenced here; create them via
          the relevant integration's config flow first.

        WHEN TO USE:
        - mode='get' / 'set': inspect or replace the full Energy Dashboard
          config. Use 'set' for bulk edits or anything touching multiple
          top-level keys at once.
        - mode='add_device' / 'remove_device': add or remove a single
          device-consumption entry. The tool performs a fresh read-modify-write
          internally.
        - mode='add_source': append a single entry to ``energy_sources``.
          Same internal read-modify-write.

        RELATED TOOLS: Use ha_get_history(source="statistics") with the returned
        statistic IDs for consumption, totals, and trends. Metadata comes directly
        from the running Core, including stored and display units.

        CAVEATS:
        - ``energy/save_prefs`` has per-key FULL-REPLACE semantics. Passing
          ``{"device_consumption": [<one entry>]}`` deletes every other device
          the user had configured — silently, with no error.
        - The per-key ``config_hash`` form lets an agent submit only the
          top-level key it wants to change: ``config`` keys must equal the dict
          keys, and a per-key submission still fully replaces
          that key's value. A mismatch on any locked key returns
          ``RESOURCE_LOCKED`` with the offending keys in ``mismatched_keys``.
        - ``dry_run=True`` skips the hash check entirely for both forms.
        - Writes need an administrator token; Home Assistant rejects the save
          otherwise.
        - After a successful write, the tool calls ``energy/validate`` and
          returns residual issues (missing stats, unit mismatches) as
          ``post_save_validation_errors``; the save persists regardless —
          correct the config and write again if needed.
        - 'add_source' rejects duplicates by ``(type, stat_energy_from)`` for
          solar/battery/gas/water; grid entries are appended without a duplicate
          check (multiple grid variants are legitimate), so the caller
          de-duplicates grid sources.

        EXAMPLES:
        - ha_manage_energy_prefs(mode="get", include_schema=True)
        - Preview a device: ha_manage_energy_prefs(mode="add_device", stat_consumption="sensor.fridge_energy", dry_run=True)
        - Remove a device: ha_manage_energy_prefs(mode="remove_device", stat_consumption="sensor.fridge_energy")
ha_manage_hacstool Manage Home Assistant's Marketplace (what HACS became in 2026.11): install, update, remove and add repositories.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant's Marketplace (what HACS became in 2026.11): install, update, remove and add repositories.

        This tool writes; to search the store or read a repository use
        ``ha_get_hacs_info``. Use ``update_information`` to surface a
        just-published release: on its own the Marketplace re-reads an
        installed custom repository only every 48 hours, and only with a
        connected GitHub account; catalog repositories follow the catalog,
        which it refreshes every 6 hours without one.

        **Examples:**
        - Install the latest: ha_manage_hacs(action="download", repository_id="441028036")
        - Install a version: ha_manage_hacs(action="download", repository_id="piitaya/lovelace-mushroom", version="v4.0.0")
        - Add a custom repository: ha_manage_hacs(action="add_repository", repository="owner/repo")
        - Read a repository at another version, installing nothing: ha_manage_hacs(action="set_version", repository_id="owner/repo", version="v1.2.0")
        - Accept the warning: ha_manage_hacs(action="accept_warning", confirm=True)
        - Connect GitHub: ha_manage_hacs(action="connect_github"), then again with
          the flow_id it returns for the URL and code the user enters on GitHub,
          then again with flow_id once they did, for the outcome
        - Change the download source: ha_manage_hacs(action="set_download_source")
          returns the form and flow_id; once the user chose, call again with
          flow_id and config={"profile": "<their choice>"}

        **Caveats:** An installed integration loads after a Home Assistant
        restart, and a new dashboard card after a browser cache clear. The
        Marketplace refuses to uninstall an integration while it has config
        entries. Installs, version and beta changes, and adding or detecting
        a repository wait for the first-run warning, which Home Assistant
        keeps per user, so the user's own acceptance in the UI does not cover
        this server: ask whether they read it (Settings > Marketplace) before
        ``accept_warning``. Adding and detecting a repository also need a
        connected GitHub account. A saved download source reloads the
        Marketplace, and the call waits for it.
ha_manage_logstool Manage Home Assistant's recorder, its long-term statistics and its logs.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant's recorder, its long-term statistics and its logs.

        WHEN NOT TO USE:
        For reading recorded states or statistics values use ha_get_history,
        for reading log entries ha_get_logs, and for one integration's debug
        logging ha_set_integration with log_level.

        WHEN TO USE:
        To purge or pause the recorder, to list the recorder's statistics and
        Core's issues with them, to fix a statistic (clear it, adjust a sum,
        change its unit, import rows), and to write to or clear the system
        log, set log levels or add a logbook entry.

        CAVEATS:
        Each call runs one Core operation; Core validates its fields and its
        refusal comes back with its own error code. Call with describe=True
        first when the fields are not known. With the HA-MCP component a
        recorder write returns once the recorder has finished it, and a
        recorder service returns the recorder's purge settings and oldest
        state as `recorder`; without it the tool watches the recorder's queue
        and says what that cannot show. A statistics command that names
        statistics (Core's `statistic_id` / `statistic_ids` fields) also
        returns Core's metadata for them as `statistics_metadata`, read
        after the write. Core also lists a statistic a sensor still
        provides, so after a clear read its statistics to see the rows went.
        Purges and statistics clears cannot be undone.

        EXAMPLES:
        - ha_manage_logs(action="recorder/adjust_sum_statistics", describe=True)
        - ha_manage_logs(action="recorder/clear_statistics", data={"statistic_ids": ["sensor.old_meter"]})
        - ha_manage_logs(action="system_log.write", data={"message": "checkpoint"})
ha_manage_pipelinetool Manage Home Assistant Assist pipelines.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant Assist pipelines.

        Use action='list' to discover pipeline IDs, action='get' to inspect one
        pipeline, action='create' or action='update' to write pipeline settings,
        action='set_preferred' to choose the preferred pipeline, and
        action='process' to run a sentence through Assist.

        action='process' sends the sentence straight to Assist's conversation
        agent, so a matched intent executes: it turns on the light rather than
        reporting that it would. Its result carries response_type
        ('action_done', 'query_answer' or 'error') and, on an error, error_code
        such as 'no_intent_match' — Assist declining a sentence is an answer,
        not a tool failure, so inspect those fields rather than expecting a
        raised error. Use ha_call_service to act on an entity directly; use
        this to test what Assist itself understands. When the built-in agent
        answers, a matching conversation trigger runs its automation: that
        agent checks its sentence triggers before it matches intents, so this
        is not limited to intents. Even with pipeline_id, the sentence goes
        to the agent directly. So with an agent other than the built-in one, neither
        sentence triggers nor prefer_local_intents apply — a full pipeline run
        is what adds those for other agents.

        EXAMPLES:
        - Get the preferred pipeline: ha_manage_pipeline(action="get", pipeline_id="preferred")
        - Create by cloning a pipeline: ha_manage_pipeline(action="create", base_pipeline_id="preferred", name="Local Assist", conversation_engine="conversation.local_llm")
        - Update the agent and clear the TTS voice: ha_manage_pipeline(action="update", pipeline_id="preferred", conversation_engine="conversation.local_llm", tts_voice="")
        - Run a sentence through one pipeline's agent: ha_manage_pipeline(action="process", sentence="turn on the kitchen light", pipeline_id="preferred")
        - Continue a conversation: ha_manage_pipeline(action="process", sentence="and the hallway?", conversation_id="<id from the previous response>")

        Non-nullable fields such as name, language, conversation_language, and
        conversation_engine must be omitted or non-empty.
ha_manage_radiotool Manage Home Assistant radios — Z-Wave, Zigbee, Matter, and Thread.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant radios — Z-Wave, Zigbee, Matter, and Thread.

        For node diagnostics and network summaries prefer ha_get_device /
        ha_get_system_health; 'diagnostics' and 'network_status' here return
        this tool's own, smaller shapes.
        This tool also exposes active 'ping' probes and parameter reads.
        Z-Wave 'get_config_params' lists cached configuration values/metadata;
        'get_config_param' reads one from the cache or explicitly from the device.
        Neither enables or creates entities. Write actions perform
        inclusion/commissioning, removal, healing,
        reconfiguration, firmware updates and credential provisioning.

        Caveats: long-running actions (inclusion, rebuild routes, firmware) start the
        operation and return immediately with long_running=true; completion
        happens out-of-band. Interactive Z-Wave S2 secure inclusion (read-the-
        PIN pairing) is not scriptable — use SmartStart/QR provisioning here or
        the HA UI. HA administrator access is required for parameter reads.
ha_manage_security_policytool Manage the tool security policy that gates high-stakes tool calls behind user approval.FilesCredentialsEnv varsSensitive pathsoutside text
Manage the tool security policy that gates high-stakes tool calls behind user approval.

        When NOT to use: this tool cannot see or decide pending approval
        requests — listing, approving, and denying them is developer-mode
        only (ha_dev_manage_server). For ordinary Home Assistant entity,
        automation, or dashboard work use the ha_config_* tools.

        When to use: to read the current policy, to add or remove per-tool
        approval rules and their matching conditions, to switch the rule list
        between gating and approving the calls it matches, and to change the
        approval wait time or how long an approval is remembered.

        Caveats: set replaces the WHOLE document, so send back an edited
        copy of what get returned, not a fragment. An omitted field is not
        left alone, it reverts to its default: dropping
        event_decisions_enabled switches off approving from Home Assistant
        events, and the response says so in a warning when it does, while
        dropping rule_effect from an allow list is refused. Writes are
        version-guarded: a concurrent edit is rejected instead of
        silently overwritten. Rule edits apply to the running server
        immediately and can remove approval gates. Whether this tool itself
        is registered is a separate setting that takes effect on restart.

        EXAMPLES:
        ha_manage_security_policy("get")
        ha_manage_security_policy("set", policy={"wait_seconds": 60, "approval_ttl_minutes": 5, "event_decisions_enabled": False, "rules": [{"tool_name": "ha_call_service"}], "version": 3})
ha_manage_themetool Manage Home Assistant frontend themes.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
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 the
        Marketplace (ha_manage_hacs); theme files
        are edited with ha_write_file or ha_config_set_yaml (beta), which
        reload themes after the edit. After any other change to theme files,
        ha_reload_core(target='themes') loads them.

        When to use: action='list' discovers installed theme names, the modes
        each theme declares and the current defaults; action='set' selects
        the backend default theme, the dark-mode one, or both in one call,
        and returns the defaults Home Assistant then holds. Home Assistant
        describes frontend.set_theme's fields in
        ha_list_services(domain='frontend', detail_level='full').

        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 defaults only -
        users who explicitly picked a theme in their profile keep their
        choice.

        EXAMPLES:
        - List themes: ha_manage_theme(action="list")
        - Set default theme: ha_manage_theme(action="set", theme_name="nord")
        - Set light and dark defaults: ha_manage_theme(
              action="set", theme_name="nord", theme_name_dark="nord_dark")
        - 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})
ha_manage_updatestool Manage Home Assistant updates (list, details, install, skip) and Repairs issues (ignore).FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage Home Assistant updates (list, details, install, skip) and Repairs issues (ignore).

        Covers Core, OS, supervisor, apps (add-ons), device firmware, and
        Marketplace update entities, plus the Repairs issues in Settings > System > Repairs.
        Repairs are listed by ha_get_overview (not here); pass their domain and
        issue_id to 'ignore_repair' / 'unignore_repair'. In Read Only Mode the
        read actions ('list', 'get') stay available; write actions are blocked.

        'install' blocks until each update finishes (minutes). One that outlasts
        the request timeout ends the call with a connection timeout while it
        keeps running, and a Core update restarts Home Assistant; neither means
        failure, but later batch targets were not started. Confirm per entity
        with action='get'; finished updates drop out of 'list', which also
        returns ha_mcp_update — this MCP server's own update status {current,
        latest, update_available; python_required + upgrade_command if it needs another Python}.

        EXAMPLES:
        - Pre-update analysis: ha_manage_updates(action="get", entity_ids=["update.home_assistant_core_update"], include_release_notes=True)
        - Update everything pending in a category: ha_manage_updates(action="install", categories=["addons", "hacs"])
        - Dismiss a repair: ha_manage_updates(action="ignore_repair", repairs=[{"domain": "sun", "issue_id": "abc"}])
ha_read_filetool Read a file from the Home Assistant config directory.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Read a file from the Home Assistant config directory.

        General-purpose escape hatch — prefer a dedicated tool when one exists:
        ha_manage_blueprints(action="get") for a blueprint body,
        ha_config_get_yaml for a config key, ha_config_get_automation/script/scene
        for storage-mode items. Reach for ha_read_file only for raw on-disk text
        those tools don't expose.

        Some files have special handling:
        - `secrets.yaml`: Values are masked for security
        - `home-assistant.log` / `home-assistant.log.fault`: Prefer
          ha_get_logs(source='error_log') and
          ha_get_logs(source='fault_log') over reading these directly.

        **Allowed Read Paths:**
        - `configuration.yaml`, `automations.yaml`, `scripts.yaml`, `scenes.yaml`
        - `secrets.yaml` (values masked)
        - `*.yaml` at any depth under `packages/` and under the folder bound by
          `homeassistant: packages:`
        - `home-assistant.log`, `home-assistant.log.fault` (tail only)
        - `www/**`, `themes/**`, `custom_templates/**`, `dashboards/**`, `blueprints/**`
        - `custom_components/**/*.py` (read-only)
        - Plus any custom directories OR HAOS sibling volumes (`/share`,
          `/media`, `/ssl`) configured in the ha-mcp settings UI
        Path traversal (../) is blocked.

        EXAMPLE: ha_read_file(path="packages/alert2.yaml", yaml_path="alert2")
ha_reload_coretool Execute a Home Assistant configuration reload without a full restart.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Execute a Home Assistant configuration reload without a full restart.

        WHEN NOT TO USE: an integration that is not loaded yet has nothing to
        reload; a YAML block added for one needs ha_restart.

        Use it after editing automation/script YAML, adding YAML helpers, or
        changing customize.yaml or themes.

        Reload-all checks the configuration first and refuses, with the
        reason, when the check fails. A single integration's reload does not
        check first: some (template is one) log a configuration they reject
        and keep running, so read the result back.

        EXAMPLES:
        - ha_reload_core(target="automation")
        - ha_reload_core(entry_id="abc123")
ha_remove_area_or_floortool Remove a Home Assistant area or floor.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove a Home Assistant area or floor.

        Removing an area unassigns its entities and devices (the entities and
        devices themselves are not removed). Removing a floor unassigns its
        areas. May break automations referencing the removed area/floor. The
        auto-backup of this call restores the area or floor itself, not the
        entities, devices or areas it carried.
ha_remove_devicetool Remove an orphaned device from the Home Assistant device registry.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove an orphaned device from the Home Assistant device registry.

        WARNING: This removes the device entry from the registry.
        - Use only for orphaned devices that are no longer connected
        - Active devices will typically be re-added by their integration
        - Associated entities may also be removed

        Works only when the integration supports removing devices.

        EXAMPLES:
        - Remove orphaned device: ha_remove_device("abc123def456")

        NOTE: For most use cases, consider disabling the device instead:
        ha_set_device(device_id="abc123", disabled_by="user")
ha_remove_entitytool Remove one or more entities from the Home Assistant entity registry.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove one or more entities from the Home Assistant entity registry.

        Permanently removes the entity registration; the entity will no longer
        appear in the UI or be available to automations. Use only for orphaned
        or stale entity entries: if the underlying device, integration or
        stored helper is still there, the entity may be re-added on the next HA
        restart or reload; for a stored helper's entity a single-id removal
        names the tool that removes the helper. Added again, it gets back its registry
        settings while its config entry exists, and for 30 days after that entry, or an
        entity without one, was removed. For most use cases, consider disabling instead:
        ha_set_entity(entity_id="sensor.old", enabled=False).

        BULK MODE:
        Pass a list of entity IDs to remove up to 100 at once — handy for
        clearing the restored=true orphans an integration leaves behind after
        its filters change. Removals run sequentially and return:
          {removed: [...], skipped: [...], errors: [{entity_id, code, message}]}
        where skipped = ids already absent (not-found is idempotent). A lost connection
        stops the run; not_attempted lists the ids never sent (the failing one too if
        it never left), safe to retry. Only single-id removal is auto-backed-up.

        EXAMPLES:
        - Remove orphaned sensor: ha_remove_entity("sensor.old_temperature")
        - Bulk cleanup: ha_remove_entity(["sensor.orphan_1", "sensor.orphan_2"])

        Use ha_search / ha_get_entity to verify an entity before removing it.
ha_remove_helpers_integrationstool Remove a Home Assistant helper or integration config entry.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove a Home Assistant helper or integration config entry.

        Unifies three backend removal mechanisms — simple-helper websocket
        delete, config-entry delete, and config-subentry delete — behind one
        entry point; helper_type picks the path, or the entity registry does
        when an entity_id comes without one.

        WHEN NOT TO USE:
        - Removing only an entity (without deleting its underlying helper or
          config entry) — use `ha_remove_entity` instead.
        - YAML-configured helpers — they have no storage backend. Edit the
          YAML file and reload the relevant integration.
        - ha-mcp's own ha_mcp_tools entries are refused: manage them in the HA
          UI, or (server settings, developer mode on) ha_dev_manage_settings /
          ha_dev_manage_server.

        ROUTING:
        - SIMPLE helper_type (input_button, input_boolean, input_select,
          input_number, input_text, input_datetime, counter, timer, schedule,
          zone, person, tag) + bare helper_id (its storage id) or entity_id →
          websocket delete.
        - FLOW helper_type (any helper flow Home Assistant lists: template, group,
          utility_meter, derivative, ...; custom helper integrations too)
          + full entity_id → resolve entity_id to
          config_entry_id via entity_registry, then delete the config entry. All
          sub-entities (e.g. utility_meter tariffs) are removed together. An
          entity registered by another integration is refused with
          VALIDATION_INVALID_PARAMETER and nothing is deleted.
        - subentry_id (helper_type omitted or "config_subentry") + parent
          entry_id → delete that one config subentry, whatever the target looks
          like. A subentry_id with any other helper_type is refused.
        - helper_type=None + entity_id → the entity's registry entry names its
          helper (storage type or helper flow); an entity of any other
          integration is refused with VALIDATION_INVALID_PARAMETER.
        - helper_type=None + entry_id → direct config entry delete.

        A target that cannot be removed raises a structured error rather than
        returning silent success: ENTITY_NOT_FOUND when the entity_id is absent
        from both the state machine and the entity registry, or for a bare
        helper_id no stored helper has (a bare helper_id on a FLOW target also
        raises it — FLOW resolution needs a full entity_id); RESOURCE_NOT_FOUND
        when it exists but is not storage- or registry-managed (a YAML-configured helper, or an entity with a state
        but no registry entry), for a config entry the backend reports as 404,
        or for a missing config subentry.
        Calling N times gives the same response. Transient connectivity failures
        raise their own codes (CONNECTION_FAILED, CONNECTION_TIMEOUT) so
        retry logic can branch separately.

        EXAMPLES:
        - Remove SIMPLE button: ha_remove_helpers_integrations(target="my_button", helper_type="input_button", confirm=True)
        - Remove FLOW utility_meter (any sub-entity works): ha_remove_helpers_integrations(target="sensor.energy_peak", helper_type="utility_meter", confirm=True)
        - Remove whatever helper owns an entity: ha_remove_helpers_integrations(target="sensor.energy_peak", confirm=True)
        - Remove any integration by entry_id: ha_remove_helpers_integrations(target="01HXYZ...", confirm=True)
        - Remove a config subentry: ha_remove_helpers_integrations(target="01HXYZ...", helper_type="config_subentry", subentry_id="subentry-123", confirm=True)

        WARNING: Removing a helper or integration that is referenced by
        automations, scripts, or other integrations may cause those to fail.
        Use ha_search() / ha_get_integration() to verify before removal.
        ha_manage_backup(scope="edits", action="restore") recreates removed FLOW
        helpers whose options could be snapshotted, and config subentries. It
        cannot recreate custom helper integrations (their options are withheld)
        or otp (no stored options); re-add those yourself, otp through the user
        in the HA UI.
ha_remove_todo_itemtool Remove items from a Home Assistant todo list.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove items from a Home Assistant todo list.

        Give `item` or `remove_completed=True`, not both. Removal is permanent;
        to mark an item done instead, use ha_set_todo_item() with
        status="completed". `removed` lists the items the call asked for that
        are gone afterwards; with remove_completed=True that includes a
        completed item another client removed meanwhile. With auto-backup on,
        each item is backed up before it is removed; `warnings` names a backup
        not taken because the item could not be read or the backup could not
        start, and with remove_completed=True an item gone afterwards that was
        not completed when the list was read, so was not backed up.

        EXAMPLES:
        - ha_remove_todo_item("todo.shopping_list", "Buy milk")
        - ha_remove_todo_item("todo.shopping_list", ["Buy milk", "Bread"])
        - ha_remove_todo_item("todo.shopping_list", remove_completed=True)
ha_remove_zonetool Remove a Home Assistant zone.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Remove a Home Assistant zone.

        EXAMPLES:
        - Remove zone: ha_remove_zone("office")
        - Remove by entity_id: ha_remove_zone("zone.office")

        **WARNING:** Removing a zone used in automations may cause those automations to fail.
        Use ha_get_zone() to find the zone_id for the zone you want to remove.

        **NOTE:** Zones defined in YAML, and the home zone, cannot be removed here.
ha_report_issuetool Get diagnostics and a finished GitHub issue for a bug, agent feedback or a feature request.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Get diagnostics and a finished GitHub issue for a bug, agent feedback or a feature request.

        Use it before filing any GitHub issue about ha-mcp: a bug report
        without this report is closed after 24 hours. `report_type` picks
        the kind of report; if it is unclear which, ask: "Are you reporting a
        bug in ha-mcp, giving feedback on how I used the tools, or requesting
        a feature?"

        Pass the report text in the call: the server combines it with the
        diagnostics it collects into `issue_title`, `issue_body` (the full
        report with logs) and `issue_url` (a new-issue link with title and
        body filled in, log sections left out to fit GitHub's URL limit;
        error messages stay in, with secrets redacted). A call
        without text still returns diagnostics, with placeholders in the body.

        The response is LARGE; `fields=` narrows it. Read `instructions`
        before showing anything to the user: it covers the missing-tool and
        known-client pre-checks, the duplicate check, the mandatory
        anonymisation step, and how to file the issue. Check
        `missing_tool_hint` FIRST when a tool is missing or rejects as unknown
        a parameter your tool list shows: a stale list (not a bug) is the usual cause.
ha_restarttool Execute a Home Assistant restart.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Execute a Home Assistant restart.

        WARNING: restarts the entire Home Assistant instance; all automations
        are unavailable during the restart, which typically takes 1-5 minutes.
        Config is validated automatically before the restart proceeds (to
        pre-check, call ha_get_system_health(include="config_check")). For
        configuration changes, consider ha_reload_core() instead, which reloads
        specific components without a full restart. When this server runs
        inside Home Assistant (embedded), it replies before the restart starts
        and is unreachable until Home Assistant is back; with safe_mode it
        stays down until Home Assistant is next restarted normally, because it
        is itself a custom integration.

        EXAMPLE: ha_restart(confirm=True)
ha_searchtool Search for entities (lights, sensors, switches, climate, etc.) by name, domain, or area — AND inside automation/script/scene/helper/dashboard configurations — iFilesNetworkCredentialsEnv varsSensitive pathsoutside text
Search for entities (lights, sensors, switches, climate, etc.) by name, domain, or area — AND inside automation/script/scene/helper/dashboard configurations — in one call.

        Two surfaces run in parallel and return tagged results:
          - **entities**: entity-registry matches (entity_id, friendly name,
            area). Filter with `domain_filter`/`area_filter`/`state_filter`.
          - **automations / scripts / scenes / helpers / dashboards**: matches
            *inside* config definitions — triggers, actions, sequences, scene
            entity-sets, helper bodies, dashboard cards. Driven by `query`;
            narrow with `search_types`.

        Use dedicated get/list tools first for a known resource type, including
        ha_config_get_scene for scene listing and content search. Use this for
        broader discovery or deep searches across resource types.

        For control requests with exclusions such as "except", "excluding", or
        "but not", include `is_group` and `member_entity_ids` in `result_fields`.
        Do not control an aggregate whose members include an excluded entity;
        prefer leaf entities when the exception cannot be verified safely.
        A withheld member list still returns is_group=true; absence of
        member_entity_ids must not be interpreted as a leaf entity.

        When NOT to use:
          - To read a known entity_id's state: use `ha_get_state` (cheaper).
          - To inspect one automation/script/scene config by id: use the
            matching `ha_config_get_*`.
          - To list installed Apps (add-ons): use `ha_get_app`.

        Config-body search is skipped when `domain_filter`/`area_filter`/
        `state_filter` signal entity-only intent (keeping name lookups off the
        expensive backend); a `warnings[]` entry names the skip. Repeat without
        entity filters to search configuration contents too.

        Caveats:
          - `partial: True` means results are NOT exhaustive — a surface raised,
            or the config-body branch lost data (per-id time budget exhausted,
            an individual fetch failed, or a helper-type list fetch failed).
            Empty buckets with `partial: True` mean "search failed", not "no
            results". The cause is in `partial_reason`, also mirrored into
            `warnings[]` with an "incomplete results: " prefix. Do not treat a
            partial response as complete.
          - `count` is items in this response (post-pagination), not corpus
            totals — use `entity_total_matches` + `config_total_matches`.
          - `limit`/`offset` apply per-surface. Flat `has_more`/`next_offset`
            page the next call (iterate `offset = next_offset`); per-surface
            `entity_*`/`config_*` variants show which surface still has results.

        Examples:
            - Find a light by name: ha_search("kitchen", domain_filter="light")
            - List sensors in an area: ha_search(domain_filter="sensor", area_filter="Living Room")
            - Find lights safely before an "all except one" control request:
              ha_search("living room", domain_filter="light",
              result_fields=["entity_id", "friendly_name", "is_group",
              "member_entity_ids"])
            - Which automations use an entity: ha_search("light.bed_light")
            - All unavailable entities: ha_search(state_filter="unavailable")
ha_set_area_or_floortool Create, update or reorder Home Assistant areas or floors.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create, update or reorder Home Assistant areas or floors.

        Pass kind='area' (with optional floor_id, picture, labels, temperature_entity_id,
        humidity_entity_id) or kind='floor' (with optional level).
        Provide name only to create a new entry; provide id to update an existing one.
        Cross-kind parameters (e.g., picture or labels under kind='floor') are rejected with VALIDATION_INVALID_PARAMETER.
        Pass order alone to set the order Home Assistant lists areas or floors in.
        A reorder is not covered by the auto-backup; its reply carries the order read just before it as previous_order.

        EXAMPLES:
        ha_set_area_or_floor(kind="area", name="Kitchen")
        ha_set_area_or_floor(kind="area", id="kitchen", floor_id="ground_floor")
        ha_set_area_or_floor(kind="area", id="kitchen", labels=["site_home"])
        ha_set_area_or_floor(kind="area", id="kitchen", temperature_entity_id="sensor.kitchen_temp", humidity_entity_id=None)
        ha_set_area_or_floor(kind="floor", name="Basement", level=-1)
        ha_set_area_or_floor(kind="floor", id="ground_floor", level=0)
        ha_set_area_or_floor(kind="floor", order=["first_floor", "ground_floor"])
ha_set_devicetool Update device properties such as name, area, disabled state, or labels.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Update device properties such as name, area, disabled state, or labels.

        IMPORTANT: Renaming a device does NOT rename its entities!
        Device and entity names are independent. To rename entities, use ha_set_entity(new_entity_id=...).

        Common workflow for full rename:
        1. ha_set_device(device_id="abc", name="Living Room Sensor")  # Rename device
        2. ha_set_entity("sensor.old", new_entity_id="sensor.living_room")  # Rename entities separately

        EXAMPLES:
        - Rename device: ha_set_device("abc123", name="Living Room Hub")
        - Move to area: ha_set_device("abc123", area_id="living_room")
        - Disable device: ha_set_device("abc123", disabled_by="user")
        - Enable device: ha_set_device("abc123", disabled_by="")
        - Add labels: ha_set_device("abc123", labels=["important", "sensor"])
ha_set_entitytool Update entity registry entries, or without entity_id the registry-wide settings.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Update entity registry entries, or without entity_id the registry-wide settings.

        Allows modifying entity metadata such as area assignment, display name,
        icon, "Show As" device class override, per-domain registry options,
        enabled/disabled state, visibility, aliases, labels, voice assistant
        exposure, and entity_id rename in a single call.

        BULK OPERATIONS:
        When entity_id is a list, only labels, expose_to, and categories parameters are supported.
        Other parameters (area_id, name, use_device_name, icon, device_class, options, enabled, hidden, aliases, use_entity_name_alias, new_entity_id, new_device_name) require single entity.

        SHOW AS / DEVICE CLASS: a device_class change applies instantly, no reload
        needed.

        REGISTRY OPTIONS: multi-domain options are sent as separate registry
        updates because HA's WS schema requires options_domain + options to be
        paired one domain at a time.

        ENTITY ID RENAME: Voice exposure settings are preserved automatically.

        WARNING: Renaming an entity_id does NOT update references in automations,
        scripts, templates, or dashboards. All consumers of the old entity_id must
        be updated manually — HA does not propagate the rename automatically.

        Rename limitation: an entity without a unique ID cannot be renamed.

        REGISTRY-WIDE SETTINGS: for the parameters sent, the reply has Home
        Assistant's `settings`, the `expose_new_entities` written, and the values
        they replace
        (`previous_settings`, `previous_expose_new_entities`). ha_get_entity()
        reads them.

        Use ha_search() or ha_get_device() to find entity IDs.
        Use ha_config_get_label() to find available label IDs.

        EXAMPLES:
        - Assign to area: ha_set_entity("sensor.temp", area_id="living_room")
        - Set Show As: ha_set_entity("binary_sensor.zone_10", device_class="window")
        - Set sensor precision: ha_set_entity("sensor.power", options={"sensor": {"display_precision": 2}})
        - Stop exposing new entities to Alexa: ha_set_entity(expose_new_entities={"cloud.alexa": false})
        - Rename entity and device: ha_set_entity("light.old", new_entity_id="light.new", new_device_name="New Lamp")
        - Add labels to multiple: ha_set_entity(["light.a", "light.b"], labels=["new"], label_operation="add")
        - Expose to Alexa: ha_set_entity("light.lamp", expose_to={"cloud.alexa": True})

        AUTOMATIONS AND SCRIPTS:
        For automations and scripts, enabled=False is blocked. For automations,
        use ha_config_set_automation(entity_id="automation.xxx", enabled=False)
        (or enabled=True to re-enable).
        For scripts, ha_config_set_script(script_id="script.xxx", run="stop")
        only stops a currently running execution; it does not disable the script.
        Home Assistant has no script runtime enable/disable service.
ha_set_integrationtool Manage an integration (config entry): enable/disable, add, update options, reconfigure, or send its own commands.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Manage an integration (config entry): enable/disable, add, update options, reconfigure, or send its own commands.

        Modes (pick one):
        - Enable/disable: entry_id + enabled.
        - Add integration: domain (+ menu_choice, + config) — runs the
          domain's config flow one step per call, as the HA UI does.
        - Update options: entry_id (+ menu_choice, + config) — the entry's
          options flow (what the "Configure" button does in the HA UI), one
          step per call.
        - Reconfigure: entry_id + reconfigure=True — connection settings
          such as host, port, credentials, one step per call. Each call
          except an abort first checks the entry's identity; the first call
          without config returns the flow's first step.
        - Log level: log_level + domain (or entry_id) — sets how much the
          integration logs; read it back with ha_get_integration's log_level.
        - Integration command: entry_id + ws_command (+ ws_data) — what the
          integration's panel sends (KNX project, entities, telegrams).
          Home Assistant marks none of these commands as read-only, so a read
          such as knx/get_knx_project goes through this tool too.

        Flows, one step per call: a call answers the step the flow is at and
        returns Home Assistant's next answer. A form comes back with its
        fields (type, default, current value, Home Assistant's help text) and
        flow_id; a menu with menu_options. Answer with flow_id and config (a
        form) or menu_choice (a menu); flow_id alone returns the step again,
        and flow_id with abort=True ends the flow. Without flow_id a new flow
        starts: config answers its first form, or returns it when omitted. A
        config list answers several forms, one object each in order (see a
        form's later_forms). A form Home Assistant rejects is an error with
        errors and error_text (Core's text), and the flow stays open to
        correct it, until Home Assistant finishes it or you abort it; while a
        setup flow is open, another for the same device is already_in_progress.

        WHEN NOT TO USE:
        - Helpers (template, group, utility_meter, ...): use
          ha_config_set_helper. `otp` is the user's to set up in the HA UI: its
          secret is a credential enrolled in an authenticator app; do not create it.
        - Config subentries: use
          ha_config_set_helper(helper_type='config_subentry'); subentry_type
          here describes their form; a menu_choice that finishes the flow
          saves the subentry.
        - Removing an entry: use ha_remove_helpers_integrations.
        - ha-mcp's own ha_mcp_tools entries are refused: manage them in the HA
          UI, or (server settings, developer mode on) ha_dev_manage_settings /
          ha_dev_manage_server.

        Use ha_get_integration() to find entry IDs, and
        ha_get_integration(entry_id=..., include_schema=True) to inspect the
        options fields. Its supports_reconfigure field tells you whether an
        entry qualifies for reconfigure=True, and
        ha_get_integration(entry_id=..., include_ws_commands=True) lists the
        commands ws_command accepts with their schemas.

        Caveats: adding an integration runs its config flow exactly as the HA
        UI would (may pair devices, scan the network, create entities). Flows
        requiring a browser step (OAuth) are refused at that step and
        aborted. A progress step (Home Assistant working in the background)
        is waited out for up to 120 s; after that the error carries flow_id
        to ask again. When Home Assistant does not answer a submit or a
        progress poll (or, on reconfigure, answers with any 5xx), the error
        carries status applied_but_unverified: the entry may exist or the
        change may be saved, so check it before retrying. An aborted flow
        returns Core's own text next to the key (reason_text). Reconfigure
        edits the settings a live integration connects with: a wrong host or
        credential takes it offline, and there is no automatic rollback. A
        finished reconfigure waits for the reload Home Assistant runs and
        reports the entry's state as entry_state: status applied_and_verified
        once it is loaded, applied_but_unverified otherwise.

        EXAMPLES:
        - Add: ha_set_integration(domain="local_calendar", config={"calendar_name": "Chores"})
        - Add in two steps: ha_set_integration(domain="knx", config={"connection_type": "routing"}) returns the routing form and flow_id, then ha_set_integration(domain="knx", flow_id="...", config={})
        - Answer a menu: ha_set_integration(domain="...", flow_id="...", menu_choice="<one of menu_options>")
        - See the setup form first: ha_set_integration(domain="workday")
        - Update options: ha_set_integration(entry_id="abc123", config={"scan_interval": 30})
        - Reconfigure: ha_set_integration(entry_id="abc123", reconfigure=True), then ha_set_integration(entry_id="abc123", reconfigure=True, flow_id="...", config={"host": "10.0.0.5"})
        - Cancel a flow: ha_set_integration(domain="knx", flow_id="...", abort=True)
        - Debug logging: ha_set_integration(domain="zha", log_level="DEBUG"), then log_level="DEFAULT" to stop
        - KNX project: ha_set_integration(entry_id="abc123", ws_command="knx/get_knx_project")
ha_set_todo_itemtool Create, update or reorder a todo item in Home Assistant.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create, update or reorder a todo item in Home Assistant.

        Without `item` (create mode): creates a new item from summary.
        With `item` (update mode): changes the fields given, and moves the item
        when `move_after` is given, alone or together with other changes.
        Home Assistant refuses a description or due date the list does not
        support, and says which. The reply carries `todo_item`, the item as
        Home Assistant stores it afterwards, uid included, or null with a
        warning when it cannot be read back. With auto-backup on, an updated
        item is backed up first; `warnings` names a backup that was not taken
        because the item could not be read or the backup could not start.

        EXAMPLES:
        - Add item: ha_set_todo_item("todo.tasks", summary="Pay bills", due_date="2024-12-31")
        - Complete item: ha_set_todo_item("todo.shopping_list", item="Buy milk", status="completed")
        - Rename item: ha_set_todo_item("todo.tasks", item="Old task", rename="New task name")
        - Move to top: ha_set_todo_item("todo.tasks", item="Pay bills", move_after="")
ha_set_zonetool Create or update a Home Assistant zone.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Create or update a Home Assistant zone.

        Omit zone_id to create a new zone (name, latitude, longitude required).
        Provide zone_id to update an existing zone (only specified fields change).
        Zones defined in YAML, and the home zone, cannot be changed here.

        EXAMPLES:
        - Create: ha_set_zone(name="Office", latitude=40.7128, longitude=-74.0060, radius=150, icon="mdi:briefcase")
        - Update: ha_set_zone(zone_id="office", radius=200)
        - Update by entity_id: ha_set_zone(zone_id="zone.office", radius=200)
ha_write_filetool Write a file to allowed directories in the Home Assistant config.FilesNetworkCredentialsEnv varsSensitive pathsoutside text
Write a file to allowed directories in the Home Assistant config.

        Creates or updates files (custom CSS/JS for dashboards, Jinja2 macro
        templates, theme YAML) in restricted directories only.

        Not for configuration: use ha_config_set_yaml for configuration.yaml and
        packages, and ha_config_set_automation, ha_config_set_script,
        ha_config_set_scene or ha_config_set_dashboard for storage-mode items.

        **Allowed Write Directories:**
        - `www/` - Web assets for dashboards
        - `themes/` - Theme YAML files
        - `custom_templates/` - Jinja2 template files
        - `dashboards/` - YAML-mode dashboard files
        - Plus custom directories OR HAOS sibling volumes (`/share`, `/media`, `/ssl`)
          from the ha-mcp settings UI; `/ssl` is read-only on HAOS and Supervised
        Configuration files (configuration.yaml, etc.) cannot be written; path
        traversal (../) is blocked.

        Text content only. Overwriting a file that currently holds binary
        content still succeeds, but its prior bytes cannot be captured by
        auto-backup (only modifications/deletions of text files are
        snapshotted); the skip is logged, the write is not blocked.

        With edits, nothing is saved unless every edit applies, and the rest of
        the file, line endings included, stays as it is. ha_read_file shows a
        CRLF file with LF; edits to it match either way. In a file that mixes
        CRLF and LF, a multi-line 'old' matches only lines stored with the line
        ending it uses.

        After a write, the response says what Home Assistant needs before it
        uses the file: a theme or custom template is reloaded (post_action,
        reload_service), a custom template Home Assistant cannot load (not
        *.jinja, or over its size limit) gets a warning, and a dashboards/ file
        lists the YAML dashboards that name it as their file (dashboards); they
        reread it when next opened. A file a dashboard !includes is not checked.

        EXAMPLE: ha_write_file(path="custom_templates/formatters.jinja", content="{% macro shout(text) %}{{ text | upper }}{% endmacro %}")
        EXAMPLE: ha_write_file(path="www/card.js", edits=[{"old": "const REFRESH = 30000;", "new": "const REFRESH = 10000;"}])
list_filestool List all uploaded files with metadata.
List all uploaded files with metadata.
methodtool
No description.
name_or_fntool
No description.
read_filetool Read an uploaded file's contents by name.
Read an uploaded file's contents by name.
store_filestool Store uploaded files. Receives file objects with name, size, type, data (base64).
Store uploaded files. Receives file objects with name, size, type, data (base64).
submit_formtool Validate and process form submission.
Validate and process form submission.
tooltool
No description.
tooltool
No description.
tooltool
No description.
tool.fntool
No description.

Text the model reads (158)

Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.

store_files tool
Store uploaded files. Receives file objects with name, size, type, data (base64).
list_files tool
List all uploaded files with metadata.
read_file tool
Read an uploaded file's contents by name.
submit_form tool
Validate and process form submission.
call_tools_bulk tool
Call multiple tools registered on this MCP server in a single request. Each call can
         be for a different tool and can include different arguments. Useful for speeding up
         what would otherwise take several individual tool calls.
call_tool_bulk tool
Call a single tool registered on this MCP server multiple times with a single request.
         Each call can include different arguments. Useful for speeding up what would otherwise
         take several individual tool calls.

        Args:
            tool: The name of the tool to call.
            tool_arguments: A list of dictionaries, where each dictionary contains the arguments for an individual run of the tool.
echo_tool tool
Echo the input text
greeting tool
Provides a simple info.
first_tool tool
First tool description.
tool tool
component tool
fn tool
tool tool
tool tool
name_or_fn tool
(name computed at run time) tool
tool.fn tool
(name computed at run time) tool
fn tool
fn tool
fn tool
ha_get_skill_guide tool
ha_manage_backup tool
ha_call_event tool
Execute a custom event on the Home Assistant event bus.

        When NOT to use: for controlling entities (lights, switches, climate) — use
        ha_call_service instead. To run an automation now, use
        ha_config_set_automation(entity_id=..., run_actions=True).

        Use this to publish custom event types consumed by event-triggered automations,
        Node-RED flows, or custom integrations that subscribe to specific event types.

        Caveats: Events are fire-and-forget; a successful dispatch reports the
        bus accepted the event and how many listeners were registered for it,
        not that any of them acted. A timeout means dispatch is unconfirmed.
        listener_count covers the exact event type; wildcard_listener_count
        covers match-all listeners (the recorder is one, and it only stores the
        event). The counts come from the component's dispatch reply when it
        serves the fire, otherwise from a GET /api/events lookup taken before
        dispatch; a route that cannot report them omits both fields.

        The response carries the event's context_id (and context) when Home
        Assistant reports it. An automation triggered by this event records that
        id as the parent_id of its run's context, so looking up that automation
        trace proves whether a listener acted — which the counts cannot show,
        because an event trigger that filters on event_data still registers as a
        listener when the payload does not match.

        Events fire in-process through the ha_mcp_tools component when it is
        installed, otherwise over Home Assistant's own WebSocket fire_event
        command; both carry the event type in the message body, so any type Core
        accepts fires as written and Core's rejection comes back as the error
        text (for example its 64-character event-type limit). state_changed
        alone keeps the REST route, because only that route rebuilds its
        old_state/new_state payloads into State objects; there event_type must
        be a plain name with no / \\\\ ? # or % characters.
method tool
ha_get_app tool
Get installed or available Home Assistant apps (add-ons), or details for one.

        Do not use this tool to change app state or configuration; use
        ``ha_manage_app``. Use ``slug`` for details, ``source="installed"`` for an
        inventory, or ``source="available"`` for store discovery.

        Requires Home Assistant OS or Supervised.
ha_manage_app tool
Manage Home Assistant apps (add-ons) or proxy an app API.

        For app inventory, status, and Supervisor metadata, call ``ha_get_app``
        first; use proxy mode here for documented app-specific read APIs, and
        do not infer private app API schemas.

        Use exactly one mode: lifecycle/store action, configuration fields,
        ``path`` proxy, or ``path`` with ``array_patch``.

        Requires Home Assistant OS or Supervised. When ha-mcp itself runs as an
        app it cannot update its own running slug; update ha-mcp from the Home
        Assistant Apps UI. ``options`` merges top-level keys and one nested
        mapping level; supply complete values for deeper nested mappings
        because they are replaced. Prefer Ingress: direct-port access requires
        a shared container network and may require weakening the target app
        authentication. If a Supervisor lifecycle, configuration, or repository
        write has an unknown outcome, verify durable state with ``ha_get_app``
        before retrying. That cannot prove whether ``restart`` or ``rebuild``
        ran; inspect Supervisor jobs and logs and do not automatically replay
        them. For a proxy or array-patch write, query the target app's own read
        API before retrying.
ha_list_floors_areas tool
List floors in the order Home Assistant keeps them, each with their assigned areas nested, plus areas without a floor.

        Use for location-based reasoning where floor-to-area relationships matter, such as "which rooms are on the ground floor" or operations scoped to a level.

        ha_set_area_or_floor(order=...) sets the order of the floors, and of the areas within each group. Areas without a floor assignment appear in unassigned_areas; areas whose floor_id points to a non-existent floor appear in orphaned_areas. When the ha_mcp_tools component's registries capability is available, both registries come from a single in-process snapshot, so this classification is always consistent. Without it (legacy path), the two registries are fetched via independent WebSocket calls and a registry change between reads may transiently misclassify an area.
ha_set_area_or_floor tool
Create, update or reorder Home Assistant areas or floors.

        Pass kind='area' (with optional floor_id, picture, labels, temperature_entity_id,
        humidity_entity_id) or kind='floor' (with optional level).
        Provide name only to create a new entry; provide id to update an existing one.
        Cross-kind parameters (e.g., picture or labels under kind='floor') are rejected with VALIDATION_INVALID_PARAMETER.
        Pass order alone to set the order Home Assistant lists areas or floors in.
        A reorder is not covered by the auto-backup; its reply carries the order read just before it as previous_order.

        EXAMPLES:
        ha_set_area_or_floor(kind="area", name="Kitchen")
        ha_set_area_or_floor(kind="area", id="kitchen", floor_id="ground_floor")
        ha_set_area_or_floor(kind="area", id="kitchen", labels=["site_home"])
        ha_set_area_or_floor(kind="area", id="kitchen", temperature_entity_id="sensor.kitchen_temp", humidity_entity_id=None)
        ha_set_area_or_floor(kind="floor", name="Basement", level=-1)
        ha_set_area_or_floor(kind="floor", id="ground_floor", level=0)
        ha_set_area_or_floor(kind="floor", order=["first_floor", "ground_floor"])
ha_remove_area_or_floor tool
Remove a Home Assistant area or floor.

        Removing an area unassigns its entities and devices (the entities and
        devices themselves are not removed). Removing a floor unassigns its
        areas. May break automations referencing the removed area/floor. The
        auto-backup of this call restores the area or floor itself, not the
        entities, devices or areas it carried.
ha_manage_pipeline tool
Manage Home Assistant Assist pipelines.

        Use action='list' to discover pipeline IDs, action='get' to inspect one
        pipeline, action='create' or action='update' to write pipeline settings,
        action='set_preferred' to choose the preferred pipeline, and
        action='process' to run a sentence through Assist.

        action='process' sends the sentence straight to Assist's conversation
        agent, so a matched intent executes: it turns on the light rather than
        reporting that it would. Its result carries response_type
        ('action_done', 'query_answer' or 'error') and, on an error, error_code
        such as 'no_intent_match' — Assist declining a sentence is an answer,
        not a tool failure, so inspect those fields rather than expecting a
        raised error. Use ha_call_service to act on an entity directly; use
        this to test what Assist itself understands. When the built-in agent
        answers, a matching conversation trigger runs its automation: that
        agent checks its sentence triggers before it matches intents, so this
        is not limited to intents. Even with pipeline_id, the sentence goes
        to the agent directly. So with an agent other than the built-in one, neither
        sentence triggers nor prefer_local_intents apply — a full pipeline run
        is what adds those for other agents.

        EXAMPLES:
        - Get the preferred pipeline: ha_manage_pipeline(action="get", pipeline_id="preferred")
        - Create by cloning a pipeline: ha_manage_pipeline(action="create", base_pipeline_id="preferred", name="Local Assist", conversation_engine="conversation.local_llm")
        - Update the agent and clear the TTS voice: ha_manage_pipeline(action="update", pipeline_id="preferred", conversation_engine="conversation.local_llm", tts_voice="")
        - Run a sentence through one pipeline's agent: ha_manage_pipeline(action="process", sentence="turn on the kitchen light", pipeline_id="preferred")
        - Continue a conversation: ha_manage_pipeline(action="process", sentence="and the hallway?", conversation_id="<id from the previous response>")

        Non-nullable fields such as name, language, conversation_language, and
        conversation_engine must be omitted or non-empty.
ha_manage_blueprints tool
Manage Home Assistant blueprints — list, read, import, save, delete, or render a standalone config.

        One interface for the whole blueprint lifecycle in the ``automation``
        and ``script`` domains.

        DO NOT use this to create an automation or script FROM a blueprint —
        that is ``ha_config_set_automation`` / ``ha_config_set_script`` with a
        ``use_blueprint`` config.

        To duplicate a blueprint, ``get`` it and ``save`` its ``yaml`` under a
        new ``path``; to edit one in place, ``get`` it, change the text, and
        ``save`` it back to the same ``path`` with ``overwrite=True``.

        ``get`` also reports ``used_by``: the automations or scripts built on
        the blueprint, which is the UI's "Show automations using this
        blueprint". Check it before deleting — Home Assistant refuses to delete a
        blueprint anything still uses (the error lists the consumers), and it
        goes on counting a consumer that has since taken control of its own
        config until that consumer is removed.

        CAVEATS: ``get`` returns the on-disk YAML only when something can read
        it — an in-process server, the ha_mcp_tools component, the File & YAML
        Tools entry, or the blueprint's ``source_url``; ``yaml_source`` names
        which one answered, and ``source_url`` text is a fresh download that can
        differ from the installed file. Core's blueprint API alone exposes
        metadata only, so a locally authored blueprint on a bare install has no
        readable text. Both writes are snapshotted first when a copy can be
        read, so ``ha_manage_backup(scope="edits")`` can restore the previous
        file. ``substitute`` only renders — it writes nothing, so pass the
        returned config to ``ha_config_set_automation`` /
        ``ha_config_set_script`` to persist it. To convert an automation or
        script that ALREADY exists, prefer those tools' ``take_control_of_blueprint=True``:
        it renders with that item's own current inputs and saves the result over
        itself in one call.

        EXAMPLES:
        - Get one (with its consumers in ``used_by``): ha_manage_blueprints(action="get", path="homeassistant/motion_light.yaml")
        - Import: ha_manage_blueprints(action="import", url="https://example.com/bp.yaml")
        - Edit in place: ha_manage_blueprints(action="save", path="user/motion.yaml", yaml=<edited text>, overwrite=True)
        - Delete: ha_manage_blueprints(action="delete", path="user/motion.yaml", confirm=True)
        - Render standalone: ha_manage_blueprints(action="substitute", path="user/motion.yaml", input={"motion_sensor": "binary_sensor.hall"})

        RELATED TOOLS: ``ha_config_remove_automation`` / ``ha_config_remove_script``
        to clear consumers blocking a delete, ``ha_search`` to find them.
ha_report_issue tool
Get diagnostics and a finished GitHub issue for a bug, agent feedback or a feature request.

        Use it before filing any GitHub issue about ha-mcp: a bug report
        without this report is closed after 24 hours. `report_type` picks
        the kind of report; if it is unclear which, ask: "Are you reporting a
        bug in ha-mcp, giving feedback on how I used the tools, or requesting
        a feature?"

        Pass the report text in the call: the server combines it with the
        diagnostics it collects into `issue_title`, `issue_body` (the full
        report with logs) and `issue_url` (a new-issue link with title and
        body filled in, log sections left out to fit GitHub's URL limit;
        error messages stay in, with secrets redacted). A call
        without text still returns diagnostics, with placeholders in the body.

        The response is LARGE; `fields=` narrows it. Read `instructions`
        before showing anything to the user: it covers the missing-tool and
        known-client pre-checks, the duplicate check, the mandatory
        anonymisation step, and how to file the issue. Check
        `missing_tool_hint` FIRST when a tool is missing or rejects as unknown
        a parameter your tool list shows: a stale list (not a bug) is the usual cause.
ha_config_get_calendar_events tool
Get calendar events from a calendar entity within a time range.

        Returns each event's summary, start, end, description and location,
        plus the uid, recurrence_id and rrule when the calendar provides them
        (the edit and remove tools use uid and recurrence_id). To find calendar
        entities, use ha_search(domain_filter='calendar').

        EXAMPLES:
        - Next week (defaults): ha_config_get_calendar_events("calendar.family")
        - Date range: ha_config_get_calendar_events("calendar.work", start="2024-01-01T00:00:00", end="2024-01-31T23:59:59")
ha_config_set_calendar_event tool
Create a new event in a calendar, or update an existing one.

        Passing ``uid`` switches to update mode.

        **When NOT to use:**
        - To retrieve calendar events, use ``ha_config_get_calendar_events``.
        - To delete an event, use ``ha_config_remove_calendar_event``.
        - To find the ``uid`` of an event to update, use
          ``ha_config_get_calendar_events``; this tool does not search.

        Passing date-only values (``YYYY-MM-DD``) for both ``start`` and
        ``end`` creates an all-day event; passing full ISO datetimes creates
        a timed event. Home Assistant refuses a mix of the two.

        An update replaces the whole event rather than patching it, so
        ``summary``, ``start`` and ``end`` stay required in update mode, and a
        ``description`` or ``location`` that is not re-supplied is cleared.
        An ``rrule`` is the exception: Home Assistant accepts a new rule but
        has no way to express "no recurrence", so an existing rule survives an
        update that omits it. Delete the event and create it again to drop the
        recurrence.

        Which writes a calendar accepts depends on its integration; Home
        Assistant refuses a create or update the calendar does not support,
        and its error says so.

        EXAMPLES:
        - Create: ha_config_set_calendar_event("calendar.family", summary="Doctor appointment", start="2024-01-15T14:00:00", end="2024-01-15T15:00:00")
        - Recurring (every Monday, 10 occurrences): ha_config_set_calendar_event("calendar.work", summary="Team meeting", start="2024-01-15T10:00:00", end="2024-01-15T11:00:00", rrule="FREQ=WEEKLY;BYDAY=MO;COUNT=10")
        - Update this and all later occurrences: ha_config_set_calendar_event("calendar.work", summary="Team meeting (new time)", start="2024-02-05T11:00:00", end="2024-02-05T12:00:00", uid="recurring-event-67890", recurrence_id="20240205T100000", recurrence_range="THISANDFUTURE")
ha_config_remove_calendar_event tool
Delete an event from a calendar.

        Get the event UID from ha_config_get_calendar_events().

        EXAMPLES:
        - Delete a single event: ha_config_remove_calendar_event("calendar.family", uid="event-12345")
        - Delete one occurrence and all later ones: ha_config_remove_calendar_event("calendar.work", uid="recurring-event-67890", recurrence_id="20240115T100000", recurrence_range="THISANDFUTURE")
ha_get_camera_image tool
Get a snapshot image from a Home Assistant camera or image entity.

        Returns the image in its served format, with its available dimensions
        and retrieval time in Home Assistant local time. Use ha_get_state for
        entity state and attributes. Use this tool to inspect a camera scene
        or view content such as a QR code, album cover, or map.

        EXAMPLES:
        ha_get_camera_image(entity_id="camera.backyard", width=640, height=480)
        ha_get_camera_image(entity_id="image.album_art")
ha_config_get_category tool
Get category info - list all categories for a scope or get a specific one by ID.

        Without a category_id: Lists all Home Assistant categories for the given scope.
        With a category_id: Returns configuration for that specific category.

        Categories are domain-scoped organizational groups for automations, scripts, scenes, and helpers.

        EXAMPLES:
        - List helper categories: ha_config_get_category("helpers")
        - Get specific category: ha_config_get_category("automation", category_id="my_category_id")

        Use ha_config_set_category() to create or update categories.
        Use ha_set_entity(categories={"automation": "category_id"}) to assign categories to entities.
ha_config_set_category tool
Create or update a Home Assistant category.

        Creates a new category if category_id is not provided, or updates an existing category if category_id is provided.

        Categories are domain-scoped organizational groups for automations, scripts,
        scenes, and helpers. Unlike labels (which are cross-domain), categories are
        specific to a single domain scope.

        EXAMPLES:
        - Create automation category: ha_config_set_category(scope="automation", name="Lighting")
        - Create with icon: ha_config_set_category(scope="automation", name="Security", icon="mdi:shield")
        - Update category: ha_config_set_category(scope="automation", category_id="my_category_id", name="Updated Name")

        After creating a category, use ha_set_entity(categories={"automation": "category_id"}) to assign it.
ha_config_remove_category tool
Delete a Home Assistant category.

        Removes the category from the category registry for the given scope, and
        from every entity in that scope that had it. The auto-backup of this call
        restores the category itself, under a new id, not the entities that had it.

        To move one entity to another category or out of its category and keep the
        category, use ha_set_entity(categories=...) instead.

        EXAMPLES:
        - Delete category: ha_config_remove_category("automation", "my_category_id")

        Use ha_config_get_category() to find category IDs.
ha_manage_custom_tool tool
Create and run a custom tool in a sandbox, or manage saved custom tools.

        LAST RESORT — search for existing tools first.

        **Modes** (mutually exclusive): ``code`` + ``justification``;
        ``run_saved``; ``list_saved=True``.

        **Available functions in sandbox:**
        - ``api_get(endpoint)`` / ``api_post(endpoint, data)`` — HA REST API,
          for operations not covered by existing tools
        - ``ws_send(message)`` — send a HA WebSocket command, for operations
          only available over WebSocket (most registry CRUD, template rendering,
          Lovelace operations). ``message`` must include a ``"type"`` field; the
          MCP server adds ``id`` and handles auth.
        - ``call_tool(name, args)`` — call a registered MCP tool
        - ``delete_saved_tool(name)`` — remove a previously saved custom tool.
          Returns ``{"deleted": True, "name": name}`` or ``{"error": ...}``.

        Saved tools persist across server restarts when
        ``CODE_MODE_SAVED_TOOLS_PATH`` is set (the app sets this by default to
        ``/data/saved_tools.json``).

        Example — list areas via WebSocket:
        ```python
        result = await ws_send({"type": "config/area_registry/list"})
        result.get("result", [])
        ```

        Example — chain existing tools:
        ```python
        result = await call_tool("ha_search", {"query": "light", "limit": 5})
        lights = result.get("entities", [])
        for e in lights:
            await call_tool("ha_call_service", {"domain": "light", "service": "turn_off", "entity_id": e["entity_id"]})
        {"turned_off": len(lights)}
        ```
ha_config_get_automation tool
Get a Home Assistant automation's stored configuration.

        `config` is the body Home Assistant stores, as it stores it; its
        `config_hash` stays the same across reads of an unchanged automation.
        `entity` is the automation's entity registry row, `validation` holds
        Home Assistant's status and error when the automation failed to load
        (None when it loaded), and `references` lists the entities, devices,
        areas, floors, labels and blueprint it uses. `references` is None
        without the ha_mcp_tools component's automation_config bridge and
        while Home Assistant has not loaded the automation (disabled, or it
        failed to load); `warnings` says which. Without the bridge, `related`
        holds Home Assistant's Related set for the automation instead, keyed
        by item type: what it uses plus their devices, areas, floors and
        integrations. `automation_id` is the resolved entity_id, falling back
        to the input.

        EXAMPLES:
        - Get automation: ha_config_get_automation("automation.morning_routine")
        - Get by config id: ha_config_get_automation("1712345678901")

        For comprehensive automation documentation, use ha_get_skill_guide.
ha_config_set_automation tool
Create or update a Home Assistant automation.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.

        Prefer native triggers/conditions/actions over templates in logic
        positions; templates belong only in `data.*`, notification text,
        `event_data` and `variables`. The best-practice checker reports
        violations under `best_practice_warnings` — fix them before
        re-submitting. `triggers-and-conditions.md`, `automation-actions.md` and
        `template-guidelines.md` ship under `skill_content` by default. Test any unavoidable template
        with ha_eval_template first.

        Consider a dedicated tool first: a state snapshot with no trigger ->
        ha_config_set_scene; a value derived from other entities ->
        ha_config_set_helper(helper_type='template'); a counter / timer /
        schedule / boolean -> ha_config_set_helper.

        MODES (pick one; each can also take `enabled`, which alone with
        `entity_id` turns the automation on or off without touching config):
        - python_transform: surgical edits to an existing automation. Requires
          entity_id and config_hash from ha_config_get_automation(). Operates on
          the stored config exactly as ha_config_get_automation returns it, e.g.
          python_transform="config['triggers'].append({'trigger': 'state', 'entity_id': 'binary_sensor.motion', 'to': 'on'})"
        - config: new automations or full restructures. Regular automations have
          triggers and actions; blueprint automations have use_blueprint
          {path, input}. Home Assistant validates the config, and a rejection
          carries its own error text.
        - take_control_of_blueprint: convert a blueprint-backed automation into a
          standalone one. Takes no config of its own.

        IDENTITY: omit entity_id and config['id'] to create with a generated ID.
        Reusing an entity_id targets the same automation even if the alias
        changes; to rename or replace it, read it first and pass its
        config_hash — a changed alias without that hash is rejected before
        writing. `operation` says whether the write created or updated it.

        EXAMPLES:
        - Create: ha_config_set_automation(config={"alias": "Morning Lights", "triggers": [{"trigger": "time", "at": "07:00:00"}], "actions": [{"action": "light.turn_on", "target": {"area_id": "bedroom"}}]})
        - From a blueprint: ha_config_set_automation(config={"alias": "Motion Light Kitchen", "use_blueprint": {"path": "homeassistant/motion_light.yaml", "input": {"motion_entity": "binary_sensor.kitchen_motion", "light_target": {"entity_id": "light.kitchen"}}}})
        - Update: current = ha_config_get_automation(entity_id="automation.x"); ha_config_set_automation(entity_id="automation.x", config_hash=current["config_hash"], config={...})
        - Disable: ha_config_set_automation(entity_id="automation.x", enabled=False)
        - Run now: ha_config_set_automation(entity_id="automation.x", run_actions=True)
        - Take control: ha_config_set_automation(entity_id="automation.x", take_control_of_blueprint=True)

        TAKE CONTROL is one-way: later blueprint edits stop reaching the
        automation; to change an input value, update 'use_blueprint.input'
        instead. It does NOT free the blueprint — Home Assistant keeps counting
        the converted automation as a user, so deleting that blueprint stays
        refused until the automation is removed (an automation reload does not
        clear it). The response names the blueprint in
        `took_control_of_blueprint`. To preview the rendering without writing
        anything, use ha_manage_blueprints(action="substitute", path=..., input=...).
ha_config_remove_automation tool
Delete a Home Assistant automation permanently.

        A disabled automation is removed too. The returned `automation_id` is
        the resolved entity_id, falling back to the input.

        EXAMPLES:
        - Delete automation: ha_config_remove_automation("automation.old_automation")
        - Delete by config id: ha_config_remove_automation("1712345678901")
ha_config_get_dashboard tool
Get Lovelace dashboards: list them, read one config, or search their cards.

        Not for a render alone: ha_get_dashboard_screenshot (screenshot beta
        feature) returns images without the config. Not for entity discovery:
        use ha_search.

        The parameters pick the mode:
        - list_only=True: storage and YAML dashboards alike.
        - Any of query / entity_id / card_type / heading searches cards and
          header cards, AND-ing the criteria, in url_path or, when it is
          omitted, every storage dashboard. View badges answer entity_id and
          query, and heading excludes them.
          Cards nested at any depth count, including
          custom cards' own keys such as groups[].cards[].card. Nesting is
          found heuristically, under the keys cards, card, custom_fields and
          states; a card under any other key is read only as its parent's
          text, by query. Each match has a
          jq_path and a python_path to append to `config` in
          ha_config_set_dashboard(python_transform=...), e.g.
          f'config{m["python_path"]}["icon"] = "mdi:x"'. Each match carries its
          dashboard's url_path and config_hash; a one-dashboard search also
          returns the config_hash at the top level.
        - Otherwise the full config of url_path (the default dashboard when
          omitted) is returned; with view_path only that view, while config_hash
          still covers the full config. stored_config is false (config null)
          when Home Assistant holds no config for the dashboard.

        Caveats: config_hash stays the same across reads of an unchanged config.
        Searches stop at 200 matches (`truncated`). A search across dashboards
        skips YAML dashboards (HA resolves !secret in them) and, without a
        current ha_mcp_tools component, the default dashboard (with a warning);
        name either by url_path.
        Strategy dashboards have no stored cards to search. An unknown view_path
        errors and lists the available ones.

        EXAMPLES:
        - List all dashboards: ha_config_get_dashboard(list_only=True)
        - Get one view only: ha_config_get_dashboard(url_path="lovelace-mobile", view_path="office")
        - Find cards by entity (wildcards allowed): ha_config_get_dashboard(url_path="my-dash", entity_id="sensor.temperature_*")
        - Find heading: ha_config_get_dashboard(url_path="my-dash", heading="Climate", card_type="heading")
        - Which dashboards use an entity: ha_config_get_dashboard(query="light.bedroom")
        - Fields of a card type before writing one (omit card_type to list types):
          ha_config_get_dashboard(card_type="tile", describe=True)
ha_config_set_dashboard tool
Create or update a Home Assistant dashboard.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.
        `dashboard-guide.md` ships under `skill_content` by default. A card's
        fields: ha_config_get_dashboard(card_type=..., describe=True).

        MODES (pick one):
        - patch: edit known paths with literal values using JSON Patch
          add/remove/replace/test and config_hash, e.g.
          patch=[{"op": "replace", "path": "/views/0/title", "value": "Home"}].
          move/copy are unsupported. Full guide:
          https://github.com/homeassistant-ai/ha-mcp/blob/master/docs/dashboard-edits.md
        - python_transform: loops or pattern-based changes across cards and views,
          e.g. 'config["views"][0]["cards"].append({"type": "button", "entity": "light.bedroom"})'.
          After delete/add operations indices shift, so chain multiple ops in ONE
          expression where possible; a later call needs a fresh config_hash from
          ha_config_get_dashboard().
        - config: new dashboards only, or a full restructure. Replaces everything.
          Omit it to create a dashboard without initial config.

        Use ha_config_get_dashboard(entity_id=...) to get the path of any card,
        and ha_search / ha_get_overview to find entity IDs — never guess them.
        For visual re-checks after the write, use ha_get_dashboard_screenshot
        (when available) instead of re-sending config.

        title/icon/require_admin/show_in_sidebar can be updated in a
        metadata-only call or alongside a full config replacement; with
        python_transform or patch, update metadata in a separate call (combining
        it with patch is rejected). Strategy dashboards (config
        {"strategy": {...}}) cannot be converted to custom dashboards here; use
        "Take Control" in the Home Assistant UI.

        EXAMPLE:
        ha_config_set_dashboard(url_path="home-dashboard", title="Home Overview",
            config={"views": [{"title": "Home", "type": "sections", "sections": [{"title": "Climate", "cards": [{"type": "tile", "entity": "climate.living_room"}]}]}]})

        This tool manages storage-mode dashboards only. YAML-mode dashboards (a
        .yaml file registered under ``lovelace: dashboards:`` in
        configuration.yaml) and dashboards inlined under ``lovelace:`` are
        edited in their .yaml file; ``ha_config_set_yaml`` can update the
        ``lovelace:`` registration but not the dashboard body.
ha_config_delete_dashboard tool
Delete a storage-mode dashboard completely.

        WARNING: This deletes the dashboard and all its configuration; with auto-backup
        on, ha_manage_backup(scope='edits', action='restore') re-creates it. YAML-mode
        dashboards are defined in configuration.yaml and cannot be deleted via the API.

        HA internal IDs may differ from url_path (e.g. hyphens → underscores); the tool resolves
        either form to the actual registry ID before deletion. 'default' is an
        alias for 'lovelace'.

        EXAMPLES:
        - Delete dashboard: ha_config_delete_dashboard("mobile-dashboard")
ha_config_list_helpers tool
List Home Assistant helpers of a specific type with their configurations.

        Returns one page of helpers; `total_count` and `has_more` report the full
        set. Each record carries the configuration for its helper:
        id (immutable storage key), entity_id (current — address the helper by
        this, where available), name (current display name), original_name
        (creation-time name), icon, type-specific settings, and area and label
        assignments. A flow helper record carries entry_id and options instead of
        id; a custom helper integration's options are withheld, marked
        `options_withheld`.

        For a helper renamed in the UI, id/original_name keep the storage values while
        entity_id/name reflect the current entity registry (entity_id is the identifier
        ha_config_set_helper resolves against, so prefer it over id for a renamed helper).
        entity_id/original_name are present only for storage-collection helpers matched in
        the entity registry — types with no backing entity (e.g. tag), and every record when
        the registry read degrades, carry only id/name (a warning flags the degraded case).

        Storage types list what HA's ``{type}/list`` command returns: the
        storage-backed helpers (created via UI/API), not the YAML-defined ones.
        ``person`` is the exception — HA lists its YAML-configured persons
        alongside the storage ones, so both appear here.

        Listing flow types requires the ha_mcp_tools custom component (>= 1.1.0);
        without it, such a listing returns a COMPONENT_NOT_INSTALLED error.

        With helper_type="all", each record carries its own ``helper_type``.
        This mode is component-only (there is no single built-in command that
        lists all types): without the ha_mcp_tools component it returns a
        COMPONENT_NOT_INSTALLED error rather than a partial or empty list.

        describe=True returns each field's name, type, required flag, options,
        default and (with helper_id) current value, the later_forms of a
        helper with several forms, or the menu_options a menu-based helper
        needs a menu_choice from. Call it before ha_config_set_helper.

        EXAMPLES:
        - List all counters: ha_config_list_helpers("counter")
        - List every helper type at once: ha_config_list_helpers("all")
        - Next page: ha_config_list_helpers("input_boolean", offset=100)
        - Fields for a template sensor:
          ha_config_list_helpers("template", describe=True, menu_choice="sensor")

        For detailed helper documentation, use ha_get_skill_guide.
ha_config_set_helper tool
Create or update Home Assistant helpers: storage types, every helper
        flow HA lists, and config subentries.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.
        ``helper-selection.md`` ships under ``skill_content`` by default.

        SIMPLE types, written in one call: input_boolean, input_button,
        input_select, input_number, input_text, input_datetime, counter, timer, schedule,
        zone, person, tag.

        FLOW types: every helper flow Home Assistant lists, read from it at
        call time — template, group, utility_meter, derivative, min_max,
        threshold, integration, statistics, trend, ... and custom helper
        integrations. Creating one runs its config flow; `helper_id` (the
        config entry id) runs its options flow instead.
        Do not create `otp` here although Home Assistant lists it: the user sets
        it up in the HA UI, since its secret is a credential they enroll in an
        authenticator app.

        CONFIG_SUBENTRY type: pass `entry_id` and `subentry_type`; with
        `subentry_id` the subentry's reconfigure flow runs, without it its
        create flow.

        Flows, one step per call, as the HA UI runs them: a call answers the
        step the flow is at and returns Home Assistant's next answer. A form
        comes back with its fields (type, default, current value, Home
        Assistant's help text) and flow_id; a menu with menu_options. Answer
        with flow_id and config (a form) or menu_choice (a menu); flow_id alone
        returns the step again, and flow_id with abort=True ends the flow.
        Without flow_id a new flow starts: menu_choice answers its opening
        menu and config the form after it, so a one-form helper is created or
        updated in one call; without config the call returns the form, and
        its later_forms when the helper has more than one (statistics,
        history_stats, generic_thermostat, ...). With a config list the call
        answers form after form and returns at the first one Home Assistant
        rejects, or once the answers run out. A rejected form is an error
        with Core's text, and the flow stays open to correct it. Nothing is
        saved until the flow finishes.

        WHEN NOT TO USE:
        - An integration that is not a helper: ha_set_integration.
        - Removing a helper: ha_remove_helpers_integrations.
        - Renaming a flow helper's entity, or its registry settings alone:
          ha_set_entity.

        Behavior:
        - A SIMPLE update preserves type-specific fields not re-passed (a rename
          never wipes initial/icon/etc.).
        - Omitted `action`: update when `helper_id` (for a config subentry,
          `subentry_id`) is given, else create.
        - area_id, labels, category and icon are applied to a flow helper's
          entities by the call that finishes the flow.
        - A progress step (Home Assistant working in the background) is waited
          out for up to 120 s. When Home Assistant does not answer a submit,
          the error carries status applied_but_unverified: check the helper
          before retrying.

        EXAMPLES:
        - input_number: ha_config_set_helper(helper_type="input_number", name="Target", config={"min": 0, "max": 100, "step": 5})
        - template sensor: ha_config_set_helper(helper_type="template", menu_choice="sensor", config={"name": "Room Temp", "state": "{{ states('sensor.x')|float }}", "unit_of_measurement": "°C"})
        - group: ha_config_set_helper(helper_type="group", menu_choice="light", config={"name": "Kitchen Lights", "entities": ["light.a", "light.b"]})
        - see a form first: ha_config_set_helper(helper_type="statistics"), then answer it: ha_config_set_helper(helper_type="statistics", flow_id="...", config={...})
        - several forms in one call: ha_config_set_helper(helper_type="statistics", config=[{"name": "Temp Mean", "entity_id": "sensor.temp"}, {"state_characteristic": "mean"}, {"sampling_size": 20}])
        - update one option: ha_config_set_helper(helper_type="group", helper_id="01HXYZ...", config={"hide_members": true})
        - config subentry: ha_config_set_helper(helper_type="config_subentry", entry_id="01HXYZ...", subentry_type="conversation", config={"name": "Local agent", "model": "gemma3:27b"})
ha_config_get_scene tool
Get a scene's complete configuration, or list and search scenes without scene_id.

        Use ha_search for cross-domain discovery and dependency searches. For ordinary
        scene discovery, use this tool and pass a returned scene_id back to retrieve
        the complete entities dict and config_hash for editing (pass that hash to
        ha_config_set_scene for python_transform updates).

        Listing returns compact metadata. Integration-managed scenes have no editable
        storage config or scene_id. Partial content-search results explicitly
        report unread configs and are not exhaustive.

        EXAMPLES:
        - Get scene: ha_config_get_scene("movie_night")
        - Find scenes: ha_config_get_scene(query="movie")
        - Find attribute values: ha_config_get_scene(query="rainbow", search_in_config=True)

        For detailed scene configuration help, use ha_get_skill_guide.
ha_config_set_scene tool
Create or update a Home Assistant scene.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.

        Supports two modes: full config replacement (``config``) or
        Python transformation of an existing scene (``python_transform``).
        See the field descriptions for ``python_transform`` examples and
        the ``config`` shape contract. Either mode can also take
        ``activate``, which can be passed alone with ``scene_id`` to activate
        a scene without touching its config.

        WHEN TO USE:
        - ``python_transform``: surgical edits to an existing scene
          (add/remove/update a single entity entry).
        - ``config``: creating a new scene, or wholesale replacement; with
          ``capture_entities`` or ``capture_devices``, from current states.
        - ``activate`` (with scene_id, no config): activate any scene,
          e.g. ha_config_set_scene(scene_id="scene.movie_night", activate=True).

        WHEN NOT TO USE:
        - To list or look up existing scenes, use ha_config_get_scene.

        SCENE SHAPE: Automations use a list of actions; scenes capture a snapshot
        of states as a dict.

        EXAMPLE:

        ha_config_set_scene(scene_id="movie_night", config={
            "name": "Movie Night",
            "entities": {
                "light.living_room": {"state": "on", "brightness": 50},
            },
            "icon": "mdi:movie",
        })

        The top-level ``SKILL.md`` for home-assistant-best-practices ships in
        this response under ``skill_content`` by default — generic
        best-practice index covering entity-naming and
        safe-refactoring patterns that intersect with scene authoring. For
        detailed scene configuration help beyond that, use ha_get_skill_guide.
ha_config_remove_scene tool
Delete a Home Assistant scene.

        EXAMPLE: ha_config_remove_scene("old_scene")

        Deletes a scene from Home Assistant's editable scene storage
        (``scenes.yaml`` entries with an ``id``, as the UI and
        ha_config_set_scene write them) or one made by ``scene.create``
        (through Core's ``scene.delete``); a scene defined elsewhere in YAML or
        by an integration is CONFIG_NOT_FOUND.

        The scene is deleted even when automations or scripts reference it;
        the ones Home Assistant's related search finds are listed in
        ``referenced_by``, with a warning.
ha_config_get_script tool
Get Home Assistant script configuration.

        Returns the complete configuration for a script, including sequence, mode, fields, and other settings.

        The returned `config_hash` stays the same across consecutive reads of an unchanged config.

        The returned `script_id` is the canonical bare storage key resolved by the REST client (matching what `ha_config_set_script` / `ha_config_remove_script` expect), falling back to the input identifier on the rare path where the REST envelope omits it. A bare id names the script stored under that key first; `script.<x>` names that entity's script, or the script stored under key `<x>` when no entity has that id.

        EXAMPLES:
        - Get script (bare form): ha_config_get_script("morning_routine")
        - Get script (entity_id form): ha_config_get_script("script.morning_routine")

        For detailed script configuration help, use ha_get_skill_guide.
ha_config_set_script tool
Create or update a Home Assistant script.

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.

        Prefer native actions (`choose` / `if`, `wait_for_trigger`, `repeat`,
        `for:`) over templates in logic positions; templates belong only in
        `data.*`, notification text, `event_data` and `variables`. The
        best-practice checker reports violations under `best_practice_warnings`.
        `automation-actions.md`, `triggers-and-conditions.md` and
        `template-guidelines.md` ship under `skill_content` by default.

        Scripts use 'sequence', NOT 'trigger' or 'action'; for trigger-based
        execution use ha_config_set_automation.

        MODES (pick one):
        - python_transform: surgical edits to an existing script. Requires
          config_hash from ha_config_get_script(), e.g.
          python_transform="config['sequence'].append({'delay': {'seconds': 5}})"
        - config: new scripts or full restructures. Needs 'sequence' (regular) or
          'use_blueprint' {path, input} (blueprint-based).
        - take_control_of_blueprint: convert a blueprint-backed script into a
          standalone one. Takes no config of its own.
        - run (alone with script_id): 'start' runs the script (optional
          variables), 'stop' stops its running executions. Write config changes
          in a separate call first: Home Assistant signals no completion of the
          script reload a write triggers.

        EXAMPLES:
        - Create: ha_config_set_script(script_id="blink_light", config={"alias": "Light Blink", "sequence": [{"action": "light.turn_on", "target": {"entity_id": "light.living_room"}}, {"delay": {"seconds": 2}}, {"action": "light.turn_off", "target": {"entity_id": "light.living_room"}}]})
        - From a blueprint: ha_config_set_script(script_id="notification_script", config={"alias": "My Notification Script", "use_blueprint": {"path": "notification_script.yaml", "input": {"message": "Hello World"}}})
        - Take control: ha_config_set_script(script_id="notification_script", take_control_of_blueprint=True)

        TAKE CONTROL is one-way: later blueprint edits stop reaching the script;
        to change an input value, update 'use_blueprint.input' instead. It does
        NOT free the blueprint — Home Assistant keeps counting the converted
        script as a user, so deleting that blueprint stays refused until the
        script is removed. To preview the rendering without writing anything,
        use ha_manage_blueprints(action="substitute", domain="script", path=..., input=...).
ha_config_remove_script tool
Delete a Home Assistant script.

        EXAMPLE: ha_config_remove_script("old_script")

        Only scripts created via the Home Assistant UI can be deleted. Scripts
        defined in YAML configuration files (scripts.yaml or configuration.yaml)
        cannot be deleted through the API and return a 405 Method Not Allowed
        error; edit the configuration file directly instead.

        WARNING: Deleting a script that is used by automations may cause those automations to fail.
ha_get_dashboard_screenshot tool
Get rendered images of a Home Assistant Lovelace dashboard view.

        When not to use: while reading or writing dashboard configuration, use
        ha_config_get_dashboard(include_screenshot=True) or
        ha_config_set_dashboard(return_screenshot=True) for a single workflow.

        Use it for repeatable visual checks, including ordered mobile, tablet,
        and desktop captures. The engine returns image bytes but does not
        confirm that the frontend accepted a requested theme or language;
        structured metadata therefore records the values sent to the engine.
        WPE Screenshot Engine applies frontend preferences temporarily. Puppet
        may persist requested theme or dark-mode changes on the engine account;
        ha-mcp reports detected changes in warnings but does not undo them (see
        ha_manage_theme action='set_engine_theme').

        To change the screenshot engine app's own options or restart it, use
        ha_manage_app.
ha_dev_manage_settings tool
Manage ha-mcp server settings and the Tools/Policies/Backups surfaces (developer mode).

        Drives everything the web settings UI can change: the Server
        Settings matrix, the Tools tab, the Tool Security Policies editor,
        and agent-editable backup config. Snapshot Actions and Backup Read
        Only are human-only controls. Use ha_dev_manage_server for
        the live approval queue and to restart.

        When NOT to use: for HA entity/automation configuration use the
        ha_config_* tools.

        Caveats: enable/disable/pin and most server settings take effect
        only after a restart (ha_dev_manage_server action="restart");
        LLM-API exposure, security gates, and policy edits apply live.
        Env-pinned settings/tools are read-only until the env var is unset.
        These actions can flip security-sensitive state — treat with the
        same care as editing the web UI. The policy-override surfaces
        (set_policy, set_tool with gated=, and set/reset of
        enable_tool_security_policies) additionally require the
        'dev_tools_security_policy_access' setting, which is off by
        default; reads are always available. That setting itself is never
        writable by these tools — change it in the web settings UI or via
        HAMCP_DEV_SECURITY_POLICY_ACCESS.

        EXAMPLES:
        ha_dev_manage_settings("list_tools")
        ha_dev_manage_settings("set_tool", tool="ha_write_file", state="disabled")
        ha_dev_manage_settings("set_tool", tool="ha_call_service", gated=True)
        ha_dev_manage_settings("get_policy")
        ha_dev_manage_settings("set_backup_config", backup={"enable_auto_backup": False})
ha_dev_manage_server tool
Manage the running ha-mcp server itself (developer mode).

        When NOT to use: to restart Home Assistant use ha_restart; to
        update Home Assistant Apps (add-ons) or Marketplace repositories use
        ha_manage_app / ha_manage_hacs.

        Caveats: update_source changes ONLY the ha_mcp_tools custom
        component's separate in-process server entry — it never updates
        the app (add-on), Docker, standalone, or PyPI server that may be
        serving this connection (update those via ha_manage_app /
        docker pull / pip). In embedded mode that entry IS this server,
        so the update self-interrupts; elsewhere this connection is
        untouched and keeps its current version. Success means the
        entry's options were applied — the component then reinstalls in
        the background, which can take minutes and can still fail
        (check HA logs). update_source requires the component's
        in-process server entry to exist. restart interrupts this MCP
        connection in embedded and app deployments (the reply
        arrives just before the server goes down) and supports those
        two deployments only (standalone processes must be restarted
        externally). approve/deny require the separate
        'dev_tools_security_policy_access' setting, off by default.

        EXAMPLES:
        ha_dev_manage_server("update_source", pip_spec="https://github.com/homeassistant-ai/ha-mcp/archive/refs/pull/1234/head.tar.gz")
        ha_dev_manage_server("update_source", pip_spec="clear")
        ha_dev_manage_server("approve", token="abc123")
ha_manage_energy_prefs tool
Manage the Home Assistant Energy Dashboard preferences: grid / solar /
        battery / gas / water energy sources, device consumption sensors for
        electricity and water, and cost tariffs.

        WHEN NOT TO USE:
        - To create the underlying statistics themselves — they must already
          exist as HA entities before being referenced here; create them via
          the relevant integration's config flow first.

        WHEN TO USE:
        - mode='get' / 'set': inspect or replace the full Energy Dashboard
          config. Use 'set' for bulk edits or anything touching multiple
          top-level keys at once.
        - mode='add_device' / 'remove_device': add or remove a single
          device-consumption entry. The tool performs a fresh read-modify-write
          internally.
        - mode='add_source': append a single entry to ``energy_sources``.
          Same internal read-modify-write.

        RELATED TOOLS: Use ha_get_history(source="statistics") with the returned
        statistic IDs for consumption, totals, and trends. Metadata comes directly
        from the running Core, including stored and display units.

        CAVEATS:
        - ``energy/save_prefs`` has per-key FULL-REPLACE semantics. Passing
          ``{"device_consumption": [<one entry>]}`` deletes every other device
          the user had configured — silently, with no error.
        - The per-key ``config_hash`` form lets an agent submit only the
          top-level key it wants to change: ``config`` keys must equal the dict
          keys, and a per-key submission still fully replaces
          that key's value. A mismatch on any locked key returns
          ``RESOURCE_LOCKED`` with the offending keys in ``mismatched_keys``.
        - ``dry_run=True`` skips the hash check entirely for both forms.
        - Writes need an administrator token; Home Assistant rejects the save
          otherwise.
        - After a successful write, the tool calls ``energy/validate`` and
          returns residual issues (missing stats, unit mismatches) as
          ``post_save_validation_errors``; the save persists regardless —
          correct the config and write again if needed.
        - 'add_source' rejects duplicates by ``(type, stat_energy_from)`` for
          solar/battery/gas/water; grid entries are appended without a duplicate
          check (multiple grid variants are legitimate), so the caller
          de-duplicates grid sources.

        EXAMPLES:
        - ha_manage_energy_prefs(mode="get", include_schema=True)
        - Preview a device: ha_manage_energy_prefs(mode="add_device", stat_consumption="sensor.fridge_energy", dry_run=True)
        - Remove a device: ha_manage_energy_prefs(mode="remove_device", stat_consumption="sensor.fridge_energy")
ha_set_entity tool
Update entity registry entries, or without entity_id the registry-wide settings.

        Allows modifying entity metadata such as area assignment, display name,
        icon, "Show As" device class override, per-domain registry options,
        enabled/disabled state, visibility, aliases, labels, voice assistant
        exposure, and entity_id rename in a single call.

        BULK OPERATIONS:
        When entity_id is a list, only labels, expose_to, and categories parameters are supported.
        Other parameters (area_id, name, use_device_name, icon, device_class, options, enabled, hidden, aliases, use_entity_name_alias, new_entity_id, new_device_name) require single entity.

        SHOW AS / DEVICE CLASS: a device_class change applies instantly, no reload
        needed.

        REGISTRY OPTIONS: multi-domain options are sent as separate registry
        updates because HA's WS schema requires options_domain + options to be
        paired one domain at a time.

        ENTITY ID RENAME: Voice exposure settings are preserved automatically.

        WARNING: Renaming an entity_id does NOT update references in automations,
        scripts, templates, or dashboards. All consumers of the old entity_id must
        be updated manually — HA does not propagate the rename automatically.

        Rename limitation: an entity without a unique ID cannot be renamed.

        REGISTRY-WIDE SETTINGS: for the parameters sent, the reply has Home
        Assistant's `settings`, the `expose_new_entities` written, and the values
        they replace
        (`previous_settings`, `previous_expose_new_entities`). ha_get_entity()
        reads them.

        Use ha_search() or ha_get_device() to find entity IDs.
        Use ha_config_get_label() to find available label IDs.

        EXAMPLES:
        - Assign to area: ha_set_entity("sensor.temp", area_id="living_room")
        - Set Show As: ha_set_entity("binary_sensor.zone_10", device_class="window")
        - Set sensor precision: ha_set_entity("sensor.power", options={"sensor": {"display_precision": 2}})
        - Stop exposing new entities to Alexa: ha_set_entity(expose_new_entities={"cloud.alexa": false})
        - Rename entity and device: ha_set_entity("light.old", new_entity_id="light.new", new_device_name="New Lamp")
        - Add labels to multiple: ha_set_entity(["light.a", "light.b"], labels=["new"], label_operation="add")
        - Expose to Alexa: ha_set_entity("light.lamp", expose_to={"cloud.alexa": True})

        AUTOMATIONS AND SCRIPTS:
        For automations and scripts, enabled=False is blocked. For automations,
        use ha_config_set_automation(entity_id="automation.xxx", enabled=False)
        (or enabled=True to re-enable).
        For scripts, ha_config_set_script(script_id="script.xxx", run="stop")
        only stops a currently running execution; it does not disable the script.
        Home Assistant has no script runtime enable/disable service.
ha_get_entity tool
Get entity registry entries, or without an entity the registry settings and exposed entities.

        Returns each entry as Home Assistant's entity registry serves it
        (`config/entity_registry/get` / `get_entries`): area_id, name override,
        original_name, icon, disabled_by/hidden_by, aliases (a null alias is the
        entity's own name), labels, categories, device_class, capabilities,
        entity_category, per-domain options, platform, device_id,
        config_entry_id, unique_id and `next_name_part`. An entity with a
        device_id and no name of its own (`name: ""`, or `name: null` with no
        `original_name`) is the main entity of its device (the dialog's "Main
        entity of the device" switch). Plus the enrichment keys below.

        RESOLVER MODE:
        Pass unique_id to resolve it to its entity_id(s). Since the registry's
        unique key is (domain, platform, unique_id), the same unique_id can match
        multiple platforms — all matches are returned in entity_entries with a
        `matches` count. Narrow with domain/platform.

        When config_entry_id is non-null — e.g. for UI-created template / group /
        utility_meter / derivative helpers — pass it to
        ``ha_get_integration(entry_id=..., include_options=True)`` to read the
        helper's current config (template body, group members, etc.) without
        scanning a domain list.

        Resolved-name enrichment on an entity_id or unique_id lookup, served by the
        ha_mcp_tools component (absent without it, and a warning says which
        fields are missing and whether to install or update the component):
        `full_name` (the name Home Assistant shows, composed from the parent
        device, device and entity names; null when it has none),
        `area` (assigned area NAME, device-inherited when the entity has none),
        `floor`, and `label_names`. This tool's base `labels` carries the label ids;
        ha_search result_fields and the exposure listing's `entity_info`
        instead emit the resolved names under `labels`.

        VOICE ASSISTANT EXPOSURE:
        An entity with a registry entry keeps its exposure in the entry's
        `options` (`options.<assistant>.should_expose`; absent while nothing is
        stored); ha_set_entity(expose_to=...) sets it. An entity without a
        registry entry that has a state, or is stored as exposed, returns
        `entity_entry: null` with `exposed_to` (the assistants Home Assistant has
        stored as exposed) and
        `is_exposed_anywhere`; a list call returns such entities under
        `unregistered_entities`.

        WITHOUT entity_id AND unique_id: returns the registry-wide state:
        `settings` (Home Assistant's `config/entity_registry/settings/get`:
        `entity_id_parts`, the name parts new entity IDs are built from, null
        for Home Assistant's default) and `exposed_entities`, the entities
        exposed to at least one voice assistant as Home Assistant's
        `expose_entity/list` map, with `count` and a per-assistant `summary`
        (an assistant with no exposed entity is left out). An entity missing
        from that map is not stored as exposed: either it is stored as not
        exposed, or nothing is stored yet and Home Assistant applies its own
        default when an assistant first asks (it depends on the assistant's
        expose-new-entities flag and on the entity). When the ha_mcp_tools
        component advertises it, `entity_info` names each listed entity:
        domain, area, floor and labels (plus friendly_name and state when it
        has a state). Without it the listing has no `entity_info`, and a
        warning says whether to install or update the component.

        RELATED TOOLS: ha_set_entity() to modify these properties; ha_get_state()
        for current state/attributes; ha_search() to find entities.

        EXAMPLES:
        - Single entity: ha_get_entity("sensor.temperature")
        - Multiple entities: ha_get_entity(["light.living_room", "switch.porch"])
        - Resolve a unique_id: ha_get_entity(unique_id="00:11:22:33", domain="sensor")
        - Entities exposed to Alexa: ha_get_entity(exposed_to="cloud.alexa")
        - Registry settings and all exposed entities: ha_get_entity()
ha_remove_entity tool
Remove one or more entities from the Home Assistant entity registry.

        Permanently removes the entity registration; the entity will no longer
        appear in the UI or be available to automations. Use only for orphaned
        or stale entity entries: if the underlying device, integration or
        stored helper is still there, the entity may be re-added on the next HA
        restart or reload; for a stored helper's entity a single-id removal
        names the tool that removes the helper. Added again, it gets back its registry
        settings while its config entry exists, and for 30 days after that entry, or an
        entity without one, was removed. For most use cases, consider disabling instead:
        ha_set_entity(entity_id="sensor.old", enabled=False).

        BULK MODE:
        Pass a list of entity IDs to remove up to 100 at once — handy for
        clearing the restored=true orphans an integration leaves behind after
        its filters change. Removals run sequentially and return:
          {removed: [...], skipped: [...], errors: [{entity_id, code, message}]}
        where skipped = ids already absent (not-found is idempotent). A lost connection
        stops the run; not_attempted lists the ids never sent (the failing one too if
        it never left), safe to retry. Only single-id removal is auto-backed-up.

        EXAMPLES:
        - Remove orphaned sensor: ha_remove_entity("sensor.old_temperature")
        - Bulk cleanup: ha_remove_entity(["sensor.orphan_1", "sensor.orphan_2"])

        Use ha_search / ha_get_entity to verify an entity before removing it.
ha_list_files tool
List files in a directory within the Home Assistant config directory.

        Returns file names, sizes, and modification times for one of the allowed
        directories:
        - `www/` - Web assets (CSS, JS, images for dashboards)
        - `themes/` - Theme files
        - `custom_templates/` - Jinja2 template files
        - `dashboards/` - YAML-mode dashboard files
        - `blueprints/` - Automation/script blueprint sources (read-only)
        - `packages/`, plus the folder bound by `homeassistant: packages:` when
          it has another name
        - Plus any custom directories OR HAOS sibling volumes (`/share`,
          `/media`, `/ssl`) configured in the ha-mcp settings UI
        Path traversal (../) is blocked.

        EXAMPLE: ha_list_files(path="www/", pattern="*.css")
ha_read_file tool
Read a file from the Home Assistant config directory.

        General-purpose escape hatch — prefer a dedicated tool when one exists:
        ha_manage_blueprints(action="get") for a blueprint body,
        ha_config_get_yaml for a config key, ha_config_get_automation/script/scene
        for storage-mode items. Reach for ha_read_file only for raw on-disk text
        those tools don't expose.

        Some files have special handling:
        - `secrets.yaml`: Values are masked for security
        - `home-assistant.log` / `home-assistant.log.fault`: Prefer
          ha_get_logs(source='error_log') and
          ha_get_logs(source='fault_log') over reading these directly.

        **Allowed Read Paths:**
        - `configuration.yaml`, `automations.yaml`, `scripts.yaml`, `scenes.yaml`
        - `secrets.yaml` (values masked)
        - `*.yaml` at any depth under `packages/` and under the folder bound by
          `homeassistant: packages:`
        - `home-assistant.log`, `home-assistant.log.fault` (tail only)
        - `www/**`, `themes/**`, `custom_templates/**`, `dashboards/**`, `blueprints/**`
        - `custom_components/**/*.py` (read-only)
        - Plus any custom directories OR HAOS sibling volumes (`/share`,
          `/media`, `/ssl`) configured in the ha-mcp settings UI
        Path traversal (../) is blocked.

        EXAMPLE: ha_read_file(path="packages/alert2.yaml", yaml_path="alert2")
ha_write_file tool
Write a file to allowed directories in the Home Assistant config.

        Creates or updates files (custom CSS/JS for dashboards, Jinja2 macro
        templates, theme YAML) in restricted directories only.

        Not for configuration: use ha_config_set_yaml for configuration.yaml and
        packages, and ha_config_set_automation, ha_config_set_script,
        ha_config_set_scene or ha_config_set_dashboard for storage-mode items.

        **Allowed Write Directories:**
        - `www/` - Web assets for dashboards
        - `themes/` - Theme YAML files
        - `custom_templates/` - Jinja2 template files
        - `dashboards/` - YAML-mode dashboard files
        - Plus custom directories OR HAOS sibling volumes (`/share`, `/media`, `/ssl`)
          from the ha-mcp settings UI; `/ssl` is read-only on HAOS and Supervised
        Configuration files (configuration.yaml, etc.) cannot be written; path
        traversal (../) is blocked.

        Text content only. Overwriting a file that currently holds binary
        content still succeeds, but its prior bytes cannot be captured by
        auto-backup (only modifications/deletions of text files are
        snapshotted); the skip is logged, the write is not blocked.

        With edits, nothing is saved unless every edit applies, and the rest of
        the file, line endings included, stays as it is. ha_read_file shows a
        CRLF file with LF; edits to it match either way. In a file that mixes
        CRLF and LF, a multi-line 'old' matches only lines stored with the line
        ending it uses.

        After a write, the response says what Home Assistant needs before it
        uses the file: a theme or custom template is reloaded (post_action,
        reload_service), a custom template Home Assistant cannot load (not
        *.jinja, or over its size limit) gets a warning, and a dashboards/ file
        lists the YAML dashboards that name it as their file (dashboards); they
        reread it when next opened. A file a dashboard !includes is not checked.

        EXAMPLE: ha_write_file(path="custom_templates/formatters.jinja", content="{% macro shout(text) %}{{ text | upper }}{% endmacro %}")
        EXAMPLE: ha_write_file(path="www/card.js", edits=[{"old": "const REFRESH = 30000;", "new": "const REFRESH = 10000;"}])
ha_delete_file tool
Delete a file from allowed directories in the Home Assistant config.

        ha_manage_backup(scope="edits") can restore a text file from its most
        recent auto-backup snapshot; a binary file has no snapshot and its
        deletion is permanent. Allowed directories:
        `www/`, `themes/`, `custom_templates/`, `dashboards/`, plus any custom
        directories OR HAOS sibling volumes (`/share`, `/media`, `/ssl`) configured
        in the ha-mcp settings UI; `/ssl` is read-only on HAOS and Supervised.
        Configuration files cannot be deleted; path traversal (../) is blocked.

        EXAMPLE: ha_delete_file(path="www/deprecated-style.css", confirm=True)
ha_config_list_groups tool
List Home Assistant entity groups with their member entities.

        Returns one page of old-style groups created via the group.set service
        or YAML configuration (platform-specific groups such as light or cover
        groups are separate entities); `total_count` and `has_more` report the
        full set. Each group carries Core's state fields and attributes, its
        members as `entity_ids`, and its object_id. `auto` is true for a group
        created by ha_config_set_group (group.set) and false for a YAML group.
        Core does not expose a group's all/any mode.
        Without the ha_mcp_tools component, `last_reported` comes from Core's
        REST API, can lag the live time, and the reply says so.

        EXAMPLE: ha_config_list_groups(offset=100)
ha_config_set_group tool
Create or update a service-based Home Assistant entity group via the group.set service.

        **When NOT to use:** for typical "combine these entities into one controllable group"
        requests, prefer `ha_config_set_helper(helper_type="group", ...)`. Config-entry-backed
        groups are registered in the entity registry, so `ha_set_entity` can assign them to
        areas and they are deletable via `ha_remove_helpers_integrations`.

        **When to use:** compatibility with existing groups already configured via group.set
        or YAML, or the rare case where entity-registry membership is explicitly unwanted.
        Groups created here are only removable via `ha_config_remove_group` —
        `ha_remove_helpers_integrations` will not find them. They survive group.reload but
        not a restart.

        Core creates group.<object_id> when it does not exist (members from entities or
        add_entities) and updates it otherwise. entities, add_entities, and remove_entities
        are mutually exclusive.

        EXAMPLES:
        - Create: ha_config_set_group("bedroom_lights", entities=["light.lamp", "light.ceiling"], name="Bedroom Lights")
        - Add entities: ha_config_set_group("lights", add_entities=["light.extra"])
ha_config_remove_group tool
Remove a service-based Home Assistant entity group via the group.remove service.

        **When NOT to use:** for groups created through `ha_config_set_helper(helper_type="group", ...)`,
        use `ha_remove_helpers_integrations`. Those config-entry-backed groups are not reachable via the
        group.remove service.

        **When to use:** removing groups created with `ha_config_set_group` or defined in YAML
        via `group:` configuration. Config-entry-backed deletion tools cannot find these.

        EXAMPLES:
        - Remove group: ha_config_remove_group("living_room_lights")

        Use ha_config_list_groups() to find existing groups.

        **WARNING:**
        - Removing a group used in automations may cause those automations to fail.
        - Groups defined in YAML can be removed at runtime but come back on group.reload
          or a restart.
        - This only removes old-style groups, not platform-specific groups.
ha_get_hacs_info tool
Get data from Home Assistant's Marketplace, what HACS became in 2026.11.

        This tool only reads; to install, update, add or forget repositories
        use ``ha_manage_hacs``. Use ``search`` to browse, filter or list
        installed repositories: it filters and pages the store's own list, in
        the order Core lists it. Use ``info`` for one
        repository's full record as the store sends it (the README is
        ``additional_info``).

        **DASHBOARD TIP:** ``action="search", installed_only=True, category="lovelace"``
        finds installed custom cards to wire into ``ha_config_set_dashboard()``.

        **Examples:**
        - Search: ha_get_hacs_info(action="search", query="mushroom", category="lovelace")
        - Updates waiting: ha_get_hacs_info(action="search", status=["pending-upgrade"])
        - Details before an update: ha_get_hacs_info(action="info", repository_id="owner/repo", include_releases=True)
        - Before adding a repository: ha_get_hacs_info(action="detect", repository="owner/repo")

        **Caveats:** ``info`` marks the repository as seen (Core clears its
        ``new`` flag) and may fetch it from GitHub. ``detect`` needs the
        accepted first-run warning and a connected GitHub account.
        ``download_source`` opens and ends the Marketplace entry's options
        flow, as the panel's "Download source" does.
ha_manage_hacs tool
Manage Home Assistant's Marketplace (what HACS became in 2026.11): install, update, remove and add repositories.

        This tool writes; to search the store or read a repository use
        ``ha_get_hacs_info``. Use ``update_information`` to surface a
        just-published release: on its own the Marketplace re-reads an
        installed custom repository only every 48 hours, and only with a
        connected GitHub account; catalog repositories follow the catalog,
        which it refreshes every 6 hours without one.

        **Examples:**
        - Install the latest: ha_manage_hacs(action="download", repository_id="441028036")
        - Install a version: ha_manage_hacs(action="download", repository_id="piitaya/lovelace-mushroom", version="v4.0.0")
        - Add a custom repository: ha_manage_hacs(action="add_repository", repository="owner/repo")
        - Read a repository at another version, installing nothing: ha_manage_hacs(action="set_version", repository_id="owner/repo", version="v1.2.0")
        - Accept the warning: ha_manage_hacs(action="accept_warning", confirm=True)
        - Connect GitHub: ha_manage_hacs(action="connect_github"), then again with
          the flow_id it returns for the URL and code the user enters on GitHub,
          then again with flow_id once they did, for the outcome
        - Change the download source: ha_manage_hacs(action="set_download_source")
          returns the form and flow_id; once the user chose, call again with
          flow_id and config={"profile": "<their choice>"}

        **Caveats:** An installed integration loads after a Home Assistant
        restart, and a new dashboard card after a browser cache clear. The
        Marketplace refuses to uninstall an integration while it has config
        entries. Installs, version and beta changes, and adding or detecting
        a repository wait for the first-run warning, which Home Assistant
        keeps per user, so the user's own acceptance in the UI does not cover
        this server: ask whether they read it (Settings > Marketplace) before
        ``accept_warning``. Adding and detecting a repository also need a
        connected GitHub account. A saved download source reloads the
        Marketplace, and the call waits for it.
ha_get_history tool
Get historical data from Home Assistant's recorder.

        WHEN NOT TO USE:
        For current values, use ha_get_state. To inspect Energy Dashboard
        preferences and configured statistics, use
        ha_manage_energy_prefs(mode="get", include_statistics=True). To list the
        recorder's statistics, see Core's issues with them, or change recorded
        data, use ha_manage_logs.

        WHEN TO USE:
        Use source="history" (default) to troubleshoot why a value changed, check
        event sequences, or analyze recent patterns. Use summary=True when the
        question needs a count or a duration ("was it ever unavailable?") rather
        than the rows. Use source="statistics" for long-term trends and period
        averages.

        CAVEATS:
        When the recorder holds less than the requested window, the rows it has
        come back with the reason in warnings.
        History rows rename Core's compact keys once: s -> state, a -> attributes,
        lu -> last_updated, lc -> last_changed. History event times are ISO strings
        in HA's timezone (UTC if unavailable). When Core omits lc, last_changed
        falls back to last_updated; this may not be the actual state-change time
        with significant_changes_only (default) or a window-start snapshot.
        Attributes and unknown fields pass through unchanged.
        Statistics timestamps use Unix milliseconds. Minimal history may omit attributes.
        No duplicate compact aliases are added. include_schema=True
        retains core_contract even when fields selects other data keys.

        Output units come from
        Core recorder metadata and reflect its display-unit conversion; unresolved
        units include a reason. statistics_metadata preserves Core's native fields.

        All data is fetched from HA before slicing; limit/offset are client-side.
        With multiple entity_ids, offset must be 0 — use a single entity_id for
        offset > 0. Use has_more and next_offset from the response to paginate.
        summary=True does not combine with offset > 0.
        Administrators can optionally enable recorder workload guardrails in
        Advanced settings. When enabled, oversized entity/time workloads are
        rejected before the recorder query is issued; narrow the time range or
        entity list to stay within the budget. Calendar statistics may first
        read HA's configured timezone so the estimate follows local calendar
        boundaries.

        EXAMPLES:
        - ha_get_history(entity_ids="sensor.bedroom_temperature", start_time="24h")
        - Paginate oldest-first: ha_get_history(entity_ids="sensor.temperature", start_time="7d", limit=100, offset=100, order="asc")
        - Time per state: ha_get_history(entity_ids="binary_sensor.door", start_time="7d", summary=True)
        - ha_get_history(source="statistics", entity_ids="sensor.living_room_temperature", start_time="6m", period="month", statistic_types=["mean", "min", "max"])
ha_get_integration tool
Get integration (config entry) information with pagination.

        Without an entry_id: Lists all configured integrations with optional filters.
        With an entry_id: Returns detailed information including full options/configuration.

        WHEN NOT TO USE:
        - Changing an entry, or describing a setup form or a form behind a
          menu: use ha_set_integration (without config it returns the form).

        EXAMPLES:
        - List / search: ha_get_integration(query="zigbee")
        - Get an entry with its editable fields: ha_get_integration(entry_id="abc123", include_schema=True)
        - Diagnostics dump, paged along a list-valued path: ha_get_integration(entry_id="abc123", include_diagnostics=True, diagnostics_data_path="<list-valued path>", diagnostics_data_limit=10, diagnostics_data_offset=20)
        - Inspect a subentry reconfigure schema: ha_get_integration(entry_id="abc123", include_subentry_schema=True, subentry_type="conversation", subentry_id="sub123")
        - Options flow that opens with a menu: ha_get_integration(entry_id="abc123", include_schema=True) lists menu_options; ha_set_integration(entry_id="abc123", menu_choice="<option>") opens that form
        - List template entries with their options: ha_get_integration(domain="template")
        - Only service integrations: ha_get_integration(integration_type="service")
        - An entry's panel commands: ha_get_integration(entry_id="abc123", include_ws_commands=True)

        OPTIONS: with the component, ``options`` are the stored mapping as-is,
        so a field never set may be absent and a section's fields stay nested
        under the section key (e.g. a template helper's ``additional_options``);
        values that match a ``secrets.yaml`` entry are returned as
        ``"**redacted**"``. Without it, include_schema=True reads ``options``
        from the options form: unset fields at their schema default, a
        section's fields at the top level. With redact_secrets on, every
        option value of an entry that has an options flow is redacted unless
        include_schema=True reads the form that names the password fields;
        an entry without an options flow has no such form, so its option
        values come back as stored.

        Each entry carries ``log_level``: the canonical Python logger level name
        (``DEBUG``/``INFO``/``WARNING``/``ERROR``/``CRITICAL``) when the
        integration has a log-level override (set one with
        ``ha_set_integration(log_level=...)``), or ``"DEFAULT"``
        (uppercase sentinel) when no override is set; and ``log_level_raw``: the
        original numeric level (e.g. ``10`` for DEBUG) when HA returned an int,
        ``None`` otherwise. This is distinct from the app side, where
        ``ha_get_app`` returns Supervisor's lowercase ``"default"`` literal — do
        not cross-compare.
ha_set_integration tool
Manage an integration (config entry): enable/disable, add, update options, reconfigure, or send its own commands.

        Modes (pick one):
        - Enable/disable: entry_id + enabled.
        - Add integration: domain (+ menu_choice, + config) — runs the
          domain's config flow one step per call, as the HA UI does.
        - Update options: entry_id (+ menu_choice, + config) — the entry's
          options flow (what the "Configure" button does in the HA UI), one
          step per call.
        - Reconfigure: entry_id + reconfigure=True — connection settings
          such as host, port, credentials, one step per call. Each call
          except an abort first checks the entry's identity; the first call
          without config returns the flow's first step.
        - Log level: log_level + domain (or entry_id) — sets how much the
          integration logs; read it back with ha_get_integration's log_level.
        - Integration command: entry_id + ws_command (+ ws_data) — what the
          integration's panel sends (KNX project, entities, telegrams).
          Home Assistant marks none of these commands as read-only, so a read
          such as knx/get_knx_project goes through this tool too.

        Flows, one step per call: a call answers the step the flow is at and
        returns Home Assistant's next answer. A form comes back with its
        fields (type, default, current value, Home Assistant's help text) and
        flow_id; a menu with menu_options. Answer with flow_id and config (a
        form) or menu_choice (a menu); flow_id alone returns the step again,
        and flow_id with abort=True ends the flow. Without flow_id a new flow
        starts: config answers its first form, or returns it when omitted. A
        config list answers several forms, one object each in order (see a
        form's later_forms). A form Home Assistant rejects is an error with
        errors and error_text (Core's text), and the flow stays open to
        correct it, until Home Assistant finishes it or you abort it; while a
        setup flow is open, another for the same device is already_in_progress.

        WHEN NOT TO USE:
        - Helpers (template, group, utility_meter, ...): use
          ha_config_set_helper. `otp` is the user's to set up in the HA UI: its
          secret is a credential enrolled in an authenticator app; do not create it.
        - Config subentries: use
          ha_config_set_helper(helper_type='config_subentry'); subentry_type
          here describes their form; a menu_choice that finishes the flow
          saves the subentry.
        - Removing an entry: use ha_remove_helpers_integrations.
        - ha-mcp's own ha_mcp_tools entries are refused: manage them in the HA
          UI, or (server settings, developer mode on) ha_dev_manage_settings /
          ha_dev_manage_server.

        Use ha_get_integration() to find entry IDs, and
        ha_get_integration(entry_id=..., include_schema=True) to inspect the
        options fields. Its supports_reconfigure field tells you whether an
        entry qualifies for reconfigure=True, and
        ha_get_integration(entry_id=..., include_ws_commands=True) lists the
        commands ws_command accepts with their schemas.

        Caveats: adding an integration runs its config flow exactly as the HA
        UI would (may pair devices, scan the network, create entities). Flows
        requiring a browser step (OAuth) are refused at that step and
        aborted. A progress step (Home Assistant working in the background)
        is waited out for up to 120 s; after that the error carries flow_id
        to ask again. When Home Assistant does not answer a submit or a
        progress poll (or, on reconfigure, answers with any 5xx), the error
        carries status applied_but_unverified: the entry may exist or the
        change may be saved, so check it before retrying. An aborted flow
        returns Core's own text next to the key (reason_text). Reconfigure
        edits the settings a live integration connects with: a wrong host or
        credential takes it offline, and there is no automatic rollback. A
        finished reconfigure waits for the reload Home Assistant runs and
        reports the entry's state as entry_state: status applied_and_verified
        once it is loaded, applied_but_unverified otherwise.

        EXAMPLES:
        - Add: ha_set_integration(domain="local_calendar", config={"calendar_name": "Chores"})
        - Add in two steps: ha_set_integration(domain="knx", config={"connection_type": "routing"}) returns the routing form and flow_id, then ha_set_integration(domain="knx", flow_id="...", config={})
        - Answer a menu: ha_set_integration(domain="...", flow_id="...", menu_choice="<one of menu_options>")
        - See the setup form first: ha_set_integration(domain="workday")
        - Update options: ha_set_integration(entry_id="abc123", config={"scan_interval": 30})
        - Reconfigure: ha_set_integration(entry_id="abc123", reconfigure=True), then ha_set_integration(entry_id="abc123", reconfigure=True, flow_id="...", config={"host": "10.0.0.5"})
        - Cancel a flow: ha_set_integration(domain="knx", flow_id="...", abort=True)
        - Debug logging: ha_set_integration(domain="zha", log_level="DEBUG"), then log_level="DEFAULT" to stop
        - KNX project: ha_set_integration(entry_id="abc123", ws_command="knx/get_knx_project")
ha_remove_helpers_integrations tool
Remove a Home Assistant helper or integration config entry.

        Unifies three backend removal mechanisms — simple-helper websocket
        delete, config-entry delete, and config-subentry delete — behind one
        entry point; helper_type picks the path, or the entity registry does
        when an entity_id comes without one.

        WHEN NOT TO USE:
        - Removing only an entity (without deleting its underlying helper or
          config entry) — use `ha_remove_entity` instead.
        - YAML-configured helpers — they have no storage backend. Edit the
          YAML file and reload the relevant integration.
        - ha-mcp's own ha_mcp_tools entries are refused: manage them in the HA
          UI, or (server settings, developer mode on) ha_dev_manage_settings /
          ha_dev_manage_server.

        ROUTING:
        - SIMPLE helper_type (input_button, input_boolean, input_select,
          input_number, input_text, input_datetime, counter, timer, schedule,
          zone, person, tag) + bare helper_id (its storage id) or entity_id →
          websocket delete.
        - FLOW helper_type (any helper flow Home Assistant lists: template, group,
          utility_meter, derivative, ...; custom helper integrations too)
          + full entity_id → resolve entity_id to
          config_entry_id via entity_registry, then delete the config entry. All
          sub-entities (e.g. utility_meter tariffs) are removed together. An
          entity registered by another integration is refused with
          VALIDATION_INVALID_PARAMETER and nothing is deleted.
        - subentry_id (helper_type omitted or "config_subentry") + parent
          entry_id → delete that one config subentry, whatever the target looks
          like. A subentry_id with any other helper_type is refused.
        - helper_type=None + entity_id → the entity's registry entry names its
          helper (storage type or helper flow); an entity of any other
          integration is refused with VALIDATION_INVALID_PARAMETER.
        - helper_type=None + entry_id → direct config entry delete.

        A target that cannot be removed raises a structured error rather than
        returning silent success: ENTITY_NOT_FOUND when the entity_id is absent
        from both the state machine and the entity registry, or for a bare
        helper_id no stored helper has (a bare helper_id on a FLOW target also
        raises it — FLOW resolution needs a full entity_id); RESOURCE_NOT_FOUND
        when it exists but is not storage- or registry-managed (a YAML-configured helper, or an entity with a state
        but no registry entry), for a config entry the backend reports as 404,
        or for a missing config subentry.
        Calling N times gives the same response. Transient connectivity failures
        raise their own codes (CONNECTION_FAILED, CONNECTION_TIMEOUT) so
        retry logic can branch separately.

        EXAMPLES:
        - Remove SIMPLE button: ha_remove_helpers_integrations(target="my_button", helper_type="input_button", confirm=True)
        - Remove FLOW utility_meter (any sub-entity works): ha_remove_helpers_integrations(target="sensor.energy_peak", helper_type="utility_meter", confirm=True)
        - Remove whatever helper owns an entity: ha_remove_helpers_integrations(target="sensor.energy_peak", confirm=True)
        - Remove any integration by entry_id: ha_remove_helpers_integrations(target="01HXYZ...", confirm=True)
        - Remove a config subentry: ha_remove_helpers_integrations(target="01HXYZ...", helper_type="config_subentry", subentry_id="subentry-123", confirm=True)

        WARNING: Removing a helper or integration that is referenced by
        automations, scripts, or other integrations may cause those to fail.
        Use ha_search() / ha_get_integration() to verify before removal.
        ha_manage_backup(scope="edits", action="restore") recreates removed FLOW
        helpers whose options could be snapshotted, and config subentries. It
        cannot recreate custom helper integrations (their options are withheld)
        or otp (no stored options); re-add those yourself, otp through the user
        in the HA UI.
ha_config_get_label tool
Get label info - list all labels or get a specific one by ID.

        Without a label_id: Lists all Home Assistant labels with their configurations.
        With a label_id: Returns that label and, as `related`, Home Assistant's
        Related set for it: the areas, devices and entities that carry it (an
        automation, script, scene, group or person that carries it is also listed
        under its own key), the automations and scripts that target it, and the
        areas, floors, devices, config entries and integrations of the carrying
        items. A template that uses the label (for example `label_entities('x')`)
        is not listed. `related` is None, with a warning, when Home Assistant
        cannot answer; that does not mean the label is unused.

        EXAMPLES:
        - List all labels: ha_config_get_label()
        - Get specific label: ha_config_get_label("my_label_id")

        Use ha_config_set_label() to create or update labels.
        Use ha_set_entity(labels=["label1", "label2"]) to assign labels to entities,
        ha_set_device(labels=[...]) for devices, or
        ha_set_area_or_floor(kind="area", labels=[...]) for areas.
ha_config_set_label tool
Create or update a Home Assistant label.

        Creates a new label if label_id is not provided, or updates an existing
        label if label_id is provided. Labels are a cross-domain tagging system
        for entities, devices, and areas.

        EXAMPLES:
        - Create: ha_config_set_label(name="Security", color="red", icon="mdi:shield", description="Security-related devices")
        - Update: ha_config_set_label(label_id="my_label_id", color="blue")
        - Create and apply to areas: ha_config_set_label(name="Site Home", areas=["kitchen", "living_room"])

        After creating a label, use ha_set_entity(labels=["label_id"]) to assign it to entities,
        ha_set_device(labels=["label_id"]) for devices, or
        ha_set_area_or_floor(kind="area", labels=["label_id"]) for areas (replaces the area's set).
ha_config_remove_label tool
Delete a Home Assistant label.

        Removes the label from the label registry. Home Assistant also takes it off
        every entity, device and area that carries it. Automations and scripts that
        target the label keep the reference, which then matches nothing.

        To take a label off one item and keep it, use ha_set_entity,
        ha_set_device or ha_set_area_or_floor instead. Before deleting, call
        ha_config_get_label(label_id): its `related` lists what carries or
        targets the label, but not a template that uses it, so an empty `related`
        does not prove the label unused. The auto-backup of this call restores
        the label itself, under the id its current name gives it (a new one if
        it was renamed since it was created), not what carried it.

        EXAMPLES:
        - Delete label: ha_config_remove_label("my_label_id")

        Use ha_config_get_label() to find label IDs.
ha_get_logs tool
Get Home Assistant logs from various sources.

        Prefer source='system' for triage: it returns HA's own deduplicated
        system_log entries with counts, first_occurred and the full exception
        traceback, and its counts run since each error first occurred. error_log with
        structured=True counts only what is inside the fetched window (reported
        as window_start/window_end; every install reads a capped window) and
        drops tracebacks; structured=False returns the raw records instead, so
        it covers what falls outside system_log's WARNING+ in-memory buffer. Use
        structured=True for the per-component rollup; in structured mode
        limit/order do not apply: issues are ranked by count, then severity,
        then recency, over a fixed deep window.

        Raw-text sources (error_log, supervisor, system_service) read a bounded
        window per call, so level/search filter and limit slice within that
        window only; window_lines reports the size requested. With hours_back,
        supervisor and system_service read the journal's own time window
        instead. Logbook and hours_back responses carry has_more plus a
        pagination_hint; error_log, fault_log and supervisor/system_service
        page reads carry has_more with a next_offset to pass back while it
        stays true.
ha_manage_logs tool
Manage Home Assistant's recorder, its long-term statistics and its logs.

        WHEN NOT TO USE:
        For reading recorded states or statistics values use ha_get_history,
        for reading log entries ha_get_logs, and for one integration's debug
        logging ha_set_integration with log_level.

        WHEN TO USE:
        To purge or pause the recorder, to list the recorder's statistics and
        Core's issues with them, to fix a statistic (clear it, adjust a sum,
        change its unit, import rows), and to write to or clear the system
        log, set log levels or add a logbook entry.

        CAVEATS:
        Each call runs one Core operation; Core validates its fields and its
        refusal comes back with its own error code. Call with describe=True
        first when the fields are not known. With the HA-MCP component a
        recorder write returns once the recorder has finished it, and a
        recorder service returns the recorder's purge settings and oldest
        state as `recorder`; without it the tool watches the recorder's queue
        and says what that cannot show. A statistics command that names
        statistics (Core's `statistic_id` / `statistic_ids` fields) also
        returns Core's metadata for them as `statistics_metadata`, read
        after the write. Core also lists a statistic a sensor still
        provides, so after a clear read its statistics to see the rows went.
        Purges and statistics clears cannot be undone.

        EXAMPLES:
        - ha_manage_logs(action="recorder/adjust_sum_statistics", describe=True)
        - ha_manage_logs(action="recorder/clear_statistics", data={"statistic_ids": ["sensor.old_meter"]})
        - ha_manage_logs(action="system_log.write", data={"message": "checkpoint"})
ha_manage_radio tool
Manage Home Assistant radios — Z-Wave, Zigbee, Matter, and Thread.

        For node diagnostics and network summaries prefer ha_get_device /
        ha_get_system_health; 'diagnostics' and 'network_status' here return
        this tool's own, smaller shapes.
        This tool also exposes active 'ping' probes and parameter reads.
        Z-Wave 'get_config_params' lists cached configuration values/metadata;
        'get_config_param' reads one from the cache or explicitly from the device.
        Neither enables or creates entities. Write actions perform
        inclusion/commissioning, removal, healing,
        reconfiguration, firmware updates and credential provisioning.

        Caveats: long-running actions (inclusion, rebuild routes, firmware) start the
        operation and return immediately with long_running=true; completion
        happens out-of-band. Interactive Z-Wave S2 secure inclusion (read-the-
        PIN pairing) is not scriptable — use SmartStart/QR provisioning here or
        the HA UI. HA administrator access is required for parameter reads.
ha_get_device tool
Get device information with pagination, including Zigbee (ZHA/Z2M) and Z-Wave JS devices.

        Without device_id/entity_id: Lists devices with optional filters and pagination.
        With device_id or entity_id: Returns full detail for that specific device.

        **List devices (paginated):**
        - First page: ha_get_device()
        - Next page: ha_get_device(offset=50)
        - By area: ha_get_device(area_id="living_room")
        - By integration: ha_get_device(integration="zigbee2mqtt")
        - Full details in list: ha_get_device(detail_level="full", limit=10)

        **Single device lookup (Core's whole row, its entity rows and linked_devices):**
        - By device_id: ha_get_device(device_id="abc123")
        - By entity_id: ha_get_device(entity_id="light.living_room")

        **Zigbee:** integration="zha" or "zigbee2mqtt". Returns ieee_address, radio metrics.
        **Z-Wave:** integration="zwave_js". Single device lookup returns
        Z-Wave JS's node_id and node_status.
        **Matter:** integration="matter". Returns node_diagnostics (network type,
        reachability, IPs, fabrics). For management use ha_manage_radio.
ha_set_device tool
Update device properties such as name, area, disabled state, or labels.

        IMPORTANT: Renaming a device does NOT rename its entities!
        Device and entity names are independent. To rename entities, use ha_set_entity(new_entity_id=...).

        Common workflow for full rename:
        1. ha_set_device(device_id="abc", name="Living Room Sensor")  # Rename device
        2. ha_set_entity("sensor.old", new_entity_id="sensor.living_room")  # Rename entities separately

        EXAMPLES:
        - Rename device: ha_set_device("abc123", name="Living Room Hub")
        - Move to area: ha_set_device("abc123", area_id="living_room")
        - Disable device: ha_set_device("abc123", disabled_by="user")
        - Enable device: ha_set_device("abc123", disabled_by="")
        - Add labels: ha_set_device("abc123", labels=["important", "sensor"])
ha_remove_device tool
Remove an orphaned device from the Home Assistant device registry.

        WARNING: This removes the device entry from the registry.
        - Use only for orphaned devices that are no longer connected
        - Active devices will typically be re-added by their integration
        - Associated entities may also be removed

        Works only when the integration supports removing devices.

        EXAMPLES:
        - Remove orphaned device: ha_remove_device("abc123def456")

        NOTE: For most use cases, consider disabling the device instead:
        ha_set_device(device_id="abc123", disabled_by="user")
ha_config_list_dashboard_resources tool
List Lovelace dashboard resources (custom cards, themes, CSS/JS).

        Returns one page of registered resources; `total_count` and `has_more`
        report the full set, and `inline_count` and `by_type` summarise every
        resource, not just this page. Each resource has a unique ID for
        update/delete operations. For inline resources (created with
        ha_config_set_dashboard_resource(content=...)), shows a preview of the
        content instead of the full encoded URL to save tokens.
        `resource_mode` is Core's lovelace resource mode; in 'yaml' mode
        resources cannot be created, updated or deleted through the API.

        EXAMPLES:
        - Next page: ha_config_list_dashboard_resources(offset=100)
        - List with full content: ha_config_list_dashboard_resources(include_content=True)
        - Verify an edit by hash: ha_config_list_dashboard_resources(include_hash=True)

        Home Assistant exposes resource management in the UI by default;
        API access works regardless of UI availability.
ha_config_set_dashboard_resource tool
Create or update a dashboard resource (inline code or external URL).

        Provide exactly one of:
        - edits: Search/replace edits on an existing inline resource. Any
          failing edit (or a config_hash mismatch) aborts the whole call
          and saves nothing. Prefer this over content= for small changes to a
          large card: only the changed text is sent.
        - content: Inline JavaScript or CSS code (embedded in the resource URL
          as a data: URI — no file storage or external hosting involved).
          Supports 'module' and 'css' types only; URLs are
          deterministic (same content = same URL); up to ~128KB. Content must be
          self-contained: a data: URI has no base URL, so relative imports inside
          a module and relative url() references inside CSS cannot resolve (use
          fully-qualified URLs instead). If Home Assistant is behind a reverse
          proxy that injects a Content-Security-Policy without 'data:' in
          script-src/style-src, the browser blocks these resources: this call
          still succeeds and the card simply never renders. Register the code as
          a file and use url='/local/...' on such a deployment. (HA itself ships
          no CSP.)
        - url: External resource URL — /local/... (/config/www/; Marketplace
          cards: /local/community/...), /hacsfiles/... (the older path
          for the same folder) or https://... (CDN). Supports all types:
          'module', 'js', 'css', 'html'.

        EXAMPLES:
        - Inline: ha_config_set_dashboard_resource(content="class MyCard extends HTMLElement { ... } customElements.define('my-card', MyCard);", resource_type="module")
        - Store cards need no call: in storage mode the Marketplace registers the resource on install (adding it again duplicates it); with YAML-mode resources, list it under lovelace: resources: in configuration.yaml instead.
        - Update: ha_config_set_dashboard_resource(url="/local/my-card-v2.js", resource_type="module", resource_id="abc123")
        - Patch: ha_config_set_dashboard_resource(resource_id="abc123", edits=[{"old": "color: red", "new": "color: blue"}], config_hash="<_config_hash from the list>")

        Inline writes return the stored content's config_hash.

        After adding a resource, a browser cache clear or hard refresh
        (Ctrl+Shift+R) is needed to load it.
ha_config_delete_dashboard_resource tool
Delete a dashboard resource.

        Removes a resource from Home Assistant. The resource will no longer
        be loaded on dashboards.

        WARNING: Deleting a resource used by custom cards in your dashboards
        will cause those cards to fail to load.

        EXAMPLES:
        ha_config_delete_dashboard_resource(resource_id="abc123")

        Note: Use ha_config_list_dashboard_resources() to find resource IDs
        before deleting. Ensure no dashboards depend on the resource.
ha_search tool
Search for entities (lights, sensors, switches, climate, etc.) by name, domain, or area — AND inside automation/script/scene/helper/dashboard configurations — in one call.

        Two surfaces run in parallel and return tagged results:
          - **entities**: entity-registry matches (entity_id, friendly name,
            area). Filter with `domain_filter`/`area_filter`/`state_filter`.
          - **automations / scripts / scenes / helpers / dashboards**: matches
            *inside* config definitions — triggers, actions, sequences, scene
            entity-sets, helper bodies, dashboard cards. Driven by `query`;
            narrow with `search_types`.

        Use dedicated get/list tools first for a known resource type, including
        ha_config_get_scene for scene listing and content search. Use this for
        broader discovery or deep searches across resource types.

        For control requests with exclusions such as "except", "excluding", or
        "but not", include `is_group` and `member_entity_ids` in `result_fields`.
        Do not control an aggregate whose members include an excluded entity;
        prefer leaf entities when the exception cannot be verified safely.
        A withheld member list still returns is_group=true; absence of
        member_entity_ids must not be interpreted as a leaf entity.

        When NOT to use:
          - To read a known entity_id's state: use `ha_get_state` (cheaper).
          - To inspect one automation/script/scene config by id: use the
            matching `ha_config_get_*`.
          - To list installed Apps (add-ons): use `ha_get_app`.

        Config-body search is skipped when `domain_filter`/`area_filter`/
        `state_filter` signal entity-only intent (keeping name lookups off the
        expensive backend); a `warnings[]` entry names the skip. Repeat without
        entity filters to search configuration contents too.

        Caveats:
          - `partial: True` means results are NOT exhaustive — a surface raised,
            or the config-body branch lost data (per-id time budget exhausted,
            an individual fetch failed, or a helper-type list fetch failed).
            Empty buckets with `partial: True` mean "search failed", not "no
            results". The cause is in `partial_reason`, also mirrored into
            `warnings[]` with an "incomplete results: " prefix. Do not treat a
            partial response as complete.
          - `count` is items in this response (post-pagination), not corpus
            totals — use `entity_total_matches` + `config_total_matches`.
          - `limit`/`offset` apply per-surface. Flat `has_more`/`next_offset`
            page the next call (iterate `offset = next_offset`); per-surface
            `entity_*`/`config_*` variants show which surface still has results.

        Examples:
            - Find a light by name: ha_search("kitchen", domain_filter="light")
            - List sensors in an area: ha_search(domain_filter="sensor", area_filter="Living Room")
            - Find lights safely before an "all except one" control request:
              ha_search("living room", domain_filter="light",
              result_fields=["entity_id", "friendly_name", "is_group",
              "member_entity_ids"])
            - Which automations use an entity: ha_search("light.bed_light")
            - All unavailable entities: ha_search(state_filter="unavailable")
ha_get_overview tool
Get AI-friendly system overview with intelligent categorization.

        Returns comprehensive system information at the requested detail level,
        including Home Assistant base_url, version, location, timezone, entity overview,
        and active persistent notifications (if any).
        Use 'minimal' (default) for most queries. Domain counts and states_summary
        are always complete regardless of entity pagination.

        Entities are listed by friendly_name, the legacy state attribute. A row
        also carries name where Home Assistant shows a different one, composed
        from the parent device, device and entity names (served by a current
        ha_mcp_tools component).

        Requests whose fields= are composed only of system_info, notification,
        repair, or server metadata fields skip the unrelated state, service, and
        registry reads.

        Do not use this tool to inspect a known entity or a narrow set of entities.
        Use ha_get_state for one entity, ha_get_entity for registry metadata, or
        ha_search with a domain or area filter. An unprojected overview collects
        system-wide state, service, and registry data and can be expensive on large
        Home Assistant installations.

        When the ha-mcp settings-UI sidecar is running (stdio mode, e.g. Claude
        Desktop / Claude Code) the response carries ``settings_url``, the local
        URL of the tool-configuration page; in standalone HTTP / Docker modes
        with an HTTP settings prefix it instead carries ``settings_url_hint``,
        saying where the page is mounted and how to construct the full URL. Hand
        whichever is present to the user when they ask how to enable or disable
        tools or change server settings.

        The response also carries ``ha_mcp_update`` ``{current, latest,
        update_available}`` (PyPI for pip/Docker, the Supervisor store for the
        app) — proactively tell the user when ``update_available`` is true.
        If it carries ``python_required``, the release needs that Python: give
        the user ``upgrade_command``.
        Omitted for the ``unknown`` version, when ``HA_MCP_DISABLE_UPDATE_CHECK``
        is set, or when the update check itself failed.

        ``mcp_client`` reports the MCP protocol version, client info and
        client capabilities this call arrived with, for diagnosing
        client-specific behaviour. ``capabilities: null`` means the request
        carried none to read, not that the client declared none.
ha_get_state tool
Get current status, state, and attributes of one or more entities (lights, switches, sensors, climate, covers, locks, fans, etc.).

        Pass a string entity_id for one entity, or a list (max 100, duplicates
        deduplicated) for several, fetched in parallel. A bulk call returns
        success=True if at least one state was retrieved; check 'error_count'
        for failed lookups.

        `fields=` projects the per-entity record keys, NOT the outer bulk
        response wrapper: in single-entity mode it filters the returned record;
        in bulk mode it filters each record inside `states[entity_id]` while
        outer keys (`success`, `count`, `states`, `errors`, ...) are always
        preserved. `attribute_keys=` further narrows the `attributes` sub-dict
        and is only applied when `"attributes"` is in `fields=` (or
        `fields=None`); otherwise it is a no-op and a `warnings` list is emitted
        at the top level of the result (sibling of `data`/`metadata`), outside
        the projected record(s), so `fields=["state"]` still returns a record
        with only `state`.

        EXAMPLES:
        - Single: ha_get_state("light.kitchen")
        - Multiple: ha_get_state(["light.kitchen", "light.living_room", "sensor.temperature"])
        - Slim bulk: ha_get_state(["light.kitchen", "sensor.temperature"], fields=["state", "attributes"], attribute_keys=["brightness"])
ha_manage_security_policy tool
Manage the tool security policy that gates high-stakes tool calls behind user approval.

        When NOT to use: this tool cannot see or decide pending approval
        requests — listing, approving, and denying them is developer-mode
        only (ha_dev_manage_server). For ordinary Home Assistant entity,
        automation, or dashboard work use the ha_config_* tools.

        When to use: to read the current policy, to add or remove per-tool
        approval rules and their matching conditions, to switch the rule list
        between gating and approving the calls it matches, and to change the
        approval wait time or how long an approval is remembered.

        Caveats: set replaces the WHOLE document, so send back an edited
        copy of what get returned, not a fragment. An omitted field is not
        left alone, it reverts to its default: dropping
        event_decisions_enabled switches off approving from Home Assistant
        events, and the response says so in a warning when it does, while
        dropping rule_effect from an allow list is refused. Writes are
        version-guarded: a concurrent edit is rejected instead of
        silently overwritten. Rule edits apply to the running server
        immediately and can remove approval gates. Whether this tool itself
        is registered is a separate setting that takes effect on restart.

        EXAMPLES:
        ha_manage_security_policy("get")
        ha_manage_security_policy("set", policy={"wait_seconds": 60, "approval_ttl_minutes": 5, "event_decisions_enabled": False, "rules": [{"tool_name": "ha_call_service"}], "version": 3})
ha_call_service tool
Call any Home Assistant service or one-shot WebSocket command: the catch-all escape hatch.

        When NOT to use: a dedicated tool that covers the job. It validates the
        request, reports the outcome in its own terms, and stays available where
        a security policy gates this tool. For example: turn an automation on or
        off or run it now with ha_config_set_automation (enabled / run_actions);
        start or stop a script with ha_config_set_script (run); activate a scene
        with ha_config_set_scene (activate); manage apps (add-ons) with
        ha_manage_app; handle updates and Repairs issues with ha_manage_updates;
        set an integration's log level with ha_set_integration (log_level).

        When to use: a service no dedicated tool covers. Services follow the
        pattern domain.service (e.g., light.turn_on, climate.set_temperature);
        ha_list_services lists them with their fields.

        EXAMPLES:
        - ha_call_service("light", "turn_on", entity_id="light.living_room")
        - ha_call_service("climate", "set_temperature", entity_id="climate.thermostat", data={"temperature": 22})

        Result compaction (default ON): ``result`` is trimmed to the targeted
        entity's record (drops parent-group propagation) and stripped of
        ``context`` / ``last_*`` metadata and heavy attribute lists
        (``effect_list``, ``hue_scenes``).

        For detailed service documentation, use ha_get_skill_guide.

        **WebSocket command escape hatch (advanced):**
        Some Home Assistant operations are WebSocket-only commands, not
        registered services. Pass ``ws_command`` (instead of domain/service) to
        send one no dedicated tool covers, with its parameters in ``data``:
        ha_call_service(ws_command="<command type>", data={...}). Only one-shot
        request/response commands are supported, and the other service
        parameters (entity_id, return_response, etc.) don't apply.

        Unavailable in Read Only Mode, including read-like services and WebSocket
        commands. Use dedicated read tools while that mode is enabled.
ha_get_operation_status tool
Get the status of one or more device operations with real-time WebSocket verification.

        Bulk checks poll all operations concurrently under one shared
        timeout_seconds window and report per-item failures inside
        detailed_results instead of aborting the batch.

        Use this to track the operation_ids that ha_bulk_control returns.
        For current entity states, use ha_get_state instead.
ha_bulk_control tool
Manage explicit operations or one deterministic structural bulk action.

        When NOT to use: use ``ha_call_service`` for service-specific payloads or
        backend-native group targeting, and ``ha_search`` for fuzzy name discovery.

        **Operations mode** (``operations``, no ``selector``): put every target in
        this one call. Parallel execution is the default, and invalid items are
        reported without aborting valid operations in the same batch — but a batch
        in which every item fails validation dispatches nothing and fails the call.
        A batch that targets a group/aggregate entity together with one or more of
        its own individual members also fails closed (nothing dispatched): Home
        Assistant applies the action to every member when the group is targeted
        regardless of what else is listed, so a member row cannot exclude that
        member from the group's own action. Use selector mode with
        ``exclude_entity_ids`` when a group action must exclude specific members.

        **Selector mode** (``selector`` + ``action``): use exact area or floor IDs
        when exclusions must be applied after recursively expanding generic
        aggregate membership. Resolves a frozen visible leaf set before dispatch;
        it is not transactional, so Home Assistant may still report per-leaf
        failures. A selector resolving to more than 100 entities fails closed
        instead of dispatching a partial/oversized batch — narrow it (a more
        specific area/floor, or add ``exclude_entity_ids``) and retry. Set
        ``dry_run`` to preview the resolved set without changing state.
ha_list_services tool
List available Home Assistant services with optional pagination and detail control.

        Discovers services/actions that can be called via ha_call_service.

        EXAMPLES:
        - Light services with full parameter details: ha_list_services(domain="light", detail_level="full")
        - Search: ha_list_services(query="temperature")
        - Next page: ha_list_services(offset=50)
ha_restart tool
Execute a Home Assistant restart.

        WARNING: restarts the entire Home Assistant instance; all automations
        are unavailable during the restart, which typically takes 1-5 minutes.
        Config is validated automatically before the restart proceeds (to
        pre-check, call ha_get_system_health(include="config_check")). For
        configuration changes, consider ha_reload_core() instead, which reloads
        specific components without a full restart. When this server runs
        inside Home Assistant (embedded), it replies before the restart starts
        and is unreachable until Home Assistant is back; with safe_mode it
        stays down until Home Assistant is next restarted normally, because it
        is itself a custom integration.

        EXAMPLE: ha_restart(confirm=True)
ha_reload_core tool
Execute a Home Assistant configuration reload without a full restart.

        WHEN NOT TO USE: an integration that is not loaded yet has nothing to
        reload; a YAML block added for one needs ha_restart.

        Use it after editing automation/script YAML, adding YAML helpers, or
        changing customize.yaml or themes.

        Reload-all checks the configuration first and refuses, with the
        reason, when the check fails. A single integration's reload does not
        check first: some (template is one) log a configuration they reject
        and keep running, so read the result back.

        EXAMPLES:
        - ha_reload_core(target="automation")
        - ha_reload_core(entry_id="abc123")
ha_get_system_health tool
Get Home Assistant system health, including Zigbee (ZHA), Z-Wave JS, Thread and Matter networks.

        Returns health check results from integrations, system resources, and
        connectivity; available information varies by installation type and
        loaded integrations. Each domain carries the ``name`` and key ``labels``
        the System information dialog shows. Checks that Home Assistant runs in
        the background are awaited up to a deadline; one still running shows as
        pending, with a warning. Optional sections are selected with `include`.

        Not for one integration's diagnostics: use
        ha_get_integration(include_diagnostics=True). Not for themes: use
        ha_manage_theme(action='list'). Not for a single device's radio state:
        use ha_get_device. Use this tool for the state of the whole
        installation: health checks, repairs, radio networks, Supervisor,
        startup times and the configuration check.

        The result may include ``ha_mcp_update`` ``{current, latest,
        update_available}``. When update_available is true, tell the user a newer
        ha-mcp release is available (with ``python_required``, give ``upgrade_command``).

        EXAMPLES:
        - ha_get_system_health(include="repairs,zha_network,zwave_network,config_check")
        - ha_get_system_health(include="supervisor,integration_startup")
ha_manage_theme tool
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 the
        Marketplace (ha_manage_hacs); theme files
        are edited with ha_write_file or ha_config_set_yaml (beta), which
        reload themes after the edit. After any other change to theme files,
        ha_reload_core(target='themes') loads them.

        When to use: action='list' discovers installed theme names, the modes
        each theme declares and the current defaults; action='set' selects
        the backend default theme, the dark-mode one, or both in one call,
        and returns the defaults Home Assistant then holds. Home Assistant
        describes frontend.set_theme's fields in
        ha_list_services(domain='frontend', detail_level='full').

        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 defaults only -
        users who explicitly picked a theme in their profile keep their
        choice.

        EXAMPLES:
        - List themes: ha_manage_theme(action="list")
        - Set default theme: ha_manage_theme(action="set", theme_name="nord")
        - Set light and dark defaults: ha_manage_theme(
              action="set", theme_name="nord", theme_name_dark="nord_dark")
        - 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})
ha_get_todo tool
Get todo lists or items - list all todo lists or get items from a specific list.

        Without an entity_id: lists every entity in the 'todo' domain (shopping
        lists and other todo-type integrations) with entity_id, friendly_name
        and state (number of incomplete items or current status).

        With an entity_id: returns that list's items as Home Assistant reports
        them — uid, summary, status, and description, due and completed where
        set.

        EXAMPLES:
        - List all todo lists: ha_get_todo()
        - Get incomplete items: ha_get_todo("todo.shopping_list", status="needs_action")
ha_set_todo_item tool
Create, update or reorder a todo item in Home Assistant.

        Without `item` (create mode): creates a new item from summary.
        With `item` (update mode): changes the fields given, and moves the item
        when `move_after` is given, alone or together with other changes.
        Home Assistant refuses a description or due date the list does not
        support, and says which. The reply carries `todo_item`, the item as
        Home Assistant stores it afterwards, uid included, or null with a
        warning when it cannot be read back. With auto-backup on, an updated
        item is backed up first; `warnings` names a backup that was not taken
        because the item could not be read or the backup could not start.

        EXAMPLES:
        - Add item: ha_set_todo_item("todo.tasks", summary="Pay bills", due_date="2024-12-31")
        - Complete item: ha_set_todo_item("todo.shopping_list", item="Buy milk", status="completed")
        - Rename item: ha_set_todo_item("todo.tasks", item="Old task", rename="New task name")
        - Move to top: ha_set_todo_item("todo.tasks", item="Pay bills", move_after="")
ha_remove_todo_item tool
Remove items from a Home Assistant todo list.

        Give `item` or `remove_completed=True`, not both. Removal is permanent;
        to mark an item done instead, use ha_set_todo_item() with
        status="completed". `removed` lists the items the call asked for that
        are gone afterwards; with remove_completed=True that includes a
        completed item another client removed meanwhile. With auto-backup on,
        each item is backed up before it is removed; `warnings` names a backup
        not taken because the item could not be read or the backup could not
        start, and with remove_completed=True an item gone afterwards that was
        not completed when the list was read, so was not backed up.

        EXAMPLES:
        - ha_remove_todo_item("todo.shopping_list", "Buy milk")
        - ha_remove_todo_item("todo.shopping_list", ["Buy milk", "Bread"])
        - ha_remove_todo_item("todo.shopping_list", remove_completed=True)
ha_get_automation_traces tool
Get execution traces for automations and scripts to debug issues.

        Traces show what triggered a run, which conditions passed or failed,
        which actions executed, any errors, and variable values during
        execution. Home Assistant keeps only the most recent runs of each
        automation or script (its stored_traces setting), so older runs are
        not available.

        Do not use this tool for general log history or recorder statistics;
        use `ha_get_logs` for logs and `ha_get_history` for history/statistics.

        USAGE MODES:
        1. List recent traces (omit run_id and context_id).
           ha_get_automation_traces("automation.motion_light")
           ha_get_automation_traces(domain="automation")
        2. Get a detailed trace (provide run_id): returns Core's extended trace
           dict unchanged, including config, raw step trace, context, errors
           and variables. Pass `sections` to keep only named top-level keys
           (plus 'logbook' for the run's logbook); a requested name the run
           lacks is reported in `warnings` and the run's own keys are listed.
           An empty `sections` string means omitted.
           ha_get_automation_traces("automation.motion_light", run_id="1705312800.123456")
           ha_get_automation_traces(domain="automation", item_id="uid", run_id="...")
        3. Resolve a trace by context (provide context_id): the response
           selects Core's run for that context and reports `context_match` as
           `trace` or `parent`. With the ha_mcp_tools component,
           `context_other_matches` lists the other runs that matched the
           context id (own or triggering parent); Core's own `trace/contexts`
           keeps one run per context id. A context Core does not hold is
           reported as not found with a hint that the component resolves
           triggering (parent) contexts.
           ha_get_automation_traces(context_id="01J...")

        RESPONSE FIELDS:
        - A detail response is Core's extended `trace/get` dict: `config`,
          `trace`, `context`, `timestamp`, `state`, `error`,
          `script_execution`, `blueprint_inputs` and any run-specific fields.
        - `success`, `run_id`, `domain` and `item_id` identify the run.
          `entity_id` is present when the caller supplied it; a context-only
          lookup returns Core's `domain`/`item_id` instead of inventing one.
        - `context_match` is `trace` or `parent`; `context_scanned` reports
          how many stored runs the ha_mcp_tools component inspected while
          resolving the context id, and is 0 when Core's own-context map
          answered.
        - `logbook_entries`, `logbook_transport`, `logbook_total` and
          `logbook_truncated` describe the run's logbook rows.
ha_manage_updates tool
Manage Home Assistant updates (list, details, install, skip) and Repairs issues (ignore).

        Covers Core, OS, supervisor, apps (add-ons), device firmware, and
        Marketplace update entities, plus the Repairs issues in Settings > System > Repairs.
        Repairs are listed by ha_get_overview (not here); pass their domain and
        issue_id to 'ignore_repair' / 'unignore_repair'. In Read Only Mode the
        read actions ('list', 'get') stay available; write actions are blocked.

        'install' blocks until each update finishes (minutes). One that outlasts
        the request timeout ends the call with a connection timeout while it
        keeps running, and a Core update restarts Home Assistant; neither means
        failure, but later batch targets were not started. Confirm per entity
        with action='get'; finished updates drop out of 'list', which also
        returns ha_mcp_update — this MCP server's own update status {current,
        latest, update_available; python_required + upgrade_command if it needs another Python}.

        EXAMPLES:
        - Pre-update analysis: ha_manage_updates(action="get", entity_ids=["update.home_assistant_core_update"], include_release_notes=True)
        - Update everything pending in a category: ha_manage_updates(action="install", categories=["addons", "hacs"])
        - Dismiss a repair: ha_manage_updates(action="ignore_repair", repairs=[{"domain": "sun", "issue_id": "abc"}])
ha_eval_template tool
Execute a Jinja2 template render, or an automation condition check, in Home Assistant.

        Renders templates with Home Assistant's template engine (all states,
        functions and filters available), or checks a condition block the way
        an automation would and returns true/false.

        When to use: any one-shot answer DERIVED from current HA state (an
        average across sensors, a count of entities matching a condition, a
        rendered message with live values), and testing a template or condition
        before embedding it in an automation. One render beats fetching N states
        and doing the math yourself.

        When NOT to use: a plain single-entity value is ha_get_state /
        ha_search. Templates in automation `condition:` / `trigger:` positions
        or templated action names: prefer native constructs, which are validated
        at config load, where a template only errors at runtime and a non-truthy
        render is silently false — see ha_get_skill_guide for the anti-pattern
        list. Test the native condition here with `condition`.

        Results: a render that works but hits something suspect (an undefined
        variable, a missing attribute) still returns its result with the
        messages in `warnings`; strict=true makes those hard errors. A failed
        render returns Home Assistant's error text and, with the ha_mcp_tools
        component installed, the template `line` and `source_line` it failed on
        when the error names one.

        EXAMPLES:
        - ha_eval_template(template="{{ states.light | selectattr('state', 'eq', 'on') | list | count }}")
        - ha_eval_template(template="Hello {{ name }}", variables={"name": "Alice"})
        - ha_eval_template(condition={"condition": "numeric_state", "entity_id": "sensor.temperature", "above": 20})
ha_config_set_yaml tool
Update raw YAML configuration in configuration.yaml, packages/*.yaml, or themes/*.yaml (LAST RESORT).

        MUST call ha_get_skill_guide OR refer to your locally installed skills first.
        ``template-guidelines.md`` ships under ``skill_content`` by default.

        Destructive, disabled by default. Prefer the dedicated tools:
        ha_config_set_helper for template sensors and every other helper type,
        ha_config_set_automation / ha_config_set_script / ha_config_set_scene
        for storage-mode items.

        Intended for YAML-only integrations with no config-flow or API
        equivalent (command_line, rest, shell_command, notify platforms),
        for integrations with significant YAML-only configuration (knx
        entities in package files), for registering YAML-mode dashboards via
        ``lovelace.dashboards.<url_path>`` (no other ``lovelace.*`` keys),
        and for editing theme files in ``themes/*.yaml``. Themes only load when
        configuration.yaml carries the ``frontend: themes:`` include (e.g.
        ``!include_dir_merge_named themes``); this tool cannot add that include
        (``frontend`` is not an allowed key). ``automation``, ``script`` and
        ``scene`` keys are accepted only when ``file`` is a ``packages/*.yaml``
        and the operator has turned on that key's packages setting (each is
        off by default); writes of those keys to ``configuration.yaml`` are
        rejected; use the storage-mode tools.

        Check ``post_action`` in the response. For ``themes/*.yaml`` this tool
        *performs* the reload itself (``frontend.reload_themes``), so
        ``post_action`` is ``reload_performed`` (or ``reload_available`` plus
        ``reload_error`` if that reload failed). For any other key it is
        ``reload_available`` with the ``reload_service`` to call yourself when
        Home Assistant has ``<key>.reload`` (the key's integration is loaded),
        and ``restart_required`` otherwise; the edit is on disk but not yet
        live. Preserves YAML comments and HA tags (``!include``,
        ``!secret``) on round-trip; ``replace`` swaps the subtree as-is.

        Two-step confirmation (default ON, toggle ENABLE_YAML_EDIT_CONFIRM /
        Server Settings): the first call returns ``preview: true`` with a
        unified ``diff`` of exactly what would change on disk and a
        ``confirm_token`` — nothing is written. Review the diff, then repeat
        the identical call adding ``confirm_token`` to apply. Every applied
        write also returns the final ``diff``. A token mismatch means the file
        changed since the preview (or the token was wrong); use the freshly
        returned token.
ha_config_get_yaml tool
Get the current YAML fragment under a key, from one config file or across a glob.

        Use before ha_config_set_yaml to inspect what a key currently holds, and
        to find which file defines it — when ha_config_set_yaml accepts this
        ``yaml_path`` for the returned ``file``, the two are exactly the
        arguments that address the same fragment for an edit. To change a value
        nested below such a key, read the whole key and replace it.

        Not for storage-mode items: automations, scripts and scenes created
        through the UI live outside YAML — read those with ha_config_get_automation,
        ha_config_get_script and ha_config_get_scene. This tool sees only what is
        written in the config files themselves.

        Reads the file, so it reflects what is on disk rather than what Home
        Assistant currently has loaded; a fragment edited but not yet reloaded
        differs from the running config. Comments and HA tags survive as written
        and a ``!secret`` is never resolved to its value, so ``content`` can be
        handed back to ha_config_set_yaml unchanged. Files outside the read
        allowlist stay unreadable, and secrets.yaml reads back with its values
        masked.
ha_get_zone tool
Get zone information - list all zones or get details for a specific one.

        Without a zone_id: Lists all Home Assistant zones with their coordinates and radius.
        With a zone_id: Returns detailed configuration for a specific zone.

        EXAMPLES:
        - List all zones: ha_get_zone()
        - Get specific zone: ha_get_zone(zone_id="office")
        - Same zone by entity_id: ha_get_zone(zone_id="zone.office")

        Zones outside the zone storage, the home zone (from the general
        settings) and YAML zones, are listed with ``editable=false`` /
        ``source="yaml"``; editable means ha_set_zone and ha_remove_zone can
        change the zone. Each zone carries its entity_id.

        A stored zone's ``icon`` is the one stored in the zone, which the
        Zones editor shows. ``entity_icon`` is an icon override in the zone
        entity's registry entry: the map and the zone's state show it instead.
        Set or clear the override with ha_set_entity.
ha_set_zone tool
Create or update a Home Assistant zone.

        Omit zone_id to create a new zone (name, latitude, longitude required).
        Provide zone_id to update an existing zone (only specified fields change).
        Zones defined in YAML, and the home zone, cannot be changed here.

        EXAMPLES:
        - Create: ha_set_zone(name="Office", latitude=40.7128, longitude=-74.0060, radius=150, icon="mdi:briefcase")
        - Update: ha_set_zone(zone_id="office", radius=200)
        - Update by entity_id: ha_set_zone(zone_id="zone.office", radius=200)
ha_remove_zone tool
Remove a Home Assistant zone.

        EXAMPLES:
        - Remove zone: ha_remove_zone("office")
        - Remove by entity_id: ha_remove_zone("zone.office")

        **WARNING:** Removing a zone used in automations may cause those automations to fail.
        Use ha_get_zone() to find the zone_id for the zone you want to remove.

        **NOTE:** Zones defined in YAML, and the home zone, cannot be removed here.
tool tool
ha_call_service tool
ha_bulk_control tool
ha_get_state tool
ha_call_service tool
Call a service.

        Args:
            domain: HA domain
ha_set_integration tool
tool tool
ha_get_dashboard_screenshot tool
tool tool
ha_get_app tool
ha_manage_app tool
ha_manage_blueprints tool
ha_get_entity tool
ha_config_get_automation tool
ha_config_remove_automation tool
ha_get_automation_traces tool
tool tool
tool tool
ha_config_set_automation tool
ha_config_set_script tool
ha_config_set_helper tool
ha_config_get_automation tool
ha_config_get_automation tool
ha_get_history tool
Get the history of an entity.
ha_config_get_label tool
Get a label.
first_prompt prompt
First prompt description.
prompt prompt
component prompt
fn prompt
prompt prompt
name_or_fn prompt
(name computed at run time) prompt
prompt prompt
prompt prompt
? prompt
get_greeting resource
Provides a simple greeting message.
first_resource resource
First resource description.
resource resource
component resource
fn resource
resource resource
uri resource
html resource
resource resource
resource.resource resource
(name computed at run time) resource
resource resource
resource resource

What we checked

The same checks run on every server. Each line below has one of these marks:

FoundA published issue such as a risky tool or a CVE
PassedWe ran the check on this server and found nothing
After reviewChecked; we publish it once a person verifies it
Partly tracedRan, but the scanner could not follow every path to its end
FactWhat the code does, not a judgement either way
Not checkedThe scanner had nothing to read for it, or it needs the live server
Code Safetypartly traced
  • 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injection
    Checked on every scan. Results in this category are published only after a person has verified them.
Capability Exposure6.1
  • Runs programs the caller chooses
    No tool runs a command or program the caller supplies — 133 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Executes caller-supplied code
    No tool evaluates code the caller supplies — 133 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Reads or writes any file path
    No tool works on a file path the caller supplies without a root check — 133 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Requests any address
    No tool sends a request to an address the caller supplies — 133 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Runs caller-supplied SQL
    No tool executes a query the caller supplies — 133 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Tools that start processes
    Not seen in the traced code of 133 capabilities; 97 more call code the scanner could not follow, where it may happen
  • Tools that touch files
    86 of 133 capabilities touch files; 11 more call code the scanner could not follow, where it may happen
  • Tools that call the network
    84 of 133 capabilities call the network; 13 more call code the scanner could not follow, where it may happen
Where the code is: 133 handlers in 62 files at commit f1efa0437a34
Prompt Integrity10.0
  • 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrity
    Checked on every scan. Results in this category are published only after a person has verified them.
Supply Chain7.0
  • Dependency manifests
    8 manifests: pyproject.toml, site/package.json, src/ha_mcp/_vendor/requirements.txt, tests/haos_image_build/requirements.txt, tests/js/package.json
  • Lockfiles checked against OSV
    7 files resolved and checked against the OSV database; 3 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked; tests/haos_image_build/requirements.txt: 1 dependency line carries no exact version, so the installed version was not checked; pin them or add a lockfile
  • Known vulnerabilities in production dependencies
    No production dependency with a known advisory
  • Known vulnerabilities in other dependencies
    2 packages with advisories used only for development, tests or examples; an install of the server leaves them out
  • MCP SDK version
    mcp ==2.3.0
Secrets & Credentials10.0
  • 3 checks: credential harvesting, undeclared credential access, credentials sent over the network
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tools that read credentials
    86 of 133 capabilities read credentials; 11 more call code the scanner could not follow, where it may happen
  • Environment variables
    86 capabilities read environment variables (often API keys)
  • Authentication declared
    Not checked: needs the live server's tools/list (a remote server declares how clients authenticate)
Behavior Transparency10.0
  • 3 checks: undeclared network access, undeclared file access, undeclared process execution
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tool descriptions present
    Every tool has a description the model and the user can read (11 only in code no tool reaches)
  • Statically known names
    Every tool's name could be read from the code
  • Input schemas
    Not checked: needs the live server's tools/list (every tool declares an input schema)
  • Destructive tools annotated
    Not checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)

Dependencies with known vulnerabilities (0 in production)

Dependency ranges were not resolved against a lockfile, so the score is capped at 7.

No known vulnerabilities in the production dependencies that could be checked.

2 vulnerable packages outside the server itself (used only for development, tests or examples, not shipped)
PackageInstalledWorstAdvisoriesFixed in
minimatchnpm 10.2.5 MEDIUM 1 advisory 11.0.1
  • MEDIUMGHSA-g3hv-75wg-m249 CVE-2026-118764minimatch has potential denial of service via globparts amplification
yamlnpm 2.7.1 MEDIUM 1 advisory 1.10.32.8.3
  • MEDIUMGHSA-48c2-rrv3-qjmp CVE-2026-33532yaml is vulnerable to Stack Overflow via deeply nested YAML collections

Past security advisories

Vulnerabilities published for this server itself, from the GitHub Advisory Database.

  • MEDIUM
    ha-mcp: Add-on settings and policy routes are reachable without authentication at the bare root path
    2026-07-07fixed in 7.10.0
  • MEDIUM
    Home Assistant MCP Server: YAML config backups written under www/ are served unauthenticated at /local/
    2026-05-14fixed in 7.5.0
  • MEDIUM
    GHSA-pf93-j98v-25pvCVE-2026-32112
    ha-mcp has XSS via Unescaped HTML in OAuth Consent Form
    2026-03-12fixed in 7.0.0
  • MEDIUM
    GHSA-fmfg-9g7c-3vq7CVE-2026-32111
    ha-mcp OAuth 2.1 DCR mode enables network reconnaissance via an error oracle
    2026-03-12fixed in 7.0.0

How it runs

Where it runsOn your machine, started by your MCP client from this repository or its package
TransportStreamable HTTP, stdio
Sign-innot checked needs the live server
MCP SDKmcp ==2.3.0
Servers in the code20 (Component Manager, mcp, backup-manager-tests, categorized-search, code-mode, error-log-structured, test, ha-mcp-loopback-test, guardrail, report-issue, single-use-approval-test, Approval test, policy schema test, unused, quirky, annotations, backup-access-test)

The project's own security

Security policyyes SECURITY.md
Private reportingmentioned the policy names a private channel
Past advisories4 · 4 with a fixed version released
Last push2026-11-15
Signed releasesnot checked yet

Where it is published

MCP Registryio.github.homeassistant-ai/ha-mcp
Listed in5 catalogs (awesome_habitoai, github_search, glama, mcp_registry, mcp_toplist)
LicenseMIT
Created2025-09-14
Topicsai claude hacs home-assistant home-automation llm mcp model-context-protocol

Attack map

How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.

Request a scan or an audit

Tell us about your server. We reply within 5 working days.

What do you need? *

We use these details only to answer you.