Skip to main content
Glama
ffleurey

ha-analytics-mcp

by ffleurey

ha_history_get_consumption

Calculates energy, water, or gas consumption from cumulative meters over a period, with totals, breakdowns, or comparisons.

Instructions

Calculates how much energy, water, gas, or other resource was consumed or produced in Home over a time period. Use for totals, interval breakdowns, and period-over-period comparisons of cumulative meters. Always returns consumption (the change over the period), never raw meter readings. Do NOT use for instantaneous sensors (temperature, power in Watts) → use ha_history_get_sensor_stats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_timeNoPeriod end, same formats as start_time. Default: now.
intervalNo"none": total consumption for the whole period (default). "day": daily breakdown. "week": weekly. "month": monthly. Required when using filter_operator/filter_value.none
entity_idYesExact entity_id of a cumulative meter, resolved earlier, e.g. "sensor.home_energy_total". Do not guess.
comparisonNoOnly applicable with interval="none". Compares the total to a reference period. "previous_period": equal-length period immediately before. "same_period_last_year": same calendar dates 1 year ago. Returns both totals and the absolute/percentage difference.
start_timeNoPeriod start. Formats: relative (7d/30d/24h/2w/1y), named ("last month"/"last week"/"yesterday"/"last summer"/"Q1"), or ISO ("2026-04-01"). Default: 30d.
max_resultsNoApplies to interval breakdown only (not scalar). Default: 100. Pass "all" for complete series. Response shows total count when capped.
filter_valueNoThreshold for filter_operator. Required when filter_operator is set.
filter_operatorNoFilter results to buckets where consumption satisfies [op] filter_value. Requires interval. E.g. "which days used more than 10 kWh?" → interval="day", filter_operator=">", filter_value=10
Behavior4/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 discloses a key behavioral trait: 'Always returns consumption (the change over the period), never raw meter readings.' While it does not mention permissions or side effects, the read-only nature is implied and the core behavior is clearly stated.

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 four sentences, each earning its place: purpose, use cases, behavioral guarantee, and exclusion with alternative. It is front-loaded with the main action and stays compact.

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 the tool's complexity (8 parameters, no output schema) and rich input schema, the description provides essential high-level context: what the tool computes, when to use it, and when not to. It does not explain return structure, but the schema already details parameter behavior, making this sufficient.

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 100%, so baseline is 3. The description adds meaning beyond the schema by specifying that entity_id should be a 'cumulative meter' and that the tool returns consumption rather than raw readings, which helps interpret parameters like start_time and comparison.

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 begins with a specific verb ('Calculates') and a clear resource ('energy, water, gas, or other resource... consumed or produced in Home over a time period'). It also distinguishes from a sibling by explicitly stating not to use it for instantaneous sensors and pointing to ha_history_get_sensor_stats.

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 when-to-use guidance: 'Use for totals, interval breakdowns, and period-over-period comparisons of cumulative meters.' Also clearly states when not to use it and names the alternative tool: 'Do NOT use for instantaneous sensors... → use ha_history_get_sensor_stats.'

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/ffleurey/ha-analytics-mcp'

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