Skip to main content
Glama

Ons Timeseries

ons_timeseries
Read-onlyIdempotent

UK Office for National Statistics (ONS) headline series by series ID (CDID): UK CPI and CPIH consumer price inflation, RPI, unemployment and employment rates, average weekly earnings, GDP and GDP growth, retail sales, public finances, population. Returns the full series (years, quarters, months) plus latest, the most recent observation with its period (e.g. "2026 OCT") and release date, so "what was UK CPI inflation in the latest release" is one call. Headline CDIDs: D7G7 = CPI annual rate, the 12-month inflation rate, all items; L55O = CPIH annual rate; CZBH = RPI annual rate; CHAW = RPI index; MGSX = unemployment rate, aged 16+, seasonally adjusted; LF24 = employment rate, aged 16-64; KAB9 = average weekly earnings, total pay, GBP; ABMI = GDP chained volume, GBP million, quarterly; IHYQ = GDP quarter-on-quarter growth, %. Pass EITHER code (a CDID; it is looked up across ONS datasets, and dataset_id such as "MM23" or "DRSI" only disambiguates a CDID published in several; a bare dataset code such as "PN2" returns that dataset's series list to pick a CDID from) OR uri (the www.ons.gov.uk path, e.g. "/economy/grossdomesticproductgdp/timeseries/abmi/pn2"). (Named ons_timeseries, get_series is used by many other economic-data packs.)

Example tool call

This call uses example arguments supplied in the tool’s input schema.

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

Input Schema

NameRequiredDescriptionDefault
uriNoONS timeseries URI, e.g. "/economy/grossdomesticproductgdp/timeseries/abmi/pn2". Used instead of `code`.
codeNoONS series ID (CDID), e.g. "EAWP", "ABMI", "MGSX". A dataset code (e.g. "PN2") lists that dataset's series instead.
dataset_idNoOptional dataset code to disambiguate a CDID published in several datasets, e.g. "PN2" or "UKEA".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "uri": "/economy/grossdomesticproductgdp/timeseries/abmi/pn2"
      -  },
      -  {
      -    "uri": "/employmentandlabourmarket/peoplenotinwork/unemployment/timeseries/mgsx/lms"
      -  }
      -]New value: +[
      +  {
      +    "code": "EAWP"
      +  },
      +  {
      +    "code": "MGSX"
      +  },
      +  {
      +    "uri": "/economy/grossdomesticproductgdp/timeseries/abmi/pn2"
      +  },
      +  {
      +    "uri": "/employmentandlabourmarket/peoplenotinwork/unemployment/timeseries/mgsx/lms"
      +  }
      +]
    • addedInput schema / properties / code
      Added value: +{
      +  "description": "ONS series ID (CDID), e.g. \"EAWP\", \"ABMI\", \"MGSX\". A dataset code (e.g. \"PN2\") lists that dataset's series instead.",
      +  "type": "string"
      +}
    • addedInput schema / properties / dataset_id
      Added value: +{
      +  "description": "Optional dataset code to disambiguate a CDID published in several datasets, e.g. \"PN2\" or \"UKEA\".",
      +  "type": "string"
      +}
    • changedInput schema / properties / uri / description
      Previous value: -"ONS timeseries URI, e.g. \"/economy/grossdomesticproductgdp/timeseries/abmi/pn2\"."New value: +"ONS timeseries URI, e.g. \"/economy/grossdomesticproductgdp/timeseries/abmi/pn2\". Used instead of `code`."
    • changedInput schema / required
      Previous value: -[
      -  "uri"
      -]New value: +[]
  2. Changed1 schema field changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "uri": "/economy/grossdomesticproductgdp/timeseries/abmi/pn2"
      -  }
      -]New value: +[
      +  {
      +    "uri": "/economy/grossdomesticproductgdp/timeseries/abmi/pn2"
      +  },
      +  {
      +    "uri": "/employmentandlabourmarket/peoplenotinwork/unemployment/timeseries/mgsx/lms"
      +  }
      +]
  3. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "uri": "/economy/grossdomesticproductgdp/timeseries/abmi/pn2"
      +  }
      +]
  4. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds genuine behavior beyond that: the return includes the full historical series plus a `latest` block with period label and release date, CDIDs are looked up across ONS datasets, and `dataset_id` only narrows ambiguous CDIDs. It does not cover error behavior for unknown CDIDs or response size limits.

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?

The purpose and return shape are front-loaded, and the CDID catalog earns its space by letting an agent map a concept to a code without a second lookup. It is a single dense run-on paragraph that is hard to scan, and the trailing parenthetical about `get_series` naming in other packs is marginal.

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?

No output schema exists, and the description compensates by explaining exactly what is returned — the full series across years/quarters/months plus `latest` with period and release date. For a zero-required-parameter lookup tool with three well-explained inputs, nothing an agent needs in order to call it correctly 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 is 3, but the description adds real meaning: a catalog mapping CDIDs to concepts (D7G7 = CPI annual rate, MGSX = unemployment rate 16+, ABMI = GDP CVM, etc.) and the either/or constraint between `code` and `uri` that the schema's empty `required` list does not express. The `dataset_id` disambiguation semantics are also clarified beyond the schema's one-line note.

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 and resource — retrieve ONS headline series by CDID — and enumerates the covered domains (CPI/CPIH, RPI, unemployment, GDP, retail sales, public finances, population). It also distinguishes itself from the sibling dataset/observation tools by describing the 'full series plus latest' shape, so an agent can tell what it gets without opening the schema.

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?

Gives concrete usage context ('what was UK CPI inflation in the latest release' is one call) and explicit selection rules between `code` and `uri`, plus the fallback that a bare dataset code returns a series list to pick a CDID from. It stops short of naming when to prefer the sibling `uk_ons_get_observations` or `uk_ons_get_dataset` instead, so the alternative-routing is only partial.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.