Skip to main content
Glama

Get state history

ha_get_history
Read-onlyIdempotent

Fetch historical state changes for one or more Home Assistant entities across a defined time range. Use entity IDs plus optional start and end timestamps to inspect past states.

Instructions

State changes for one or more entities. Args: entityIds (required), start (default: 1 day ago), end, minimalResponse (default true — only state + last_changed, much smaller), noAttributes. Returns: one array per entity. Requires the recorder integration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoISO 8601 timestamp, e.g. 2026-10-17T00:00:00+07:00. End of the period. Defaults to 1 day after start.
startNoISO 8601 timestamp, e.g. 2026-10-17T00:00:00+07:00. Start of the period. Defaults to 1 day before now.
entityIdsYesEntity ids, e.g. ["sensor.kitchen_temperature"]
noAttributesNo
minimalResponseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 bar is lower, yet the description adds real value: it states the recorder-integration prerequisite and describes the return shape ('one array per entity') with no output schema present. It also explains the minimalResponse trade-off (only state + last_changed, much smaller).

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 purpose in the first sentence, then a compact Args/Returns block. Dense and terse rather than wasteful, though the inline Args list reads as schema duplication rather than prose.

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?

For a read-only history query with annotations covering the safety profile and no output schema, the description covers purpose, prerequisites, return structure and key parameter defaults. Only the noAttributes flag and pagination/limits go unmentioned.

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 60%, and the description reinforces the important parameters with defaults (entityIds required, start default 1 day ago, minimalResponse default true) while adding meaning the schema lacks — what minimalResponse actually omits. It leaves noAttributes unexplained, a minor gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: retrieving state changes over a period for one or more entities. This is clearly distinct from ha_get_state (current state) and ha_list_states, though the description doesn't explicitly name those alternatives. The scope ('one or more entities') is concrete.

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

Usage Guidelines3/5

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

Usage is implied by 'state changes' plus the recorder prerequisite, which tells the agent when the tool is even viable. However, there is no explicit when-to-use/when-not guidance or direction to a sibling over this tool. Minimum viable.

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