Skip to main content
Glama

Get all entity states via WebSocket

ws_get_states
Read-onlyIdempotent

Fetch all Home Assistant entity states in one WebSocket call, avoiding per-entity HTTP overhead on large installations. Use it when you need every entity's state, not filtered or paginated results.

Instructions

Get all entity states over the WebSocket API in one call.

Sends get_states and waits up to timeout seconds for the matching result message; this can be faster than the HTTP /api/states endpoint on large installs since it avoids per-entity HTTP overhead.

Use when: fetching every entity's state on a large installation. Not for: a filtered or paginated state list — use entities_list_entities. Returns: the list of state dicts from HA's result.result. Errors: raises RuntimeError when the WebSocket handshake or the result message does not arrive within timeout, or when a result message arrives but is not successful. Limits: blocks for up to timeout seconds (default 10), including the initial handshake.

Input Schema

NameRequiredDescriptionDefault
timeoutNoMaximum seconds to wait for the WebSocket handshake and the result message before raising an error; must be between 1 and 300.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / timeout
      Added value: +{
      +  "default": 10,
      +  "description": "Maximum seconds to wait for the WebSocket handshake and the result message before raising an error; must be between 1 and 300.",
      +  "maximum": 300,
      +  "minimum": 1,
      +  "type": "number"
      +}
  2. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds value beyond that: it discloses that the call blocks up to timeout seconds (including handshake), and that it raises RuntimeError on handshake failure or an unsuccessful result message. This is meaningful failure-mode context, though return shape is deferred to the output schema.

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?

Front-loads the core action and uses labeled sections (Use when / Not for / Returns / Errors / Limits) that make it scannable. The 'Returns' line is somewhat redundant given the output schema, but overall the text earns its place.

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?

Covers purpose, selection criteria, error conditions, and blocking limits, which is ample for a single-parameter read tool. Since an output schema exists, the brief 'Returns' note is a minor redundancy rather than a gap.

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 description coverage is 100% and the single timeout parameter (range, default) is fully documented there. The description mentions the default of 10 and the blocking semantics, but adds no syntax or format 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?

States a specific verb and resource ('Get all entity states') plus the transport mechanism (WebSocket API) and scope ('in one call'). It explicitly contrasts with the HTTP /api/states endpoint and the filtered sibling entities_list_entities, so an agent can distinguish it without opening any schema.

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?

Provides explicit 'Use when' (fetching every entity on a large installation) and 'Not for' (filtered/paginated lists) guidance, naming the alternative tool by name. The selection condition is fully spelled out.

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