Skip to main content
Glama

Get Cpi

get_cpi
Read-onlyIdempotent

Current US inflation rate (CPI year-over-year) and Consumer Price Index history for All Urban Consumers, US city average, all items. Returns monthly index values with computed yoy_inflation_pct per month plus a latest summary carrying BOTH adjustments — answers "what is the latest inflation rate" and "what is the current CPI-U index level" directly. Defaults to the not-seasonally-adjusted index CUUR0000SA0, the series BLS headlines; pass seasonally_adjusted: true for the seasonally adjusted index CUSR0000SA0 (the FRED CPIAUCSL series). The two differ by roughly a point, so the answer states which one it used.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
_apiKeyNoOptional BLS registration key (free, raises the daily cap from ~25 to 500). The gateway supplies a platform key; pass your own only to override.
end_yearNoEnd year as 4-digit string (e.g. "2024"). Optional.
start_yearNoStart year as 4-digit string (e.g. "2020"). Optional.
seasonally_adjustedNotrue returns the seasonally adjusted CPI-U index (BLS series CUSR0000SA0, same series as FRED CPIAUCSL); false or omitted returns the not-seasonally-adjusted index (CUUR0000SA0), which is the series BLS headlines and the basis of the published year-over-year inflation rate. Set it to true when the question says seasonally adjusted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesMonthly CPI data
unitYesUnit of measurement (index 1982-84=100)
totalYesNumber of data points returned. Equal to `returned` — BLS returns every point in the requested year range.
latestNoMost recent observation, carrying BOTH seasonal adjustments so the caller can tell which number answers their question. Absent when the range returned no usable data points.
end_yearYesEnd year filter if provided, null otherwise
returnedNoHow many data points are in `data`. Always equal to `total` here; stated so a caller need not assume it.
series_idYesBLS series ID actually used — CUUR0000SA0 (not seasonally adjusted) or CUSR0000SA0 (seasonally adjusted)
start_yearYesStart year filter if provided, null otherwise
descriptionYesSeries description, naming the seasonal adjustment used
observation_orderNoOrder of the `data` array. BLS returns each series newest-first.
seasonally_adjustedYesWhether the returned series is seasonally adjusted (CUSR0000SA0) or not (CUUR0000SA0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / data / items / properties / value / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
  2. Changed3 schema fields changed
    • addedOutput schema / properties / observation_order
      Added value: +{
      +  "description": "Order of the `data` array. BLS returns each series newest-first.",
      +  "enum": [
      +    "newest_first"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / returned
      Added value: +{
      +  "description": "How many data points are in `data`. Always equal to `total` here; stated so a caller need not assume it.",
      +  "type": "integer"
      +}
    • changedOutput schema / properties / total / description
      Previous value: -"Total number of data points returned"New value: +"Number of data points returned. Equal to `returned` — BLS returns every point in the requested year range."
  3. Changed9 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "end_year": "2024",
      -    "start_year": "2020"
      -  }
      -]New value: +[
      +  {
      +    "seasonally_adjusted": true
      +  },
      +  {
      +    "end_year": "2024",
      +    "start_year": "2020"
      +  }
      +]
    • addedInput schema / properties / seasonally_adjusted
      Added value: +{
      +  "description": "true returns the seasonally adjusted CPI-U index (BLS series CUSR0000SA0, same series as FRED CPIAUCSL); false or omitted returns the not-seasonally-adjusted index (CUUR0000SA0), which is the series BLS headlines and the basis of the published year-over-year inflation rate. Set it to true when the question says seasonally adjusted.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / data / items / properties / date
      Added value: +{
      +  "description": "First day of the covered period as an ISO date, derived from the BLS period code",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / data / items / properties / yoy_inflation_pct
      Added value: +{
      +  "description": "Year-over-year percent change vs the same month a year earlier, or null when the prior-year month is not in range",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / description / description
      Previous value: -"Series description"New value: +"Series description, naming the seasonal adjustment used"
    • addedOutput schema / properties / latest
      Added value: +{
      +  "description": "Most recent observation, carrying BOTH seasonal adjustments so the caller can tell which number answers their question. Absent when the range returned no usable data points.",
      +  "properties": {
      +    "date": {
      +      "description": "ISO date of the latest observation",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "index_value": {
      +      "description": "Index level of the series that was requested",
      +      "type": "number"
      +    },
      +    "index_value_nsa": {
      +      "description": "Not-seasonally-adjusted index level (CUUR0000SA0) for the same month",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "index_value_sa": {
      +      "description": "Seasonally adjusted index level (CUSR0000SA0) for the same month",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "seasonally_adjusted": {
      +      "description": "Which adjustment index_value is",
      +      "type": "boolean"
      +    },
      +    "yoy_inflation_pct": {
      +      "description": "Year-over-year percent change for the latest month, or null when the prior-year month is out of range",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "date",
      +    "index_value",
      +    "seasonally_adjusted",
      +    "index_value_sa",
      +    "index_value_nsa",
      +    "yoy_inflation_pct"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / seasonally_adjusted
      Added value: +{
      +  "description": "Whether the returned series is seasonally adjusted (CUSR0000SA0) or not (CUUR0000SA0)",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / series_id / description
      Previous value: -"BLS series ID (CUUR0000SA0)"New value: +"BLS series ID actually used — CUUR0000SA0 (not seasonally adjusted) or CUSR0000SA0 (seasonally adjusted)"
    • changedOutput schema / required
      Previous value: -[
      -  "series_id",
      -  "description",
      -  "unit",
      -  "start_year",
      -  "end_year",
      -  "total",
      -  "data"
      -]New value: +[
      +  "series_id",
      +  "seasonally_adjusted",
      +  "description",
      +  "unit",
      +  "start_year",
      +  "end_year",
      +  "total",
      +  "data"
      +]
  4. Changed1 schema field changed
    • addedInput schema / properties / _apiKey
      Added value: +{
      +  "description": "Optional BLS registration key (free, raises the daily cap from ~25 to 500). The gateway supplies a platform key; pass your own only to override.",
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "data": {
      +      "description": "Monthly CPI data",
      +      "items": {
      +        "properties": {
      +          "month": {
      +            "description": "Month name (e.g., January)",
      +            "type": "string"
      +          },
      +          "period": {
      +            "description": "Period code (e.g., M01)",
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "CPI index value",
      +            "type": "number"
      +          },
      +          "year": {
      +            "description": "Year of the observation",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "year",
      +          "month",
      +          "period",
      +          "value"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "description": {
      +      "description": "Series description",
      +      "type": "string"
      +    },
      +    "end_year": {
      +      "description": "End year filter if provided, null otherwise",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "series_id": {
      +      "description": "BLS series ID (CUUR0000SA0)",
      +      "type": "string"
      +    },
      +    "start_year": {
      +      "description": "Start year filter if provided, null otherwise",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "total": {
      +      "description": "Total number of data points returned",
      +      "type": "integer"
      +    },
      +    "unit": {
      +      "description": "Unit of measurement (index 1982-84=100)",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "series_id",
      +    "description",
      +    "unit",
      +    "start_year",
      +    "end_year",
      +    "total",
      +    "data"
      +  ],
      +  "type": "object"
      +}
  6. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "end_year": "2024",
      +    "start_year": "2020"
      +  }
      +]
  7. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, the description discloses key behavior: it defaults to the not-seasonally-adjusted series, shows how to switch to the seasonally adjusted FRED series, notes that the two differ by about a point, and states that the answer will say which series was used. This materially helps the agent interpret 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?

The description is longer than minimal but every sentence adds useful context: purpose, return contents, default series, adjustment toggle, and consequence of the seasonal adjustment choice. It is front-loaded with the core purpose, though slightly wordy around 'BOTH adjustments'.

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?

Given the rich input schema, output schema, and annotations, the description is complete enough for correct invocation. It covers the intended questions, the default vs. adjusted series behavior, and the fact that the response will identify the series used; no critical operational detail 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 schema already explains seasonally_adjusted, start_year, end_year, and _apiKey. The tool description reinforces the default behavior but adds little parameter meaning beyond what the schema provides, so the baseline 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 names the exact resource (US CPI-U, All Urban Consumers, all items), states what it returns (monthly index values, computed yoy_inflation_pct, latest summary), and distinguishes itself from nearby series tools by naming specific BLS/FRED series IDs. An agent can tell this is the CPI-specific retrieval tool 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?

The description gives clear context for when to use the tool: it directly answers latest inflation rate and current CPI-U index level questions. It also instructs when to pass seasonally_adjusted: true. It does not explicitly contrast this tool with siblings like get_series, so exclusions/alternatives are left implicit.

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.