Skip to main content
Glama

Control area entities by domain

areas_control_area

Control every entity of a chosen domain within a Home Assistant area by turning them on, off, or toggling. Use it for whole-room actions like all lights.

Instructions

Turn on, off or toggle every entity of one domain in an area.

Calls service <domain>.<action> over HTTP with {"area_id": area_id} as the target, so Home Assistant dispatches it to every entity of that domain in the area. action must be one of turn_on/turn_off/toggle (ADR-0006 D6) — an unchecked value here could reach an arbitrary <domain>.<action> service under cover of "controlling an area".

Use when: controlling a whole area by domain, e.g. all lights in a room. Not for: controlling an explicit list of entity_ids across areas — use entities_bulk_control. Returns: list of state-change dicts as returned by the HA service call. Errors: raises ValueError when action is not one of turn_on, turn_off, toggle. Limits: an invalid domain (no such domain, or the domain has no matching service) fails with the underlying HTTP error from Home Assistant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesService to call on the domain: 'turn_on', 'turn_off' or 'toggle'.
domainNoEntity domain to target within the area, e.g. 'light' or 'switch'; defaults to 'light'.light
area_idYesArea registry ID to target; obtain it from areas_list_areas.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.25.1
    • addedInput schema / properties / action / description
      Added value: +"Service to call on the domain: 'turn_on', 'turn_off' or 'toggle'."
    • addedInput schema / properties / area_id / description
      Added value: +"Area registry ID to target; obtain it from areas_list_areas."
    • addedInput schema / properties / domain / description
      Added value: +"Entity domain to target within the area, e.g. 'light' or 'switch'; defaults to 'light'."
  2. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint=false, idempotentHint=false), and the description goes well beyond them: it explains that the action is a validated enum (turn_on/turn_off/toggle), that an unchecked value could reach an arbitrary service, that ValueError is raised on bad action, and that an invalid domain surfaces the underlying HA HTTP error. Error modes and validation behavior are exactly the kind of context structured fields cannot carry.

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 action is front-loaded in sentence one and the labeled Use when / Not for / Errors / Limits blocks are easy to scan. Slightly verbose: the ADR-0006 parenthetical and the 'Returns' line restate what the output schema already provides, so a little text does not earn its place.

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

Completeness5/5

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

For a three-parameter mutation tool this covers everything an agent needs: selection criteria, the alternative tool, the service-dispatch mechanism, validation failures, and upstream HTTP failure behavior. Return values are already covered by the output schema, so the extra 'Returns' line is a harmless redundancy rather than a gap.

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 baseline is 3, but the description adds compositional meaning the schema does not: `domain` and `action` are combined into the `<domain>.<action>` service name and `area_id` is passed as the target payload, so the agent understands the parameters jointly rather than as three independent fields. It does not explain the `light` default beyond the schema text.

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 first sentence states a specific verb (turn on/off/toggle) and a precise resource scope (every entity of one domain within an area). It also discloses the underlying mechanism — dispatching `<domain>.<action>` with an area target — which distinguishes it unambiguously from entity-level and list-level siblings.

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 contains an explicit 'Use when' clause ('controlling a whole area by domain, e.g. all lights in a room') and an explicit 'Not for' clause naming the alternative (`entities_bulk_control`) for explicit entity_id lists across areas. Nothing about tool selection is left to inference.

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