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.

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": {
      "seasonally_adjusted": true
    },
    "name": "get_cpi"
  }
}

Input 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

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. Changed2 schema fields changed
    • changedOutput schema / properties / series_id / description
      Previous value: -"BLS series ID actually used — CUUR0000SA0 (not seasonally adjusted) or CUSR0000SA0 (seasonally adjusted)"New value: +"BLS series ID actually used, CUUR0000SA0 (not seasonally adjusted) or CUSR0000SA0 (seasonally adjusted)"
    • changedOutput schema / properties / total / description
      Previous value: -"Number of data points returned. Equal to `returned` — BLS returns every point in the requested year range."New value: +"Number of data points returned. Equal to `returned`, BLS returns every point in the requested year range."
  2. Changed1 schema field changed
    • changedOutput schema / properties / data / items / properties / value / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
  3. 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."
  4. 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"
      +]
  5. 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"
      +}
  6. 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"
      +}
  7. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "end_year": "2024",
      +    "start_year": "2020"
      +  }
      +]
  8. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so the description focuses on what the data means: which series each setting maps to, that the two differ by roughly a point, and that the response discloses which series was used. That is meaningful behavioral context beyond the annotations, though nothing is said about history limits or rate-limit behavior beyond what the schema's _apiKey text covers.

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 default and the question it answers are front-loaded, and every sentence carries substantive information about series identity or defaults. The final sentence about the ~1-point difference is useful but slightly verbose in a description that is overall dense.

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 zero-required-parameter, read-only data tool with a full output schema, the description covers the only real ambiguity (which CPI series) and states the default, so an agent can call it correctly without further inference.

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 coverage is 100%, so all four parameters are already documented in the input schema, including the series IDs and the BLS-key explanation. The description reinforces the seasonal-adjustment tradeoff and default but adds no new syntax or constraints, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource and scope: CPI-U year-over-year inflation plus monthly index history for All Urban Consumers, US city average, all items, and states that it answers two concrete questions (latest inflation rate, current index level). It does not explicitly distinguish itself from the sibling econdata_get_series, which likely overlaps, so it stops short of a 5.

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 gives clear selection guidance for the one meaningful choice: default to the not-seasonally-adjusted CUUR0000SA0 and set seasonally_adjusted: true only when the question says seasonally adjusted. It offers no guidance about when to prefer this tool over a general series-retrieval sibling, so no exclusions or alternatives are stated.

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.