Skip to main content
Glama
Home Assistant MCP Server

Home Assistant MCP Server

Official

Create or Update Group

ha_config_set_group
Destructive

Create or update service-based Home Assistant entity groups via group.set, including adding or removing members, for compatibility with existing YAML or service-defined groups.

Instructions

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"])

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "object_id": "<object_id>"
    },
    "name": "ha_config_set_group"
  }
}

Input Schema

NameRequiredDescriptionDefault
iconNoMaterial Design Icon (e.g., 'mdi:lightbulb-group')
nameNoFriendly display name; a new group without one is named after object_id
waitNoWait for group to be queryable before returning. Set to False for bulk operations.
all_onNoIf True, all entities must be on for group to be on. Core does not expose the mode, so it cannot be read back and a backup does not restore it.
entitiesNoList of entity IDs for the group. When updating, replaces all entities; an empty list empties the group, or creates it without members.
object_idYesGroup identifier: a lowercase slug without the 'group.' prefix (e.g., 'living_room_lights')
add_entitiesNoEntities to add to the group's members
remove_entitiesNoEntities to remove from the group's members

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv9.0.0
    • changedInput schema / properties / add_entities / description
      Previous value: -"Add these entities to an existing group"New value: +"Entities to add to the group's members"
    • changedInput schema / properties / all_on / description
      Previous value: -"If True, all entities must be on for group to be on"New value: +"If True, all entities must be on for group to be on. Core does not expose the mode, so it cannot be read back and a backup does not restore it."
    • changedInput schema / properties / entities / description
      Previous value: -"List of entity IDs for the group. When updating, replaces all entities."New value: +"List of entity IDs for the group. When updating, replaces all entities; an empty list empties the group, or creates it without members."
    • changedInput schema / properties / name / description
      Previous value: -"Friendly display name for the group"New value: +"Friendly display name; a new group without one is named after object_id"
    • changedInput schema / properties / object_id / description
      Previous value: -"Group identifier without 'group.' prefix (e.g., 'living_room_lights')"New value: +"Group identifier: a lowercase slug without the 'group.' prefix (e.g., 'living_room_lights')"
    • changedInput schema / properties / remove_entities / description
      Previous value: -"Remove these entities from an existing group"New value: +"Entities to remove from the group's members"
  2. Changed5 schema fields changedv8.6.0
    • changedInput schema / properties / add_entities / description
      Previous value: -"Add these entities to an existing group (mutually exclusive with entities)"New value: +"Add these entities to an existing group"
    • changedInput schema / properties / all_on / description
      Previous value: -"If True, all entities must be on for group to be on (default: False)"New value: +"If True, all entities must be on for group to be on"
    • changedInput schema / properties / entities / description
      Previous value: -"List of entity IDs for the group. Required when creating new group. When updating, replaces all entities (mutually exclusive with add_entities/remove_entities)."New value: +"List of entity IDs for the group. When updating, replaces all entities."
    • changedInput schema / properties / remove_entities / description
      Previous value: -"Remove these entities from an existing group (mutually exclusive with entities)"New value: +"Remove these entities from an existing group"
    • changedInput schema / properties / wait / description
      Previous value: -"Wait for group to be queryable before returning. Default: True. Set to False for bulk operations."New value: +"Wait for group to be queryable before returning. Set to False for bulk operations."
  3. First observedv7.14.2

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses important lifecycle behavior: groups are only removable via `ha_config_remove_group`, are not found by `ha_remove_helpers_integrations`, survive group.reload but not restart, and core creates or updates depending on existence. It also states mutual exclusivity among entities, add_entities, and remove_entities, plus a Claude Desktop timeout workaround.

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

Conciseness4/5

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

The description is well structured and front-loads the most important routing guidance: when not to use, then when to use. It is somewhat long, especially the Claude Desktop timeout workaround, but the length is largely justified by the tool's complex behavior and compatibility caveats.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's mutation behavior, 8 parameters, and existing output schema, the description is complete enough for correct invocation. It covers creation/update semantics, lifecycle and removal constraints, restart behavior, mutual exclusivity, and a client-specific failure mode.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents every parameter well. The description adds value beyond the schema by stating that entities, add_entities, and remove_entities are mutually exclusive and by providing concrete usage examples. It does not need to restate parameter formats, but the extra semantic clarification is helpful.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: create or update a service-based Home Assistant entity group via group.set. It explicitly distinguishes this from config-entry-backed helper groups and names the sibling tool that should normally be used instead.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit 'When NOT to use' and 'When to use' guidance, naming `ha_config_set_helper(helper_type="group", ...)` as the preferred alternative for typical group requests. It also explains the compatibility and registry-membership conditions that select this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools