Skip to main content
Glama
aderik

ha-automation-mcp

by aderik

upsert_history_stats_sensor

Create or update a Home Assistant history_stats sensor entry to track entity state durations or counts. Requires a Home Assistant restart to apply the change.

Instructions

Create or update a history_stats sensor entry.

A HA restart is required for it to take effect (response includes restart_required=true). Example config: {"entity_id": "binary_sensor.moestuin_regent", "state": "on", "type": "time", "end": "{{ now() }}", "duration": {"hours": 2}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
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 behavioral burden. It usefully discloses that a Home Assistant restart is required and that the response includes restart_required=true, but it omits other important traits for a mutation tool, such as permissions, overwrite behavior, and validation rules.

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 front-loaded with the core action, then immediately notes the restart requirement and provides a concrete example. Every part is useful and there is no filler.

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

Completeness3/5

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

Given no output schema, no annotations, 0% parameter description coverage, and a nested config object, the description should do more. It covers restart behavior and gives one example config, but it leaves key parameter semantics and mutation details underspecified.

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 0% and both parameters are required. The example config object adds meaningful structure for the 'config' parameter, but the 'name' parameter is not explained, and the full config schema remains undocumented beyond the example.

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 specific verb-resource pair: 'Create or update a history_stats sensor entry.' This distinguishes it from sibling tools such as list_history_stats_sensors, get_history_stats_sensor, and delete_history_stats_sensor, and from other upsert_* tools by naming the exact resource.

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 description implies the use case through 'Create or update', but it does not explicitly say when to prefer this tool over alternatives, nor does it state any when-not conditions. No sibling tools are named as alternatives, so the agent must infer routing from the resource name alone.

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