Skip to main content
Glama
homeassistant-ai

Home Assistant MCP Server

Official

Get Entity

ha_get_entity
Read-onlyIdempotent

Retrieve Home Assistant entity registry details, including area, labels, device info, and aliases; resolve a stable unique_id to its entity_id(s) to identify or inspect entities.

Instructions

Get entity registry information for one or more entities.

Returns detailed entity registry metadata: area, custom name/icon, original name, disabled_by/hidden_by (with enabled/hidden shorthands), aliases (a null entry = the entity's own name), labels, categories, device_class override, per-domain options, platform, device_id, config_entry_id and unique_id.

RESOLVER MODE: Pass unique_id (instead of entity_id) to resolve a stable integration unique_id 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. Resolver reads as_partial_dict, so aliases and the device_class override come back as defaults ([]/null).

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. Voice-assistant exposure is stored under options but is set via ha_set_entity(expose_to=...).

Resolved-name enrichment (present only when the ha_mcp_tools component advertises it; otherwise these keys are absent): 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 ha_get_entity_exposure instead emit the resolved names under labels.

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

get entity state attributes details single specific entity_id

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNoResolver filter (unique_id mode only): restrict matches to this entity domain, e.g. 'sensor'.
platformNoResolver filter (unique_id mode only): restrict matches to this integration platform, e.g. 'hue'.
entity_idNoEntity ID or list of entity IDs to retrieve (e.g., 'sensor.temperature' or ['light.living_room', 'switch.porch']).
unique_idNoStable integration unique_id (entity_id is mutable, unique_id is not). Mutually exclusive with entity_id.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv8.6.0
    • changedInput schema / properties / entity_id / description
      Previous value: -"Entity ID or list of entity IDs to retrieve (e.g., 'sensor.temperature' or ['light.living_room', 'switch.porch']). Mutually exclusive with unique_id."New value: +"Entity ID or list of entity IDs to retrieve (e.g., 'sensor.temperature' or ['light.living_room', 'switch.porch'])."
    • changedInput schema / properties / unique_id / description
      Previous value: -"Resolve a stable integration unique_id to its entity_id(s) (entity_id is mutable, unique_id is not). Mutually exclusive with entity_id. Optionally narrow with domain/platform."New value: +"Stable integration unique_id (entity_id is mutable, unique_id is not). Mutually exclusive with entity_id."
  2. First observedv7.14.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare the safe read-only/idempotent profile, yet the description adds substantial non-obvious behavior: resolver mode reads as_partial_dict so aliases and device_class override return defaults, the same unique_id can match multiple platforms, and enrichment keys (area/floor/label_names) appear only when the component advertises them. This is 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.

Conciseness3/5

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

Front-loaded and dense with genuinely useful detail, but it is overlong and ends with an unexplained, machine-sounding fragment ('get entity state attributes details single specific entity_id') that reads as keyword stuffing and should have been removed.

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?

Has an output schema and 100% param coverage, so return values and argument formats are already documented; the description still supplies the mode-switching logic, cross-tool handoff (ha_get_integration for config_entry_id), and conditional-field caveats. Nothing needed to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, but the description goes beyond it: it explains that unique_id and entity_id are alternate modes, that domain/platform act as resolver-only filters, and that multiple matches are returned with a matches count. It does not repeat the scalar entity_id format syntax, which the schema already handles.

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?

Opens with a specific verb+resource ('Get entity registry information for one or more entities') and immediately differentiates itself from the closest sibling by scoping to registry metadata rather than state. The RELATED TOOLS line makes the boundary against ha_get_state explicit.

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

Usage Guidelines4/5

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

Gives clear routing context: use RESOLVER MODE with unique_id when resolving a stable integration id, and use ha_set_entity/ha_get_state/ha_search for adjacent jobs. It names alternatives but the when-not conditions are mostly implied by the RELATED TOOLS list rather than stated as exclusions.

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