Skip to main content
Glama

Get statistics metadata

statistics_get_statistics_metadata
Read-onlyIdempotent

Retrieve unit, source, and name metadata for specified Home Assistant statistic IDs without fetching historical values. Use when you know the IDs and need only descriptive details.

Instructions

Get metadata (unit, source, name) for specific recorder statistic IDs.

Calls WS recorder/get_statistics_metadata and returns one entry per requested ID.

Use when: you already know the statistic IDs and only need their unit/source/name, without their historical values. Not for: the actual aggregated values — use statistics_get_statistics. Returns: list of {"statistic_id", "name", "source", "unit", "has_sum", "has_mean"} dicts. Errors: [{"error": "..."}] when the WS response isn't a list or the WS call raises.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statistic_idsYesStatistic IDs to fetch metadata for, e.g. ['sensor.energy_consumption']. Discover valid values with `statistics_list_statistic_ids`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / statistic_ids / description
      Added value: +"Statistic IDs to fetch metadata for, e.g. ['sensor.energy_consumption']. Discover valid values with `statistics_list_statistic_ids`."
  2. Addedv0.18.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so safety is covered. The description goes further by disclosing the underlying WS call, the one-entry-per-ID return shape, and the error format when the WS response isn't a list or the call raises. This is meaningful added context, though nothing about pagination or large-ID behavior.

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?

Front-loaded one-line purpose followed by cleanly labeled Use when / Not for / Returns / Errors sections. Every sentence carries information with no filler.

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?

Output schema exists, yet the description still summarizes the returned fields and error shape, and it fully covers routing and preconditions. Nothing an agent needs to select or invoke this tool correctly is missing.

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 description coverage is 100%, and the single parameter is documented in the schema with an example value and a pointer to statistics_list_statistic_ids. The description restates that IDs must be known but adds no syntax or format detail beyond the schema, so the baseline of 3 applies.

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?

States a specific verb (get) + resource (statistics metadata) and the exact fields returned (unit, source, name), and explicitly differentiates itself from the sibling statistics_get_statistics. An agent can distinguish it from statistics_get_statistics and statistics_list_statistic_ids without opening a schema.

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 an explicit 'Use when' clause (IDs already known, only need unit/source/name) and a 'Not for' exclusion that routes to the correct alternative (statistics_get_statistics for aggregated values). Conditions and alternatives are both named.

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

Deploy Server

Other Tools