Skip to main content
Glama

List entities with filters

entities_list_entities
Read-onlyIdempotent

Browse and search current Home Assistant entity states with optional domain filtering, pagination, and field selection.

Instructions

List entity states, optionally filtered by domain, with pagination and field selection.

Reads live states via ha.get_states() over HTTP; when fields requests area_id, device_id or labels, it also fetches the entity registry over WebSocket and joins it by entity ID. Filtering by domain and pagination (limit/offset) are applied client-side after the fetch.

Use when: browsing or searching current entity states across the whole installation or one domain. Not for: raw registry fields such as disabled/hidden status — use entities_list_entity_registry; a plain unfiltered state dump — use ws_get_states. Returns: list of dicts, one per entity, containing only the requested fields. Limits: limit/offset paginate the already-filtered list; no size cap beyond that.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of entities to return after filtering, for pagination. Omit for no limit.
domainNoEntity domain prefix filter, e.g. 'light' or 'sensor'. Omit to include every domain.
fieldsNoPer-entity keys to return. Defaults to entity_id, state, friendly_name. Also accepts attributes, area_id, device_id, labels.
offsetNoNumber of filtered entities to skip before applying limit. 0 starts from the first match.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.25.1
    • changedInput schema / properties / domain / description
      Previous value: -"Filter by domain prefix (e.g. 'light', 'sensor')."New value: +"Entity domain prefix filter, e.g. 'light' or 'sensor'. Omit to include every domain."
    • changedInput schema / properties / fields / description
      Previous value: -"Keys to return per entity. Defaults to [entity_id, state, friendly_name].\n    Also accepts: attributes, area_id, device_id, labels."New value: +"Per-entity keys to return. Defaults to entity_id, state, friendly_name. Also accepts attributes, area_id, device_id, labels."
    • changedInput schema / properties / limit / description
      Previous value: -"Max number of results. Omit for all."New value: +"Maximum number of entities to return after filtering, for pagination. Omit for no limit."
    • changedInput schema / properties / offset / description
      Previous value: -"Skip first N results (pagination)."New value: +"Number of filtered entities to skip before applying limit. 0 starts from the first match."
  2. Changed4 schema fields changedv0.18.1
    • addedInput schema / properties / domain / description
      Added value: +"Filter by domain prefix (e.g. 'light', 'sensor')."
    • addedInput schema / properties / fields
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Keys to return per entity. Defaults to [entity_id, state, friendly_name].\n    Also accepts: attributes, area_id, device_id, labels."
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Max number of results. Omit for all."
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Skip first N results (pagination).",
      +  "type": "integer"
      +}
  3. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations that confirm it's read-only and idempotent, the description discloses key behavioral traits: it reads live states via HTTP, conditionally fetches the entity registry over WebSocket when area_id/device_id/labels are requested and joins by entity ID, and applies filtering/pagination client-side. It also describes the return format and limits. This is rich, non-obvious context.

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

Conciseness5/5

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

The description is well-structured with clear sections (overview, implementation details, use when, not for, returns, limits). Every sentence is informative and front-loaded with the core purpose.

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

Completeness4/5

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

Given annotations cover safety and an output schema exists, the description provides comprehensive context on behavior, usage, and limits. It could be slightly more complete by mentioning potential performance implications of client-side filtering over large installations, but it's very thorough.

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

Parameters3/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 all parameters. The description mentions filtering by domain, pagination via limit/offset, and field selection, but does not add syntax or format details beyond the schema. Baseline 3 is appropriate.

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 clear verb+resource: 'List entity states, optionally filtered by domain, with pagination and field selection.' It distinguishes itself from siblings by explicitly naming alternatives (entities_list_entity_registry, ws_get_states).

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?

The 'Use when' and 'Not for' sections explicitly name alternatives and the conditions that select them. This is textbook routing guidance, leaving no ambiguity about when to use this tool versus others.

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