Skip to main content
Glama
homeassistant-ai

Home Assistant MCP Server

Official

Get Entity

ha_get_entity
Read-onlyIdempotent

Retrieve entity registry metadata including area, name, icon, and enabled state. Optionally resolve a unique integration ID to its entity ID.

Instructions

Get entity registry information for one or more entities.

Returns detailed entity registry metadata including area assignment, custom name/icon, enabled/hidden state, aliases, labels, and more.

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

RELATED TOOLS:

  • ha_set_entity(): Modify entity properties (area, name, icon, enabled, hidden, aliases)

  • ha_get_state(): Get current state/attributes (on/off, temperature, etc.)

  • ha_search(): Find entities by name, domain, or area

EXAMPLES:

  • Single entity: ha_get_entity("sensor.temperature")

  • Multiple entities: ha_get_entity(["light.living_room", "switch.porch"])

RESPONSE FIELDS:

  • entity_id: Full entity identifier

  • name: Custom display name (null if using original_name)

  • original_name: Default name from integration

  • icon: Custom icon (null if using default)

  • area_id: Assigned area/room ID (null if unassigned)

  • disabled_by: Why disabled (null=enabled, "user"/"integration"/etc)

  • hidden_by: Why hidden (null=visible, "user"/"integration"/etc)

  • enabled: Boolean shorthand (True if disabled_by is null)

  • hidden: Boolean shorthand (True if hidden_by is not null)

  • aliases: Voice assistant aliases

  • labels: Assigned label IDs

  • categories: Category assignments (dict mapping scope to category_id)

  • device_class: User "Show As" override (null = use original_device_class)

  • original_device_class: Default device class from the integration

  • options: Per-domain registry options (e.g. sensor display_precision). Voice-assistant exposure is also stored here but should be set/cleared via the ha_set_entity(expose_to=...) parameter, not the options dict.

  • platform: Integration platform (e.g., "hue", "zwave_js")

  • device_id: Associated device ID (null if standalone)

  • config_entry_id: Parent config entry's ID (null for YAML-only entities). When 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.

  • unique_id: Integration's unique identifier

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; resolves area_id above)

  • floor: Floor NAME of the assigned area

  • label_names: Assigned label NAMES (resolves the label ids in labels) Resolved label names live under label_names HERE (this tool's base labels already carries the label ids); ha_search result_fields and ha_get_entity_exposure instead emit the resolved names under labels.

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']). Mutually exclusive with unique_id.
unique_idNoResolve 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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true. The description adds substantial behavioral context: explains resolver mode behavior, details response fields including resolved-name enrichment, warns about aliases/device_class defaults in resolver mode, and provides guidance on using config_entry_id for helper configuration retrieval. No contradiction with annotations.

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

Conciseness4/5

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

Description is long but well-structured with clear sections (RESOLVER MODE, RELATED TOOLS, EXAMPLES, RESPONSE FIELDS). Information is front-loaded with the core purpose. While some technical details could be compressed, the structure is logical and aids readability.

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 complexity (4 parameters, output schema, annotations), the description is exceptionally complete. It explains all response fields, includes rich behavioral details, and links to complementary tools. The resolved-name enrichment caveat adds valuable context. No gaps identified.

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 baseline is 3. The description adds value by explaining resolver mode, mutual exclusivity of entity_id and unique_id, and the role of domain/platform filters. It does not repeat schema details but provides contextual meaning beyond the parameter descriptions.

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 clearly states 'Get entity registry information for one or more entities.' It uses a specific verb ('get') and resource ('entity registry information'), and distinguishes from sibling tools like ha_set_entity (modify), ha_get_state (current state), and ha_search (find entities).

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?

The description explains the resolver mode for unique_id, provides examples for single/multiple entities, and lists related tools with brief descriptions. However, it does not explicitly state when not to use this tool or when alternatives are preferred beyond the related tools list.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/homeassistant-ai/ha-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server