Skip to main content
Glama

get_history_range

Fetch raw state-change history for an entity within a defined date/time window. Use to inspect specific days or correlate with external events.

Instructions

Get raw state-change history for an entity over a date/time range.

Like get_history, but takes an explicit window instead of "N hours from now". Useful for inspecting what happened on a specific day or correlating with an external event.

Args: entity_id: The entity to fetch history for. start_time: ISO-8601 start (e.g. 2026-05-15 or 2026-05-15T08:00:00Z). Treated as UTC if no offset. end_time: ISO-8601 end. Defaults to now (UTC).

Returns: Same shape as get_history: entity_id, states, count, first_changed, last_changed.

Examples: get_history_range("light.kitchen", "2026-05-15") get_history_range("sensor.power", "2026-05-15T00:00:00Z", "2026-05-16T00:00:00Z")

Best Practices: - Bound the window — wider ranges return more data and more tokens. - For aggregated long-term data, prefer get_statistics_range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_timeNo
entity_idYes
start_timeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description mentions that the tool returns 'raw state-change history' and warns about token usage, but it does not explicitly disclose behavioral traits such as mutation risk, authentication needs, rate limits, or data freshness. The description adds some value beyond annotations (which are absent) but is not comprehensive.

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?

The description is front-loaded with the purpose, followed by comparisons, parameter explanations, return shape, examples, and best practices. It is structured and each section adds value. However, it is slightly verbose with repeated ISO-8601 details; could be more concise without losing clarity.

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 that the tool has an output schema (true) and the description references the return shape ('Same shape as get_history: entity_id, states, count, first_changed, last_changed'), the description is sufficiently complete. It covers parameters, usage, alternatives, and examples. It is well-rounded for a history retrieval tool.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must explain parameters. It does so thoroughly: entity_id is 'the entity to fetch history for', start_time includes format 'ISO-8601 start' with examples and note about UTC, and end_time is 'ISO-8601 end. Defaults to now (UTC).' This adds significant meaning beyond the schema.

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 the tool's purpose: 'Get raw state-change history for an entity over a date/time range.' It specifies the verb (Get), the resource (raw state-change history), and the scope (over a date/time range). The description also distinguishes itself from the sibling tool `get_history` by noting that `get_history_range` takes an explicit window instead of 'N hours from now', which helps the agent differentiate between the two.

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 description provides explicit usage context: 'Useful for inspecting what happened on a specific day or correlating with an external event.' It also includes best practices: 'Bound the window — wider ranges return more data and more tokens. For aggregated long-term data, prefer get_statistics_range.' This gives clear guidance on when to use this tool and when to use an alternative.

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/voska/hass-mcp'

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