query_indicators
Retrieve current economic indicator values including CPI, GDP, unemployment, and interest rates from authoritative sources like FRED, BLS, and BEA. Filter data by series ID, category, or frequency to access specific economic metrics.
Instructions
Get current values for economic indicators like CPI, GDP, unemployment, interest rates, and more. Filter by series ID, category, or frequency. Cost: $0.01 per query. Source: FRED, BLS, BEA.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| series | No | FRED series ID (e.g. CPIAUCSL, GDP, UNRATE) | |
| category | No | Category filter (e.g. inflation, employment, gdp) | |
| frequency | No | Data frequency filter | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/econ.ts:62-90 (handler)The handler function for the `query_indicators` tool, which fetches data from the `/api/v1/econ/indicators` endpoint and formats the response.
async ({ series, category, frequency, limit }) => { const res = await apiGet<EconQueryResponse>("/api/v1/econ/indicators", { series, category, frequency, limit: limit ?? 25, }); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} indicator(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, - src/tools/econ.ts:40-60 (schema)The input schema for the `query_indicators` tool.
inputSchema: { series: z .string() .optional() .describe("FRED series ID (e.g. CPIAUCSL, GDP, UNRATE)"), category: z .string() .optional() .describe("Category filter (e.g. inflation, employment, gdp)"), frequency: z .enum(["daily", "weekly", "monthly", "quarterly", "annual"]) .optional() .describe("Data frequency filter"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, - src/tools/econ.ts:32-91 (registration)Registration of the `query_indicators` tool within `registerEconTools`.
server.registerTool( "query_indicators", { title: "Query Economic Indicators", description: "Get current values for economic indicators like CPI, GDP, unemployment, " + "interest rates, and more. Filter by series ID, category, or frequency. " + "Cost: $0.01 per query. Source: FRED, BLS, BEA.", inputSchema: { series: z .string() .optional() .describe("FRED series ID (e.g. CPIAUCSL, GDP, UNRATE)"), category: z .string() .optional() .describe("Category filter (e.g. inflation, employment, gdp)"), frequency: z .enum(["daily", "weekly", "monthly", "quarterly", "annual"]) .optional() .describe("Data frequency filter"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, }, async ({ series, category, frequency, limit }) => { const res = await apiGet<EconQueryResponse>("/api/v1/econ/indicators", { series, category, frequency, limit: limit ?? 25, }); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} indicator(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, );