Skip to main content
Glama

Energy consumption and cost

octopus_get_consumption
Read-only

Retrieve smart meter electricity or gas readings totalled by half-hour, hour, day, week, or month in UK time, with estimated costs from the active tariff including unit rates and standing charges.

Instructions

Get smart meter readings for electricity (import or export) or gas, totalled by half-hour, hour, day, week or month in UK time, with an estimated cost from the tariff that was active at the time: the actual unit rate for every half-hour (so Agile, Go and other time-of-use tariffs are priced correctly) plus standing charges, including VAT. Readings come from the smart meter, usually a day behind; there is no data for meters that aren't smart or don't send half-hourly reads. Electricity is in kWh. SMETS2 gas meters report m³, which is converted to kWh for costing with the standard formula (m³ × 1.02264 × calorific value ÷ 3.6). For export meters the estimate is what Octopus pays you. Day/night (Economy 7) tariffs are priced assuming night hours of 00:30 to 07:30 GMT, which may not match your meter. Estimates exclude discounts and credits; your bill is the source of truth.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "octopus_get_consumption"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd: a date (inclusive, the whole day), a date and time, or now/today/yesterday (default the end of yesterday)
fromNoStart: a date (YYYY-MM-DD, UK time), a date and time, or today/yesterday (default 7 days ago)
fuelNoelectricity (default) or gas
limitNoReturn at most this many rows, the most recent (default 400); use a coarser group_by for long periods
serialNoA specific meter serial number (default: the meter point's meter that has readings)
group_byNoHow to total the half-hourly readings: half_hour, hour, day (default), week (Monday to Sunday), month or total
directionNoFor electricity: import (default, what you use) or export (what you send to the grid, e.g. from solar panels)
gas_unitsNoOverride the units a gas meter reports in: kwh or m3 (default: as Octopus says for the meter, otherwise m3, which SMETS2 meters use)
meter_pointNoA specific MPAN (electricity) or MPRN (gas), when the account has several (see octopus_get_account)
include_costNoEstimate the cost (or export earnings) from the tariff's actual unit rates and standing charges (default true)
account_numberNoAccount number like A-1234ABCD (default OCTOPUS_ACCOUNT, or the only account the API key can see)
calorific_valueNoGas calorific value in MJ/m³ for converting m³ to kWh (default 39.5; your bill shows the actual value)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Return at most this many rows, the most recent (default 400); use a coarser group_by for long periods",
      +  "type": "integer"
      +}
    • removedInput schema / properties / max_rows
      Removed value: -{
      -  "description": "Return at most this many rows, the most recent (default 400); use a coarser group_by for long periods",
      -  "type": "integer"
      -}
  2. First observedv0.4.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint/idempotentHint; the description adds substantial behavior an agent cannot infer: one-day data lag, absence of data for non-smart meters, kWh vs m³ gas reporting with the exact conversion formula, export meters representing payments to the user, and the Economy 7 00:30–07:30 GMT assumption. It also discloses that figures are estimates excluding discounts and credits, which is material for how an agent should present results.

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?

Purpose, granularity, and cost behavior are front-loaded, and each subsequent sentence carries distinct operational information rather than filler. It is dense and caveat-heavy toward the end, but nothing is redundant with the schema, so the length is largely earned.

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?

For a 12-parameter, no-output-schema read tool, the description covers data provenance and latency, units per fuel, how costing is derived, known inaccuracies, and what the rows represent after grouping. An agent can both decide to call it and correctly caveat the results without additional context.

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 the baseline is 3, but the description adds real meaning the schema does not: how direction interacts with cost for export (the estimate is what Octopus pays you), why gas_units and calorific_value matter (SMETS2 reports m³, converted with the standard formula), and why a coarser group_by is needed for long ranges. Those are conceptual semantics rather than restatements of the field descriptions.

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 first sentence gives a specific verb (get), resource (smart meter readings), the two fuels, the supported aggregation granularities, the timezone, and the cost dimension. It is clearly distinguishable from siblings such as octopus_get_live_usage or octopus_get_unit_rates, which do not return totalled historical consumption.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the availability envelope explicitly — readings come from the smart meter, usually a day behind, and non-smart or non-half-hourly meters return nothing — which tells an agent when this tool will yield data and when it won't. It also notes estimates exclude discounts/credits and that the bill is the source of truth. It stops short of naming sibling alternatives for real-time or tariff-only lookups.

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