Skip to main content
Glama

Unit rates

octopus_get_unit_rates
Read-only

Fetch pence-per-kWh unit rates for a tariff over a date range, including Agile half-hourly and Go cheap/peak prices, plus current price, next change, and min/max/average.

Instructions

Get a tariff's unit rates (pence per kWh, including VAT) over a period: every half-hour for Agile, the cheap and peak periods for Go, Intelligent Go, Cosy and Flux, daily prices for Tracker, and the flat rate for fixed and flexible tariffs. Also gives the price now, when it next changes, and the minimum, maximum and average. Choose the tariff by tariff_code, by product_code with region or postcode, or leave them out for the account's current tariff. Day/night tariffs list day and night rates separately.

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_unit_rates"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd: a date (inclusive, the whole day), a date and time, or today/tomorrow (default the end of tomorrow; Agile prices for tomorrow are usually published around 4pm)
fromNoStart: a date (YYYY-MM-DD, UK time), a date and time, or now/today/tomorrow (default the start of today)
fuelNoelectricity (default) or gas
limitNoReturn at most this many rates (default 200)
regionNoWith product_code: the region letter A to P (see octopus_find_region)
postcodeNoWith product_code, instead of region: a UK postcode, used to look up the region
directionNoWith the account's tariff: import (default) or export
tariff_codeNoA tariff code like E-1R-AGILE-24-10-01-C (from octopus_get_product or octopus_get_account)
product_codeNoInstead of tariff_code: a product code like AGILE-24-10-01 (see octopus_list_products), with region or postcode
account_numberNoWith none of the above, the account's current tariff is used: account number like A-1234ABCD (default OCTOPUS_ACCOUNT or the only account)

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 rates (default 200)",
      +  "type": "integer"
      +}
    • removedInput schema / properties / max_rows
      Removed value: -{
      -  "description": "Return at most this many rates (default 200)",
      -  "type": "integer"
      -}
  2. First observedv0.4.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 and openWorldHint=false, so safety is covered; the description adds that prices are in pence per kWh including VAT and that the result includes current price, next change time, and min/max/average. That is meaningful disclosure beyond the annotations, with no contradiction; only pagination/truncation behaviour via limit is left unmentioned.

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?

Two sentences, front-loaded with what is returned and at what granularity, then the tariff-selection rule. No filler, and each clause carries distinct information.

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?

With 10 optional parameters and no output schema, the description must carry the burden of return shape, and it does: unit granularity per tariff family, the summary statistics, VAT inclusion, and the tariff-selection modes. The schema covers defaults, date formats, and the Agile 4pm publication caveat, so nothing essential is missing.

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 would be 3, but the description genuinely adds semantics: the three mutually exclusive ways to identify a tariff and the fact that region/postcode accompany product_code rather than tariff_code. It also explains why day/night tariffs look different in the output, which the schema does not.

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?

Specific verb+resource (get a tariff's unit rates) plus the granularity per tariff family: half-hourly for Agile, cheap/peak for Go/Intelligent Go/Cosy/Flux, daily for Tracker, flat for fixed/flexible. It also names the summary values returned and distinguishes day/night tariffs, so an agent knows exactly what this produces versus a product or standing-charge lookup.

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?

The tariff selection guidance is explicit: use tariff_code, or product_code with region/postcode, or omit both for the account's current tariff. It does not explicitly exclude near-neighbours such as standing charges or tariff comparison, but the selection conditions are clear enough that an agent can route correctly.

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