get_cpi

Pack: econdata · Endpoint: https://gateway.pipeworx.io/econdata/mcp

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.

Parameters

NameTypeRequiredDescription
seasonally_adjustedbooleannotrue 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.
start_yearstringnoStart year as 4-digit string (e.g. “2020”). Optional.
end_yearstringnoEnd year as 4-digit string (e.g. “2024”). Optional.
_apiKeystringnoOptional BLS registration key (free, raises the daily cap from ~25 to 500). The gateway supplies a platform key; pass your own only to override.

Example call

Arguments

{
  "seasonally_adjusted": true
}

curl

curl -X POST https://gateway.pipeworx.io/econdata/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_cpi","arguments":{"seasonally_adjusted":true}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_cpi', {
  "seasonally_adjusted": true
});

More examples

{
  "start_year": "2020",
  "end_year": "2024"
}

Response shape

Always returns: series_id, seasonally_adjusted, description, unit, start_year, end_year, total, data

FieldTypeDescription
series_idstringBLS series ID actually used — CUUR0000SA0 (not seasonally adjusted) or CUSR0000SA0 (seasonally adjusted)
seasonally_adjustedbooleanWhether the returned series is seasonally adjusted (CUSR0000SA0) or not (CUUR0000SA0)
descriptionstringSeries description, naming the seasonal adjustment used
unitstringUnit of measurement (index 1982-84=100)
start_yearstring | nullStart year filter if provided, null otherwise
end_yearstring | nullEnd year filter if provided, null otherwise
totalintegerNumber of data points returned. Equal to returned — BLS returns every point in the requested year range.
returnedintegerHow many data points are in data. Always equal to total here; stated so a caller need not assume it.
observation_orderstringOrder of the data array. BLS returns each series newest-first.
dataarrayMonthly CPI data
latestobjectMost 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.
Full JSON Schema
{
  "type": "object",
  "properties": {
    "series_id": {
      "type": "string",
      "description": "BLS series ID actually used — CUUR0000SA0 (not seasonally adjusted) or CUSR0000SA0 (seasonally adjusted)"
    },
    "seasonally_adjusted": {
      "type": "boolean",
      "description": "Whether the returned series is seasonally adjusted (CUSR0000SA0) or not (CUUR0000SA0)"
    },
    "description": {
      "type": "string",
      "description": "Series description, naming the seasonal adjustment used"
    },
    "unit": {
      "type": "string",
      "description": "Unit of measurement (index 1982-84=100)"
    },
    "start_year": {
      "type": [
        "string",
        "null"
      ],
      "description": "Start year filter if provided, null otherwise"
    },
    "end_year": {
      "type": [
        "string",
        "null"
      ],
      "description": "End year filter if provided, null otherwise"
    },
    "total": {
      "type": "integer",
      "description": "Number of data points returned. Equal to `returned` — BLS returns every point in the requested year range."
    },
    "returned": {
      "type": "integer",
      "description": "How many data points are in `data`. Always equal to `total` here; stated so a caller need not assume it."
    },
    "observation_order": {
      "type": "string",
      "enum": [
        "newest_first"
      ],
      "description": "Order of the `data` array. BLS returns each series newest-first."
    },
    "data": {
      "type": "array",
      "description": "Monthly CPI data",
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "string",
            "description": "Year of the observation"
          },
          "month": {
            "type": "string",
            "description": "Month name (e.g., January)"
          },
          "period": {
            "type": "string",
            "description": "Period code (e.g., M01)"
          },
          "value": {
            "type": "number",
            "description": "CPI index value"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "description": "First day of the covered period as an ISO date, derived from the BLS period code"
          },
          "yoy_inflation_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Year-over-year percent change vs the same month a year earlier, or null when the prior-year month is not in range"
          }
        },
        "required": [
          "year",
          "month",
          "period",
          "value"
        ]
      }
    },
    "latest": {
      "type": "object",
      "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": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO date of the latest observation"
        },
        "index_value": {
          "type": "number",
          "description": "Index level of the series that was requested"
        },
        "seasonally_adjusted": {
          "type": "boolean",
          "description": "Which adjustment index_value is"
        },
        "index_value_sa": {
          "type": [
            "number",
            "null"
          ],
          "description": "Seasonally adjusted index level (CUSR0000SA0) for the same month"
        },
        "index_value_nsa": {
          "type": [
            "number",
            "null"
          ],
          "description": "Not-seasonally-adjusted index level (CUUR0000SA0) for the same month"
        },
        "yoy_inflation_pct": {
          "type": [
            "number",
            "null"
          ],
          "description": "Year-over-year percent change for the latest month, or null when the prior-year month is out of range"
        }
      },
      "required": [
        "date",
        "index_value",
        "seasonally_adjusted",
        "index_value_sa",
        "index_value_nsa",
        "yoy_inflation_pct"
      ]
    }
  },
  "required": [
    "series_id",
    "seasonally_adjusted",
    "description",
    "unit",
    "start_year",
    "end_year",
    "total",
    "data"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "econdata": {
      "url": "https://gateway.pipeworx.io/econdata/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build September 10, 2026