Skip to main content
Glama

ONS Consumer Prices Index (CPIH)

ons.stats.cpih
Read-onlyIdempotent

Retrieve UK Consumer Prices Index Including Housing costs (CPIH) from the ONS. Monthly index values (2015=100) for the overall index or individual categories (food, energy, transport, etc.). Data goes back to 1988. Default returns the headline CPIH overall index (CP00) for the UK. Use the category parameter to drill into sub-categories such as "CP01" (food & beverages), "CP04" (housing & energy), "CP07" (transport). Returns up to 60 most recent months by default. Source: ONS dataset cpih01, OGL v3.0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of most recent time periods to return (1–300, default 60). Data is monthly.
categoryNoONS aggregate code for the CPIH category. Default "CP00" (Overall Index). Other examples: "CP01" (Food & beverages), "CP02" (Alcohol & tobacco), "CP04" (Housing & energy), "CP07" (Transport). See /v1/datasets/cpih01/editions/time-series/versions/latest/dimensions/aggregate/options for full list.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint false, and openWorldHint, which the description does not contradict. The description adds valuable behavioral context such as the base year (2015=100), data going back to 1988, default limit of 60 months, and example category codes, enriching the agent's understanding of the data it will receive beyond the annotations.

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 description is concise and well-structured, leading with the core purpose and then covering essential details like base year, data range, defaults, and source in a few sentences. It is slightly dense but avoids redundancy, making it efficient for an agent to parse.

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?

With an output schema present, the description does not need to cover return values. It provides sufficient context for correct invocation: what data is returned, base year, data range, default behavior for limit and category, and source attribution. It lacks explicit mention of date-range filtering (only limit), but given the limit parameter and output schema, this is a minor gap.

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?

The input schema provides complete descriptions for both parameters (limit and category), including defaults, ranges, and examples. The tool description repeats some of this information (default limit, category examples) but does not add new semantic details beyond what the schema already offers, so the baseline score of 3 is appropriate.

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 clearly states it retrieves UK CPIH data from ONS, specifies monthly index values, and distinguishes itself by emphasizing the UK and housing costs inclusion. It also mentions the default overall index and category drilling, making its purpose unambiguous and distinct from sibling CPI tools like abs.economy.cpi or bls.macro.cpi.

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

Usage Guidelines2/5

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

The description does not explicitly compare this tool to alternatives or state when to use it over similar CPI tools (e.g., specifying 'use this for UK CPIH, not for US CPI'). It provides instructions on using the category parameter but lacks guidance on selecting this tool versus other CPI or ONS tools, leaving the when-to-use decision to inference.

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.