Skip to main content
Glama
LoganInTX

hass-mcp-extensions

by LoganInTX

get_history

Retrieve an entity's state change history with timestamps and count for a given time period.

Instructions

Get the history of an entity's state changes

Args: entity_id: The entity ID to get history for hours: Number of hours of history to retrieve (default: 24)

Returns: A dictionary containing: - entity_id: The entity ID requested - states: List of state objects with timestamps - count: Number of state changes found - first_changed: Timestamp of earliest state change - last_changed: Timestamp of most recent state change

Examples: entity_id="light.living_room" - get 24h history entity_id="sensor.temperature", hours=168 - get 7 day history Best Practices: - Keep hours reasonable (24-72) for token efficiency - Use for entities with discrete state changes rather than continuously changing sensors - Consider the state distribution rather than every individual state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYes
hoursNo

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. It describes the return format and provides best practices, but it does not explicitly state that the tool is read-only, nor does it discuss potential high response sizes or rate limits. The behavioral disclosure is adequate but 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 well-structured with sections (Args, Returns, Examples, Best Practices). It is front-loaded with the purpose. Slightly verbose in the best practices, but each part adds value.

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 has an output schema, the description explains the return structure completely. Parameters are well-documented. Best practices and examples cover usage scenarios. There are no gaps for a 2-parameter read 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 description includes an 'Args' section explaining both parameters: entity_id (the entity ID) and hours (number of hours, default 24). Examples show correct usage. Since the schema has 0% coverage, the description fully compensates by providing clear parameter semantics.

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?

The description clearly states 'Get the history of an entity's state changes', specifying the verb and resource. It distinguishes from siblings like get_logbook by focusing on state changes, though it does not explicitly differentiate from get_logbook which also records state changes.

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?

The 'Best Practices' section provides guidance on reasonable hour ranges and when to use this tool (discrete state changes) vs. not (continuously changing sensors). However, it does not name alternative tools explicitly, leaving room for ambiguity.

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/LoganInTX/home-assistant-mcp'

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