us-gov-open-data-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -0
- package/dist/client.d.ts +54 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +388 -0
- package/dist/client.js.map +1 -0
- package/dist/instructions.d.ts +8 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +549 -0
- package/dist/instructions.js.map +1 -0
- package/dist/modules/bea.d.ts +28 -0
- package/dist/modules/bea.d.ts.map +1 -0
- package/dist/modules/bea.js +158 -0
- package/dist/modules/bea.js.map +1 -0
- package/dist/modules/bls.d.ts +29 -0
- package/dist/modules/bls.d.ts.map +1 -0
- package/dist/modules/bls.js +244 -0
- package/dist/modules/bls.js.map +1 -0
- package/dist/modules/bts.d.ts +26 -0
- package/dist/modules/bts.d.ts.map +1 -0
- package/dist/modules/bts.js +112 -0
- package/dist/modules/bts.js.map +1 -0
- package/dist/modules/cdc.d.ts +26 -0
- package/dist/modules/cdc.d.ts.map +1 -0
- package/dist/modules/cdc.js +310 -0
- package/dist/modules/cdc.js.map +1 -0
- package/dist/modules/census.d.ts +23 -0
- package/dist/modules/census.d.ts.map +1 -0
- package/dist/modules/census.js +141 -0
- package/dist/modules/census.js.map +1 -0
- package/dist/modules/cfpb.d.ts +20 -0
- package/dist/modules/cfpb.d.ts.map +1 -0
- package/dist/modules/cfpb.js +135 -0
- package/dist/modules/cfpb.js.map +1 -0
- package/dist/modules/clinical-trials.d.ts +22 -0
- package/dist/modules/clinical-trials.d.ts.map +1 -0
- package/dist/modules/clinical-trials.js +171 -0
- package/dist/modules/clinical-trials.js.map +1 -0
- package/dist/modules/cms.d.ts +21 -0
- package/dist/modules/cms.d.ts.map +1 -0
- package/dist/modules/cms.js +135 -0
- package/dist/modules/cms.js.map +1 -0
- package/dist/modules/college-scorecard.d.ts +39 -0
- package/dist/modules/college-scorecard.d.ts.map +1 -0
- package/dist/modules/college-scorecard.js +192 -0
- package/dist/modules/college-scorecard.js.map +1 -0
- package/dist/modules/congress.d.ts +28 -0
- package/dist/modules/congress.d.ts.map +1 -0
- package/dist/modules/congress.js +883 -0
- package/dist/modules/congress.js.map +1 -0
- package/dist/modules/dol.d.ts +27 -0
- package/dist/modules/dol.d.ts.map +1 -0
- package/dist/modules/dol.js +209 -0
- package/dist/modules/dol.js.map +1 -0
- package/dist/modules/eia.d.ts +33 -0
- package/dist/modules/eia.d.ts.map +1 -0
- package/dist/modules/eia.js +227 -0
- package/dist/modules/eia.js.map +1 -0
- package/dist/modules/epa.d.ts +21 -0
- package/dist/modules/epa.d.ts.map +1 -0
- package/dist/modules/epa.js +91 -0
- package/dist/modules/epa.js.map +1 -0
- package/dist/modules/fbi.d.ts +28 -0
- package/dist/modules/fbi.d.ts.map +1 -0
- package/dist/modules/fbi.js +143 -0
- package/dist/modules/fbi.js.map +1 -0
- package/dist/modules/fda.d.ts +35 -0
- package/dist/modules/fda.d.ts.map +1 -0
- package/dist/modules/fda.js +262 -0
- package/dist/modules/fda.js.map +1 -0
- package/dist/modules/fdic.d.ts +21 -0
- package/dist/modules/fdic.d.ts.map +1 -0
- package/dist/modules/fdic.js +186 -0
- package/dist/modules/fdic.js.map +1 -0
- package/dist/modules/fec.d.ts +29 -0
- package/dist/modules/fec.d.ts.map +1 -0
- package/dist/modules/fec.js +282 -0
- package/dist/modules/fec.js.map +1 -0
- package/dist/modules/federal-register.d.ts +24 -0
- package/dist/modules/federal-register.d.ts.map +1 -0
- package/dist/modules/federal-register.js +184 -0
- package/dist/modules/federal-register.js.map +1 -0
- package/dist/modules/fema.d.ts +20 -0
- package/dist/modules/fema.d.ts.map +1 -0
- package/dist/modules/fema.js +156 -0
- package/dist/modules/fema.js.map +1 -0
- package/dist/modules/fred.d.ts +40 -0
- package/dist/modules/fred.d.ts.map +1 -0
- package/dist/modules/fred.js +143 -0
- package/dist/modules/fred.js.map +1 -0
- package/dist/modules/govinfo.d.ts +24 -0
- package/dist/modules/govinfo.d.ts.map +1 -0
- package/dist/modules/govinfo.js +147 -0
- package/dist/modules/govinfo.js.map +1 -0
- package/dist/modules/hud.d.ts +17 -0
- package/dist/modules/hud.d.ts.map +1 -0
- package/dist/modules/hud.js +170 -0
- package/dist/modules/hud.js.map +1 -0
- package/dist/modules/naep.d.ts +27 -0
- package/dist/modules/naep.d.ts.map +1 -0
- package/dist/modules/naep.js +210 -0
- package/dist/modules/naep.js.map +1 -0
- package/dist/modules/nhtsa.d.ts +13 -0
- package/dist/modules/nhtsa.d.ts.map +1 -0
- package/dist/modules/nhtsa.js +196 -0
- package/dist/modules/nhtsa.js.map +1 -0
- package/dist/modules/noaa.d.ts +41 -0
- package/dist/modules/noaa.d.ts.map +1 -0
- package/dist/modules/noaa.js +135 -0
- package/dist/modules/noaa.js.map +1 -0
- package/dist/modules/nrel.d.ts +25 -0
- package/dist/modules/nrel.d.ts.map +1 -0
- package/dist/modules/nrel.js +87 -0
- package/dist/modules/nrel.js.map +1 -0
- package/dist/modules/regulations.d.ts +24 -0
- package/dist/modules/regulations.d.ts.map +1 -0
- package/dist/modules/regulations.js +173 -0
- package/dist/modules/regulations.js.map +1 -0
- package/dist/modules/sec.d.ts +25 -0
- package/dist/modules/sec.d.ts.map +1 -0
- package/dist/modules/sec.js +192 -0
- package/dist/modules/sec.js.map +1 -0
- package/dist/modules/senate-lobbying.d.ts +21 -0
- package/dist/modules/senate-lobbying.d.ts.map +1 -0
- package/dist/modules/senate-lobbying.js +189 -0
- package/dist/modules/senate-lobbying.js.map +1 -0
- package/dist/modules/treasury.d.ts +23 -0
- package/dist/modules/treasury.d.ts.map +1 -0
- package/dist/modules/treasury.js +234 -0
- package/dist/modules/treasury.js.map +1 -0
- package/dist/modules/usaspending.d.ts +19 -0
- package/dist/modules/usaspending.d.ts.map +1 -0
- package/dist/modules/usaspending.js +204 -0
- package/dist/modules/usaspending.js.map +1 -0
- package/dist/modules/usda-fooddata.d.ts +24 -0
- package/dist/modules/usda-fooddata.d.ts.map +1 -0
- package/dist/modules/usda-fooddata.js +118 -0
- package/dist/modules/usda-fooddata.js.map +1 -0
- package/dist/modules/usda-nass.d.ts +46 -0
- package/dist/modules/usda-nass.d.ts.map +1 -0
- package/dist/modules/usda-nass.js +151 -0
- package/dist/modules/usda-nass.js.map +1 -0
- package/dist/modules/usgs.d.ts +21 -0
- package/dist/modules/usgs.d.ts.map +1 -0
- package/dist/modules/usgs.js +203 -0
- package/dist/modules/usgs.js.map +1 -0
- package/dist/modules/uspto.d.ts +13 -0
- package/dist/modules/uspto.d.ts.map +1 -0
- package/dist/modules/uspto.js +157 -0
- package/dist/modules/uspto.js.map +1 -0
- package/dist/modules/world-bank.d.ts +21 -0
- package/dist/modules/world-bank.d.ts.map +1 -0
- package/dist/modules/world-bank.js +130 -0
- package/dist/modules/world-bank.js.map +1 -0
- package/dist/prompts.d.ts +12 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +858 -0
- package/dist/prompts.js.map +1 -0
- package/dist/sdk/bea.d.ts +111 -0
- package/dist/sdk/bea.d.ts.map +1 -0
- package/dist/sdk/bea.js +242 -0
- package/dist/sdk/bea.js.map +1 -0
- package/dist/sdk/bls.d.ts +65 -0
- package/dist/sdk/bls.d.ts.map +1 -0
- package/dist/sdk/bls.js +203 -0
- package/dist/sdk/bls.js.map +1 -0
- package/dist/sdk/bts.d.ts +108 -0
- package/dist/sdk/bts.d.ts.map +1 -0
- package/dist/sdk/bts.js +121 -0
- package/dist/sdk/bts.js.map +1 -0
- package/dist/sdk/cdc.d.ts +105 -0
- package/dist/sdk/cdc.d.ts.map +1 -0
- package/dist/sdk/cdc.js +222 -0
- package/dist/sdk/cdc.js.map +1 -0
- package/dist/sdk/census.d.ts +47 -0
- package/dist/sdk/census.d.ts.map +1 -0
- package/dist/sdk/census.js +99 -0
- package/dist/sdk/census.js.map +1 -0
- package/dist/sdk/cfpb.d.ts +148 -0
- package/dist/sdk/cfpb.d.ts.map +1 -0
- package/dist/sdk/cfpb.js +153 -0
- package/dist/sdk/cfpb.js.map +1 -0
- package/dist/sdk/clinical-trials.d.ts +214 -0
- package/dist/sdk/clinical-trials.d.ts.map +1 -0
- package/dist/sdk/clinical-trials.js +134 -0
- package/dist/sdk/clinical-trials.js.map +1 -0
- package/dist/sdk/cms.d.ts +81 -0
- package/dist/sdk/cms.d.ts.map +1 -0
- package/dist/sdk/cms.js +227 -0
- package/dist/sdk/cms.js.map +1 -0
- package/dist/sdk/college-scorecard.d.ts +63 -0
- package/dist/sdk/college-scorecard.d.ts.map +1 -0
- package/dist/sdk/college-scorecard.js +131 -0
- package/dist/sdk/college-scorecard.js.map +1 -0
- package/dist/sdk/congress.d.ts +575 -0
- package/dist/sdk/congress.d.ts.map +1 -0
- package/dist/sdk/congress.js +659 -0
- package/dist/sdk/congress.js.map +1 -0
- package/dist/sdk/dol.d.ts +299 -0
- package/dist/sdk/dol.d.ts.map +1 -0
- package/dist/sdk/dol.js +252 -0
- package/dist/sdk/dol.js.map +1 -0
- package/dist/sdk/eia.d.ts +91 -0
- package/dist/sdk/eia.d.ts.map +1 -0
- package/dist/sdk/eia.js +156 -0
- package/dist/sdk/eia.js.map +1 -0
- package/dist/sdk/epa.d.ts +128 -0
- package/dist/sdk/epa.d.ts.map +1 -0
- package/dist/sdk/epa.js +120 -0
- package/dist/sdk/epa.js.map +1 -0
- package/dist/sdk/fbi.d.ts +48 -0
- package/dist/sdk/fbi.d.ts.map +1 -0
- package/dist/sdk/fbi.js +69 -0
- package/dist/sdk/fbi.js.map +1 -0
- package/dist/sdk/fda.d.ts +356 -0
- package/dist/sdk/fda.d.ts.map +1 -0
- package/dist/sdk/fda.js +162 -0
- package/dist/sdk/fda.js.map +1 -0
- package/dist/sdk/fdic.d.ts +227 -0
- package/dist/sdk/fdic.d.ts.map +1 -0
- package/dist/sdk/fdic.js +172 -0
- package/dist/sdk/fdic.js.map +1 -0
- package/dist/sdk/fec.d.ts +142 -0
- package/dist/sdk/fec.d.ts.map +1 -0
- package/dist/sdk/fec.js +92 -0
- package/dist/sdk/fec.js.map +1 -0
- package/dist/sdk/federal-register.d.ts +88 -0
- package/dist/sdk/federal-register.d.ts.map +1 -0
- package/dist/sdk/federal-register.js +100 -0
- package/dist/sdk/federal-register.js.map +1 -0
- package/dist/sdk/fema.d.ts +137 -0
- package/dist/sdk/fema.d.ts.map +1 -0
- package/dist/sdk/fema.js +197 -0
- package/dist/sdk/fema.js.map +1 -0
- package/dist/sdk/fred.d.ts +72 -0
- package/dist/sdk/fred.d.ts.map +1 -0
- package/dist/sdk/fred.js +59 -0
- package/dist/sdk/fred.js.map +1 -0
- package/dist/sdk/govinfo.d.ts +64 -0
- package/dist/sdk/govinfo.d.ts.map +1 -0
- package/dist/sdk/govinfo.js +187 -0
- package/dist/sdk/govinfo.js.map +1 -0
- package/dist/sdk/hud.d.ts +87 -0
- package/dist/sdk/hud.d.ts.map +1 -0
- package/dist/sdk/hud.js +91 -0
- package/dist/sdk/hud.js.map +1 -0
- package/dist/sdk/index.d.ts +51 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +51 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/naep.d.ts +93 -0
- package/dist/sdk/naep.d.ts.map +1 -0
- package/dist/sdk/naep.js +163 -0
- package/dist/sdk/naep.js.map +1 -0
- package/dist/sdk/nhtsa.d.ts +169 -0
- package/dist/sdk/nhtsa.d.ts.map +1 -0
- package/dist/sdk/nhtsa.js +102 -0
- package/dist/sdk/nhtsa.js.map +1 -0
- package/dist/sdk/noaa.d.ts +72 -0
- package/dist/sdk/noaa.d.ts.map +1 -0
- package/dist/sdk/noaa.js +64 -0
- package/dist/sdk/noaa.js.map +1 -0
- package/dist/sdk/nrel.d.ts +145 -0
- package/dist/sdk/nrel.d.ts.map +1 -0
- package/dist/sdk/nrel.js +93 -0
- package/dist/sdk/nrel.js.map +1 -0
- package/dist/sdk/regulations.d.ts +146 -0
- package/dist/sdk/regulations.d.ts.map +1 -0
- package/dist/sdk/regulations.js +103 -0
- package/dist/sdk/regulations.js.map +1 -0
- package/dist/sdk/sec.d.ts +114 -0
- package/dist/sdk/sec.d.ts.map +1 -0
- package/dist/sdk/sec.js +151 -0
- package/dist/sdk/sec.js.map +1 -0
- package/dist/sdk/senate-lobbying.d.ts +147 -0
- package/dist/sdk/senate-lobbying.d.ts.map +1 -0
- package/dist/sdk/senate-lobbying.js +125 -0
- package/dist/sdk/senate-lobbying.js.map +1 -0
- package/dist/sdk/treasury.d.ts +59 -0
- package/dist/sdk/treasury.d.ts.map +1 -0
- package/dist/sdk/treasury.js +1397 -0
- package/dist/sdk/treasury.js.map +1 -0
- package/dist/sdk/usaspending.d.ts +126 -0
- package/dist/sdk/usaspending.d.ts.map +1 -0
- package/dist/sdk/usaspending.js +270 -0
- package/dist/sdk/usaspending.js.map +1 -0
- package/dist/sdk/usda-fooddata.d.ts +112 -0
- package/dist/sdk/usda-fooddata.d.ts.map +1 -0
- package/dist/sdk/usda-fooddata.js +80 -0
- package/dist/sdk/usda-fooddata.js.map +1 -0
- package/dist/sdk/usda-nass.d.ts +75 -0
- package/dist/sdk/usda-nass.d.ts.map +1 -0
- package/dist/sdk/usda-nass.js +83 -0
- package/dist/sdk/usda-nass.js.map +1 -0
- package/dist/sdk/usgs.d.ts +221 -0
- package/dist/sdk/usgs.d.ts.map +1 -0
- package/dist/sdk/usgs.js +182 -0
- package/dist/sdk/usgs.js.map +1 -0
- package/dist/sdk/uspto.d.ts +109 -0
- package/dist/sdk/uspto.d.ts.map +1 -0
- package/dist/sdk/uspto.js +286 -0
- package/dist/sdk/uspto.js.map +1 -0
- package/dist/sdk/world-bank.d.ts +78 -0
- package/dist/sdk/world-bank.d.ts.map +1 -0
- package/dist/sdk/world-bank.js +72 -0
- package/dist/sdk/world-bank.js.map +1 -0
- package/dist/server.d.ts +22 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +196 -0
- package/dist/server.js.map +1 -0
- package/package.json +113 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BEA MCP module — tools + metadata. Delegates all API calls to sdk/bea.
|
|
3
|
+
*
|
|
4
|
+
* Tools return raw JSON data — no markdown formatting. The client decides how to present it.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { getNationalGdp, getGdpByState, getPersonalIncome, getGdpByIndustry, } from "../sdk/bea.js";
|
|
8
|
+
// ─── Metadata (server.ts reads these) ────────────────────────────────
|
|
9
|
+
export const name = "bea";
|
|
10
|
+
export const displayName = "Bureau of Economic Analysis";
|
|
11
|
+
export const description = "State-level GDP, GDP by industry, personal income by state, national accounts (NIPA)";
|
|
12
|
+
export const auth = { envVar: "BEA_API_KEY", signup: "https://apps.bea.gov/API/signup/" };
|
|
13
|
+
export const workflow = "Pick the geographic/industry dimension you need → query with state FIPS or industry code";
|
|
14
|
+
export const tips = "Key advantage over FRED: state-level GDP and income breakdowns, GDP by NAICS industry.";
|
|
15
|
+
export const reference = {
|
|
16
|
+
nipaTables: {
|
|
17
|
+
T10101: "Real GDP and components (percent change)",
|
|
18
|
+
T10106: "Nominal GDP and components",
|
|
19
|
+
T10111: "GDP percent change contributions",
|
|
20
|
+
T20100: "Personal income and disposition",
|
|
21
|
+
T30100: "Government receipts and expenditures",
|
|
22
|
+
},
|
|
23
|
+
gdpIndustryTables: {
|
|
24
|
+
1: "Value added by industry",
|
|
25
|
+
5: "Contributions to percent change in real GDP",
|
|
26
|
+
6: "Value added as percentage of GDP",
|
|
27
|
+
25: "Real value added by industry",
|
|
28
|
+
},
|
|
29
|
+
regionalTables: {
|
|
30
|
+
SAGDP1: "State annual GDP summary",
|
|
31
|
+
SAGDP9: "Real GDP by state",
|
|
32
|
+
SQGDP1: "State quarterly GDP summary",
|
|
33
|
+
SAINC1: "Personal income, population, per capita income",
|
|
34
|
+
SAINC3: "Per capita personal income",
|
|
35
|
+
SAINC4: "Personal income by major component",
|
|
36
|
+
},
|
|
37
|
+
docs: {
|
|
38
|
+
"User Guide": "https://apps.bea.gov/api/_pdf/bea_web_service_api_user_guide.pdf",
|
|
39
|
+
"Developer Page": "https://apps.bea.gov/developers/",
|
|
40
|
+
"Sign Up": "https://apps.bea.gov/API/signup/",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
44
|
+
export const tools = [
|
|
45
|
+
{
|
|
46
|
+
name: "bea_gdp_national",
|
|
47
|
+
description: "Get U.S. national GDP data from the NIPA tables. Shows GDP, GDP growth, " +
|
|
48
|
+
"components (consumption, investment, government, net exports), and deflators.\n\n" +
|
|
49
|
+
"Common table names:\n" +
|
|
50
|
+
"- T10101: GDP and major components (real)\n" +
|
|
51
|
+
"- T10106: GDP and major components (nominal)\n" +
|
|
52
|
+
"- T10111: GDP percent change\n" +
|
|
53
|
+
"- T20100: Personal income and its disposition\n" +
|
|
54
|
+
"- T30100: Government receipts and expenditures",
|
|
55
|
+
annotations: { title: "BEA: National GDP", readOnlyHint: true },
|
|
56
|
+
parameters: z.object({
|
|
57
|
+
table_name: z.string().optional().describe("NIPA table name (default: T10101 — Real GDP). Other: T10106 (nominal GDP), T10111 (% change), T20100 (personal income)"),
|
|
58
|
+
frequency: z.string().optional().describe("'Q' for quarterly (default), 'A' for annual, 'M' for monthly"),
|
|
59
|
+
year: z.string().optional().describe("Year(s) to fetch. Use 'X' for all, 'LAST5' for last 5, or specific year. Default: LAST5"),
|
|
60
|
+
}),
|
|
61
|
+
execute: async ({ table_name, frequency, year }) => {
|
|
62
|
+
const data = await getNationalGdp({ tableName: table_name, frequency, year });
|
|
63
|
+
if (!data.series.length)
|
|
64
|
+
return JSON.stringify({ summary: "No GDP data returned.", ...data });
|
|
65
|
+
return JSON.stringify({
|
|
66
|
+
summary: `BEA National GDP — Table ${data.table} (${data.frequency}): ${data.dataRows} rows, ${data.series.length} series`,
|
|
67
|
+
...data,
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "bea_gdp_by_state",
|
|
73
|
+
description: "Get gross domestic product for U.S. states from BEA Regional dataset.\n\n" +
|
|
74
|
+
"Table options:\n" +
|
|
75
|
+
"- SAGDP1: State annual GDP summary (default)\n" +
|
|
76
|
+
"- SAGDP9: Real GDP by state\n" +
|
|
77
|
+
"- SQGDP1: State quarterly GDP summary\n\n" +
|
|
78
|
+
"GeoFips: 'STATE' for all states, or 5-digit FIPS (e.g. '06000' for CA)",
|
|
79
|
+
annotations: { title: "BEA: GDP by State", readOnlyHint: true },
|
|
80
|
+
parameters: z.object({
|
|
81
|
+
table_name: z.string().optional().describe("Regional table: 'SAGDP1' (annual GDP summary, default), 'SAGDP9' (real GDP), 'SQGDP1' (quarterly GDP summary)"),
|
|
82
|
+
geo_fips: z.string().optional().describe("Geography: 'STATE' (all states, default), or state FIPS + '000' (e.g. '06000' for CA, '48000' for TX)"),
|
|
83
|
+
line_code: z.string().optional().describe("Line code: '1' (all industry, default), '2' (private), '3' (government)"),
|
|
84
|
+
year: z.string().optional().describe("Year(s): 'LAST5' (default), 'LAST10', 'ALL', or comma-separated years"),
|
|
85
|
+
}),
|
|
86
|
+
execute: async ({ table_name, geo_fips, line_code, year }) => {
|
|
87
|
+
const data = await getGdpByState({ tableName: table_name, geoFips: geo_fips, lineCode: line_code, year });
|
|
88
|
+
if (data.states && !data.states.length)
|
|
89
|
+
return JSON.stringify({ summary: "No state GDP data returned.", ...data });
|
|
90
|
+
if (data.states) {
|
|
91
|
+
return JSON.stringify({
|
|
92
|
+
summary: `GDP by state (${data.year}): ${data.states.length} states, values in ${data.unit}`,
|
|
93
|
+
...data,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return JSON.stringify({
|
|
97
|
+
summary: `BEA State GDP for ${data.geoFips}: ${data.series?.length ?? 0} series, values in ${data.unit}`,
|
|
98
|
+
...data,
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "bea_personal_income",
|
|
104
|
+
description: "Get personal income data by state from BEA Regional dataset.\n\n" +
|
|
105
|
+
"Table options:\n" +
|
|
106
|
+
"- SAINC1: Personal income summary (income, population, per capita) — default\n" +
|
|
107
|
+
"- SAINC3: Per capita personal income only\n" +
|
|
108
|
+
"- SAINC4: Personal income by major component (wages, dividends, transfers)\n\n" +
|
|
109
|
+
"LineCode for SAINC1: 1=personal income, 2=population, 3=per capita income (default)\n" +
|
|
110
|
+
"LineCode for SAINC4: 1=total, 50=wages, 45=dividends/interest/rent, 47=transfer receipts",
|
|
111
|
+
annotations: { title: "BEA: Personal Income by State", readOnlyHint: true },
|
|
112
|
+
parameters: z.object({
|
|
113
|
+
table_name: z.string().optional().describe("'SAINC1' (personal income summary, default), 'SAINC3' (per capita only), 'SAINC4' (by component)"),
|
|
114
|
+
geo_fips: z.string().optional().describe("'STATE' (all states, default), or state FIPS + '000'. 'COUNTY' for all counties, 'MSA' for all metro areas."),
|
|
115
|
+
line_code: z.string().optional().describe("SAINC1: '3' (per capita, default), '1' (personal income), '2' (population). SAINC4: '50' (wages), '45' (property income), '47' (transfers)"),
|
|
116
|
+
year: z.string().optional().describe("Year(s): 'LAST5' (default), 'ALL', or comma-separated years"),
|
|
117
|
+
}),
|
|
118
|
+
execute: async ({ table_name, geo_fips, line_code, year }) => {
|
|
119
|
+
const data = await getPersonalIncome({ tableName: table_name, geoFips: geo_fips, lineCode: line_code, year });
|
|
120
|
+
if (!data.states.length)
|
|
121
|
+
return JSON.stringify({ summary: "No personal income data returned.", ...data });
|
|
122
|
+
return JSON.stringify({
|
|
123
|
+
summary: `BEA Personal Income — ${data.table} (${data.year}): ${data.states.length} areas, values ${data.unit}`,
|
|
124
|
+
...data,
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "bea_gdp_by_industry",
|
|
130
|
+
description: "Get GDP contribution by industry sector nationally from BEA GDPbyIndustry dataset.\n\n" +
|
|
131
|
+
"TableID options:\n" +
|
|
132
|
+
"- 1: Value added by industry (default)\n" +
|
|
133
|
+
"- 5: Contributions to percent change in real GDP\n" +
|
|
134
|
+
"- 6: Value added percent shares\n" +
|
|
135
|
+
"- 25: Real value added by industry\n\n" +
|
|
136
|
+
"Industry='ALL' returns all sectors.",
|
|
137
|
+
annotations: { title: "BEA: GDP by Industry", readOnlyHint: true },
|
|
138
|
+
parameters: z.object({
|
|
139
|
+
table_id: z.string().optional().describe("Table ID: '1' (value added, default), '5' (contributions to GDP growth), '6' (% shares), '25' (real value added)"),
|
|
140
|
+
frequency: z.string().optional().describe("'Q' quarterly (default) or 'A' annual"),
|
|
141
|
+
year: z.string().optional().describe("Year(s): comma-separated or 'ALL'. Default: last 3 years"),
|
|
142
|
+
industry: z.string().optional().describe("'ALL' (default), or specific NAICS codes: '11' (agriculture), '21' (mining), '23' (construction), " +
|
|
143
|
+
"'31-33' (manufacturing), '42' (wholesale), '44-45' (retail), '51' (information), '52' (finance)"),
|
|
144
|
+
}),
|
|
145
|
+
execute: async ({ table_id, frequency, year, industry }) => {
|
|
146
|
+
const data = await getGdpByIndustry({ tableId: table_id, frequency, year, industry });
|
|
147
|
+
if (!data.industries.length)
|
|
148
|
+
return JSON.stringify({ summary: "No industry GDP data returned.", ...data });
|
|
149
|
+
return JSON.stringify({
|
|
150
|
+
summary: `BEA GDP by Industry — Table ${data.tableId}: ${data.industries.length} industries`,
|
|
151
|
+
...data,
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
// ─── Re-export cache control from SDK ────────────────────────────────
|
|
157
|
+
export { clearCache } from "../sdk/bea.js";
|
|
158
|
+
//# sourceMappingURL=bea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bea.js","sourceRoot":"","sources":["../../src/modules/bea.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,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C;gBACpB,OAAO,EAAE,+BAA+B,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,aAAa;gBAC5F,GAAG,IAAI;aACR,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC;AAEF,wEAAwE;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BLS MCP module — tools + metadata. Delegates all API calls to sdk/bls.
|
|
3
|
+
*
|
|
4
|
+
* Tools return raw JSON data — no markdown formatting. The client decides how to present it.
|
|
5
|
+
*/
|
|
6
|
+
import type { Tool, InputPrompt } from "fastmcp";
|
|
7
|
+
export declare const name = "bls";
|
|
8
|
+
export declare const displayName = "Bureau of Labor Statistics";
|
|
9
|
+
export declare const description = "Employment, wages, CPI components, PPI, JOLTS, labor productivity";
|
|
10
|
+
export declare const auth: {
|
|
11
|
+
envVar: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
signup: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const workflow = "bls_search_series to find series IDs \u2192 bls_series_data to fetch values";
|
|
16
|
+
export declare const tips = "Key advantage over FRED: granular breakdowns (CPI by food/shelter/gas/medical, employment by industry, wages by sector). API key optional but recommended (25 req/day without, 500 with).";
|
|
17
|
+
export declare const reference: {
|
|
18
|
+
seriesPrefixes: Record<string, string>;
|
|
19
|
+
popularSeries: Record<string, string>;
|
|
20
|
+
docs: {
|
|
21
|
+
"API v2": string;
|
|
22
|
+
"Series Formats": string;
|
|
23
|
+
Registration: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const tools: Tool<any, any>[];
|
|
27
|
+
export { clearCache } from "../sdk/bls.js";
|
|
28
|
+
export declare const prompts: InputPrompt<any, any>[];
|
|
29
|
+
//# sourceMappingURL=bls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../../src/modules/bls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAejD,eAAO,MAAM,IAAI,QAAQ,CAAC;AAC1B,eAAO,MAAM,WAAW,+BAA+B,CAAC;AACxD,eAAO,MAAM,WAAW,sEAAsE,CAAC;AAC/F,eAAO,MAAM,IAAI;;;;CAAgG,CAAC;AAClH,eAAO,MAAM,QAAQ,gFAA2E,CAAC;AACjG,eAAO,MAAM,IAAI,8LAA8L,CAAC;AAEhN,eAAO,MAAM,SAAS;oBAWf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;mBAQtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;CAM5B,CAAC;AAuEF,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EA6IjC,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAc1C,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BLS MCP module — tools + metadata. Delegates all API calls to sdk/bls.
|
|
3
|
+
*
|
|
4
|
+
* Tools return raw JSON data — no markdown formatting. The client decides how to present it.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { getSeriesData, searchPopularSeries, getStateEmploymentSeries, getAvailableTopics, cpiComponents, cpiLabels, industryComponents, industryLabels, } from "../sdk/bls.js";
|
|
8
|
+
// ─── Metadata (server.ts reads these) ────────────────────────────────
|
|
9
|
+
export const name = "bls";
|
|
10
|
+
export const displayName = "Bureau of Labor Statistics";
|
|
11
|
+
export const description = "Employment, wages, CPI components, PPI, JOLTS, labor productivity";
|
|
12
|
+
export const auth = { envVar: "BLS_API_KEY", required: false, signup: "https://www.bls.gov/developers/home.htm" };
|
|
13
|
+
export const workflow = "bls_search_series to find series IDs → bls_series_data to fetch values";
|
|
14
|
+
export const tips = "Key advantage over FRED: granular breakdowns (CPI by food/shelter/gas/medical, employment by industry, wages by sector). API key optional but recommended (25 req/day without, 500 with).";
|
|
15
|
+
export const reference = {
|
|
16
|
+
seriesPrefixes: {
|
|
17
|
+
CES: "Current Employment Statistics (jobs by industry)",
|
|
18
|
+
LNS: "Labor Force Statistics, seasonally adjusted",
|
|
19
|
+
CU: "Consumer Price Index (CPI-U, urban consumers)",
|
|
20
|
+
WP: "Producer Price Index (PPI)",
|
|
21
|
+
OE: "Occupational Employment and Wages",
|
|
22
|
+
JT: "Job Openings and Labor Turnover (JOLTS)",
|
|
23
|
+
LA: "Local Area Unemployment Statistics",
|
|
24
|
+
SM: "State and Metro Employment",
|
|
25
|
+
PR: "Productivity and Costs",
|
|
26
|
+
},
|
|
27
|
+
popularSeries: {
|
|
28
|
+
CES0000000001: "Total nonfarm employment (thousands)",
|
|
29
|
+
LNS14000000: "Unemployment rate",
|
|
30
|
+
"CUUR0000SA0": "CPI-U All Items",
|
|
31
|
+
CES0500000003: "Average hourly earnings",
|
|
32
|
+
JTS000000000000000JOR: "Job openings rate (JOLTS)",
|
|
33
|
+
PRS85006092: "Nonfarm business labor productivity",
|
|
34
|
+
},
|
|
35
|
+
docs: {
|
|
36
|
+
"API v2": "https://www.bls.gov/developers/api_signature_v2.htm",
|
|
37
|
+
"Series Formats": "https://www.bls.gov/help/hlpforma.htm",
|
|
38
|
+
"Registration": "https://www.bls.gov/developers/home.htm",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
// ─── Helpers ─────────────────────────────────────────────────────────
|
|
42
|
+
function summarizeSeriesData(s) {
|
|
43
|
+
const obs = s.data.slice(0, 60).map(d => ({
|
|
44
|
+
period: `${d.year}-${d.period}`,
|
|
45
|
+
periodName: d.periodName,
|
|
46
|
+
year: Number(d.year),
|
|
47
|
+
value: Number(d.value) || null,
|
|
48
|
+
pctChange12Mo: d.calculations?.pct_changes?.["12"] ? Number(d.calculations.pct_changes["12"]) : null,
|
|
49
|
+
}));
|
|
50
|
+
return {
|
|
51
|
+
seriesId: s.seriesID,
|
|
52
|
+
observations: s.data.length,
|
|
53
|
+
data: obs,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function computeYoy(s, labels) {
|
|
57
|
+
const label = labels[s.seriesID] ?? s.seriesID;
|
|
58
|
+
const latest = s.data[0];
|
|
59
|
+
if (!latest)
|
|
60
|
+
return { seriesId: s.seriesID, label, value: null, period: null, year: null, yoyPercent: null };
|
|
61
|
+
const yearAgo = s.data.find(d => d.period === latest.period && d.year === String(Number(latest.year) - 1));
|
|
62
|
+
let yoy = null;
|
|
63
|
+
if (yearAgo) {
|
|
64
|
+
yoy = Number(((Number(latest.value) - Number(yearAgo.value)) / Number(yearAgo.value) * 100).toFixed(1));
|
|
65
|
+
}
|
|
66
|
+
else if (latest.calculations?.pct_changes?.["12"]) {
|
|
67
|
+
yoy = Number(latest.calculations.pct_changes["12"]);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
seriesId: s.seriesID,
|
|
71
|
+
label,
|
|
72
|
+
value: Number(latest.value) || null,
|
|
73
|
+
period: `${latest.year}-${latest.period}`,
|
|
74
|
+
periodName: latest.periodName ?? null,
|
|
75
|
+
year: Number(latest.year),
|
|
76
|
+
yoyPercent: yoy,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function computeEmploymentYoy(s, labels) {
|
|
80
|
+
const label = labels[s.seriesID] ?? s.seriesID;
|
|
81
|
+
const latest = s.data[0];
|
|
82
|
+
if (!latest)
|
|
83
|
+
return { seriesId: s.seriesID, label, valueThousands: null, period: null, year: null, yoyChangeThousands: null };
|
|
84
|
+
const yearAgo = s.data.find(d => d.period === latest.period && d.year === String(Number(latest.year) - 1));
|
|
85
|
+
let yoyDiff = null;
|
|
86
|
+
if (latest && yearAgo) {
|
|
87
|
+
yoyDiff = Number((Number(latest.value) - Number(yearAgo.value)).toFixed(0));
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
seriesId: s.seriesID,
|
|
91
|
+
label,
|
|
92
|
+
valueThousands: Number(latest.value) || null,
|
|
93
|
+
period: `${latest.year}-${latest.period}`,
|
|
94
|
+
periodName: latest.periodName ?? null,
|
|
95
|
+
year: Number(latest.year),
|
|
96
|
+
yoyChangeThousands: yoyDiff,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
100
|
+
export const tools = [
|
|
101
|
+
{
|
|
102
|
+
name: "bls_series_data",
|
|
103
|
+
description: "Fetch time series data from the Bureau of Labor Statistics. " +
|
|
104
|
+
"Returns monthly/quarterly/annual observations for employment, wages, prices, and more.\n\n" +
|
|
105
|
+
"Popular series IDs:\n" +
|
|
106
|
+
"- CES0000000001: Total nonfarm employment (thousands)\n" +
|
|
107
|
+
"- LNS14000000: Unemployment rate\n" +
|
|
108
|
+
"- CUUR0000SA0: CPI-U All Items\n" +
|
|
109
|
+
"- CES0500000003: Average hourly earnings, total private\n" +
|
|
110
|
+
"- JTS000000000000000JOR: Job openings rate (JOLTS)\n" +
|
|
111
|
+
"- PRS85006092: Nonfarm business labor productivity\n\n" +
|
|
112
|
+
"Series ID prefixes: CES (jobs by industry), LNS (unemployment), CU (CPI), WP (PPI), OE (wages), JT (JOLTS)",
|
|
113
|
+
annotations: { title: "BLS: Get Series Data", readOnlyHint: true },
|
|
114
|
+
parameters: z.object({
|
|
115
|
+
series_ids: z.string().describe("Comma-separated BLS series IDs (max 50). Example: 'CES0000000001,LNS14000000,CUUR0000SA0'"),
|
|
116
|
+
start_year: z.number().int().optional().describe("Start year (default: 3 years ago). Max 20 year range with API key, 10 without."),
|
|
117
|
+
end_year: z.number().int().optional().describe("End year (default: current year)"),
|
|
118
|
+
}),
|
|
119
|
+
execute: async ({ series_ids, start_year, end_year }) => {
|
|
120
|
+
const ids = series_ids.split(",").map((s) => s.trim()).filter(Boolean);
|
|
121
|
+
if (!ids.length)
|
|
122
|
+
return JSON.stringify({ summary: "No series IDs provided.", series: [] });
|
|
123
|
+
const defaultStart = new Date().getFullYear() - 3;
|
|
124
|
+
const data = await getSeriesData(ids, {
|
|
125
|
+
startYear: start_year ?? defaultStart,
|
|
126
|
+
endYear: end_year ?? new Date().getFullYear(),
|
|
127
|
+
});
|
|
128
|
+
const series = data.Results?.series ?? [];
|
|
129
|
+
if (!series.length)
|
|
130
|
+
return JSON.stringify({ summary: "No data returned from BLS.", series: [] });
|
|
131
|
+
const messages = data.message?.length ? data.message.join("; ") : null;
|
|
132
|
+
return JSON.stringify({
|
|
133
|
+
summary: `BLS data: ${series.length} series returned${messages ? ` (${messages})` : ""}`,
|
|
134
|
+
notes: messages,
|
|
135
|
+
series: series.map(summarizeSeriesData),
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "bls_search_series",
|
|
141
|
+
description: "Look up popular BLS series IDs by topic. BLS doesn't have a search API, " +
|
|
142
|
+
"so this provides curated series IDs for common topics.\n\n" +
|
|
143
|
+
"Topics: employment, unemployment, wages, cpi, cpi_components, ppi, productivity, jolts, state_employment",
|
|
144
|
+
annotations: { title: "BLS: Popular Series Lookup", readOnlyHint: true },
|
|
145
|
+
parameters: z.object({
|
|
146
|
+
topic: z.string().describe("Topic to look up: 'employment', 'unemployment', 'wages', 'cpi', " +
|
|
147
|
+
"'cpi_components', 'ppi', 'productivity', 'jolts', 'state_employment'"),
|
|
148
|
+
state: z.string().optional().describe("Two-letter state code for state-level data (e.g., 'CA', 'TX')"),
|
|
149
|
+
}),
|
|
150
|
+
execute: async ({ topic, state }) => {
|
|
151
|
+
// State employment uses LAUS codes
|
|
152
|
+
if (topic === "state_employment" && state) {
|
|
153
|
+
const series = getStateEmploymentSeries(state);
|
|
154
|
+
if (!series)
|
|
155
|
+
return JSON.stringify({ summary: `Unknown state code: ${state}`, series: [] });
|
|
156
|
+
return JSON.stringify({
|
|
157
|
+
summary: `BLS state employment series for ${state.toUpperCase()}: ${series.length} series. Use these IDs with bls_series_data.`,
|
|
158
|
+
series,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const series = searchPopularSeries(topic);
|
|
162
|
+
if (!series.length) {
|
|
163
|
+
const available = getAvailableTopics();
|
|
164
|
+
return JSON.stringify({
|
|
165
|
+
summary: `Unknown topic: "${topic}". Available: ${available.join(", ")}`,
|
|
166
|
+
availableTopics: available,
|
|
167
|
+
series: [],
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return JSON.stringify({
|
|
171
|
+
summary: `BLS series for "${topic}": ${series.length} series. Use these IDs with bls_series_data.`,
|
|
172
|
+
series,
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "bls_cpi_breakdown",
|
|
178
|
+
description: "Get a breakdown of Consumer Price Index by component — food, shelter, energy, " +
|
|
179
|
+
"medical care, transportation, etc. Shows which categories are driving inflation.",
|
|
180
|
+
annotations: { title: "BLS: CPI Inflation Breakdown", readOnlyHint: true },
|
|
181
|
+
parameters: z.object({
|
|
182
|
+
start_year: z.number().int().optional().describe("Start year (default: 2 years ago)"),
|
|
183
|
+
end_year: z.number().int().optional().describe("End year (default: current year)"),
|
|
184
|
+
}),
|
|
185
|
+
execute: async ({ start_year, end_year }) => {
|
|
186
|
+
const defaultStart = new Date().getFullYear() - 2;
|
|
187
|
+
const data = await getSeriesData([...cpiComponents], {
|
|
188
|
+
startYear: start_year ?? defaultStart,
|
|
189
|
+
endYear: end_year ?? new Date().getFullYear(),
|
|
190
|
+
});
|
|
191
|
+
const series = data.Results?.series;
|
|
192
|
+
if (!series?.length)
|
|
193
|
+
return JSON.stringify({ summary: "No CPI data returned.", components: [] });
|
|
194
|
+
const components = series.map(s => computeYoy(s, cpiLabels));
|
|
195
|
+
return JSON.stringify({
|
|
196
|
+
summary: `CPI inflation breakdown: ${components.length} components with latest values and YoY change`,
|
|
197
|
+
components,
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "bls_employment_by_industry",
|
|
203
|
+
description: "Get employment numbers broken down by major industry sector. " +
|
|
204
|
+
"Shows which sectors are growing or shrinking.",
|
|
205
|
+
annotations: { title: "BLS: Employment by Industry", readOnlyHint: true },
|
|
206
|
+
parameters: z.object({
|
|
207
|
+
start_year: z.number().int().optional().describe("Start year (default: 3 years ago)"),
|
|
208
|
+
end_year: z.number().int().optional().describe("End year (default: current year)"),
|
|
209
|
+
}),
|
|
210
|
+
execute: async ({ start_year, end_year }) => {
|
|
211
|
+
const defaultStart = new Date().getFullYear() - 3;
|
|
212
|
+
const data = await getSeriesData([...industryComponents], {
|
|
213
|
+
startYear: start_year ?? defaultStart,
|
|
214
|
+
endYear: end_year ?? new Date().getFullYear(),
|
|
215
|
+
});
|
|
216
|
+
const series = data.Results?.series;
|
|
217
|
+
if (!series?.length)
|
|
218
|
+
return JSON.stringify({ summary: "No employment data returned.", industries: [] });
|
|
219
|
+
const industries = series.map(s => computeEmploymentYoy(s, industryLabels));
|
|
220
|
+
return JSON.stringify({
|
|
221
|
+
summary: `Employment by industry: ${industries.length} sectors with latest values (thousands) and YoY change`,
|
|
222
|
+
industries,
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
];
|
|
227
|
+
// ─── Re-export cache control from SDK ────────────────────────────────
|
|
228
|
+
export { clearCache } from "../sdk/bls.js";
|
|
229
|
+
// ─── Prompts (FastMCP InputPrompt type) ──────────────────────────────
|
|
230
|
+
export const prompts = [
|
|
231
|
+
{
|
|
232
|
+
name: "jobs_report",
|
|
233
|
+
description: "Get a comprehensive labor market overview — employment by industry, unemployment demographics, wages, and job openings.",
|
|
234
|
+
load: async () => "Generate a comprehensive labor market report using BLS data.\n\n" +
|
|
235
|
+
"1. **Employment by industry** — use bls_employment_by_industry for sector breakdown with YoY changes\n" +
|
|
236
|
+
"2. **CPI breakdown** — use bls_cpi_breakdown to show cost-of-living pressure on workers\n" +
|
|
237
|
+
"3. **Wages** — use bls_series_data for CES0500000003 (average hourly earnings)\n" +
|
|
238
|
+
"4. **Broader unemployment** — use bls_series_data for LNS13023621 (U-6) and LNS11300000 (participation rate)\n\n" +
|
|
239
|
+
"Compare wages to CPI: are real wages rising or falling?\n" +
|
|
240
|
+
"Which industries are growing vs shrinking?\n" +
|
|
241
|
+
"Present the full picture of the labor market.",
|
|
242
|
+
},
|
|
243
|
+
];
|
|
244
|
+
//# sourceMappingURL=bls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bls.js","sourceRoot":"","sources":["../../src/modules/bls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,GAEf,MAAM,eAAe,CAAC;AAEvB,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,4BAA4B,CAAC;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,mEAAmE,CAAC;AAC/F,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,yCAAyC,EAAE,CAAC;AAClH,MAAM,CAAC,MAAM,QAAQ,GAAG,wEAAwE,CAAC;AACjG,MAAM,CAAC,MAAM,IAAI,GAAG,2LAA2L,CAAC;AAEhN,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,cAAc,EAAE;QACd,GAAG,EAAE,kDAAkD;QACvD,GAAG,EAAE,6CAA6C;QAClD,EAAE,EAAE,+CAA+C;QACnD,EAAE,EAAE,4BAA4B;QAChC,EAAE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AC;AAE3C,wEAAwE;AAExE,MAAM,CAAC,MAAM,OAAO,GAA4B;IAC9C;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,yHAAyH;QACtI,IAAI,EAAE,KAAK,IAAI,EAAE,CACf,kEAAkE;YAClE,wGAAwG;YACxG,2FAA2F;YAC3F,kFAAkF;YAClF,kHAAkH;YAClH,2DAA2D;YAC3D,8CAA8C;YAC9C,+CAA+C;KAClD;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BTS module — Bureau of Transportation Statistics: monthly transport stats, border crossings.
|
|
3
|
+
*/
|
|
4
|
+
import type { Tool } from "fastmcp";
|
|
5
|
+
import { clearCache as sdkClearCache } from "../sdk/bts.js";
|
|
6
|
+
export declare const name = "bts";
|
|
7
|
+
export declare const displayName = "BTS (Bureau of Transportation Statistics)";
|
|
8
|
+
export declare const description = "Monthly Transportation Statistics (50+ indicators): airline traffic & on-time %, transit ridership, rail freight, truck tonnage, fuel prices, vehicle sales, safety fatalities, Transportation Services Index, and border crossing data at U.S. ports of entry. No API key required.";
|
|
9
|
+
export declare const workflow = "Use bts_transport_stats for national monthly transportation indicators (airlines, transit, rail, fuel, safety) \u2192 bts_border_crossings for port-of-entry volumes (trucks, vehicles, pedestrians).";
|
|
10
|
+
export declare const tips = "Transport stats are monthly time series \u2014 use limit=24 for 2 years of trend data. Border crossing states use full names ('Texas', 'California'). Measures: 'Trucks', 'Personal Vehicles', 'Pedestrians'. Borders: 'US-Mexico Border', 'US-Canada Border'.";
|
|
11
|
+
export declare const reference: {
|
|
12
|
+
transportFields: Record<string, string>;
|
|
13
|
+
borderMeasures: Record<string, string>;
|
|
14
|
+
datasets: Record<string, {
|
|
15
|
+
id: string;
|
|
16
|
+
description: string;
|
|
17
|
+
}>;
|
|
18
|
+
docs: {
|
|
19
|
+
"BTS Open Data": string;
|
|
20
|
+
"Monthly Transportation Statistics": string;
|
|
21
|
+
"Border Crossing Data": string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const tools: Tool<any, any>[];
|
|
25
|
+
export { sdkClearCache as clearCache };
|
|
26
|
+
//# sourceMappingURL=bts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bts.d.ts","sourceRoot":"","sources":["../../src/modules/bts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAML,UAAU,IAAI,aAAa,EAE5B,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,IAAI,QAAQ,CAAC;AAC1B,eAAO,MAAM,WAAW,8CAA8C,CAAC;AACvE,eAAO,MAAM,WAAW,yRACgQ,CAAC;AACzR,eAAO,MAAM,QAAQ,0MAC+K,CAAC;AACrM,eAAO,MAAM,IAAI,mQAC4O,CAAC;AAE9P,eAAO,MAAM,SAAS;;;;;;;;;;;;CASrB,CAAC;AA4CF,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAyDjC,CAAC;AAEF,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BTS module — Bureau of Transportation Statistics: monthly transport stats, border crossings.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { getTransportStats, getBorderCrossings, TRANSPORT_FIELDS, BORDER_MEASURES, DATASETS, clearCache as sdkClearCache, } from "../sdk/bts.js";
|
|
6
|
+
// ─── Metadata ────────────────────────────────────────────────────────
|
|
7
|
+
export const name = "bts";
|
|
8
|
+
export const displayName = "BTS (Bureau of Transportation Statistics)";
|
|
9
|
+
export const description = "Monthly Transportation Statistics (50+ indicators): airline traffic & on-time %, transit ridership, rail freight, truck tonnage, fuel prices, vehicle sales, safety fatalities, Transportation Services Index, and border crossing data at U.S. ports of entry. No API key required.";
|
|
10
|
+
export const workflow = "Use bts_transport_stats for national monthly transportation indicators (airlines, transit, rail, fuel, safety) → bts_border_crossings for port-of-entry volumes (trucks, vehicles, pedestrians).";
|
|
11
|
+
export const tips = "Transport stats are monthly time series — use limit=24 for 2 years of trend data. Border crossing states use full names ('Texas', 'California'). Measures: 'Trucks', 'Personal Vehicles', 'Pedestrians'. Borders: 'US-Mexico Border', 'US-Canada Border'.";
|
|
12
|
+
export const reference = {
|
|
13
|
+
transportFields: TRANSPORT_FIELDS,
|
|
14
|
+
borderMeasures: BORDER_MEASURES,
|
|
15
|
+
datasets: DATASETS,
|
|
16
|
+
docs: {
|
|
17
|
+
"BTS Open Data": "https://data.bts.gov/",
|
|
18
|
+
"Monthly Transportation Statistics": "https://data.bts.gov/d/crem-w557",
|
|
19
|
+
"Border Crossing Data": "https://data.bts.gov/d/keg4-3bc2",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
// ─── Helpers ─────────────────────────────────────────────────────────
|
|
23
|
+
function formatNum(val) {
|
|
24
|
+
if (!val)
|
|
25
|
+
return "N/A";
|
|
26
|
+
const n = Number(val);
|
|
27
|
+
return isNaN(n) ? val : n.toLocaleString();
|
|
28
|
+
}
|
|
29
|
+
function summarizeTransportStats(records) {
|
|
30
|
+
if (!records.length)
|
|
31
|
+
return "No transportation statistics found for the given criteria.";
|
|
32
|
+
const lines = records.map((r) => {
|
|
33
|
+
const date = r.date ? r.date.split("T")[0] : "?";
|
|
34
|
+
const parts = [`${date}:`];
|
|
35
|
+
// Key indicators (show what's available)
|
|
36
|
+
const fields = [
|
|
37
|
+
["Airline Traffic", r.u_s_airline_traffic_total_non_seasonally_adjusted],
|
|
38
|
+
["On-Time %", r.u_s_marketing_air_carriers_on_time_performance_percent],
|
|
39
|
+
["Transit Ridership", r.system_use_transit_ridership],
|
|
40
|
+
["TSI-Freight", r.transportation_services_index_freight],
|
|
41
|
+
["TSI-Passenger", r.transportation_services_index_passenger],
|
|
42
|
+
["Truck Tonnage", r.truck_tonnage_index],
|
|
43
|
+
["Gas Price", r.highway_fuel_prices_regular],
|
|
44
|
+
["Auto Sales (SAAR M)", r.auto_sales_saar_millions],
|
|
45
|
+
["Amtrak On-Time", r.amtrak_on_time_performance],
|
|
46
|
+
["Rail Fatalities", r.rail_fatalities],
|
|
47
|
+
["MX Trucks", r.u_s_mexico_incoming_truck_crossings],
|
|
48
|
+
["CA Trucks", r.u_s_canada_incoming_truck_crossings],
|
|
49
|
+
];
|
|
50
|
+
const available = fields.filter(([, v]) => v && v !== "");
|
|
51
|
+
available.forEach(([label, val]) => parts.push(` ${label}: ${formatNum(val)}`));
|
|
52
|
+
return parts.join("\n");
|
|
53
|
+
});
|
|
54
|
+
return `${records.length} month(s) of transportation data:\n\n${lines.join("\n\n")}`;
|
|
55
|
+
}
|
|
56
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
57
|
+
export const tools = [
|
|
58
|
+
{
|
|
59
|
+
name: "bts_transport_stats",
|
|
60
|
+
description: "Get Monthly Transportation Statistics — 50+ national indicators including:\n" +
|
|
61
|
+
"• Airline passenger traffic and on-time performance %\n" +
|
|
62
|
+
"• Transit ridership, highway vehicle miles\n" +
|
|
63
|
+
"• Rail freight, Amtrak ridership and on-time %\n" +
|
|
64
|
+
"• Truck tonnage, fuel prices, vehicle sales\n" +
|
|
65
|
+
"• Transportation Services Index (freight, passenger, combined)\n" +
|
|
66
|
+
"• Border crossing summaries (trucks, persons)\n" +
|
|
67
|
+
"• Safety fatalities (air, rail)\n" +
|
|
68
|
+
"Monthly data going back to 1947 for some series.",
|
|
69
|
+
annotations: { title: "BTS: Transport Statistics", readOnlyHint: true },
|
|
70
|
+
parameters: z.object({
|
|
71
|
+
start_date: z.string().optional().describe("Start date: '2020-01-01'"),
|
|
72
|
+
end_date: z.string().optional().describe("End date: '2024-12-31'"),
|
|
73
|
+
limit: z.number().int().max(120).optional().describe("Months of data (default 24 = 2 years)"),
|
|
74
|
+
}),
|
|
75
|
+
execute: async (args) => {
|
|
76
|
+
const data = await getTransportStats({
|
|
77
|
+
startDate: args.start_date,
|
|
78
|
+
endDate: args.end_date,
|
|
79
|
+
limit: args.limit,
|
|
80
|
+
});
|
|
81
|
+
return { content: [{ type: "text", text: summarizeTransportStats(data) }] };
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "bts_border_crossings",
|
|
86
|
+
description: "Get border crossing data at U.S. ports of entry: trucks, personal vehicles, pedestrians, train passengers, containers.\n" +
|
|
87
|
+
"Covers U.S.-Mexico and U.S.-Canada borders. Monthly data by port, state, and measure type.",
|
|
88
|
+
annotations: { title: "BTS: Border Crossings", readOnlyHint: true },
|
|
89
|
+
parameters: z.object({
|
|
90
|
+
state: z.string().optional().describe("State full name: 'Texas', 'California', 'New York'"),
|
|
91
|
+
border: z.string().optional().describe("'US-Mexico Border' or 'US-Canada Border'"),
|
|
92
|
+
port_name: z.string().optional().describe("Port of entry name: 'El Paso', 'San Ysidro', 'Detroit'"),
|
|
93
|
+
measure: z.string().optional().describe("'Trucks', 'Personal Vehicles', 'Pedestrians', 'Train Passengers', 'Buses'"),
|
|
94
|
+
limit: z.number().int().max(100).optional().describe("Max results (default 20)"),
|
|
95
|
+
}),
|
|
96
|
+
execute: async (args) => {
|
|
97
|
+
const data = await getBorderCrossings({
|
|
98
|
+
state: args.state,
|
|
99
|
+
border: args.border,
|
|
100
|
+
portName: args.port_name,
|
|
101
|
+
measure: args.measure,
|
|
102
|
+
limit: args.limit,
|
|
103
|
+
});
|
|
104
|
+
if (!data.length)
|
|
105
|
+
return { content: [{ type: "text", text: "No border crossing data found." }] };
|
|
106
|
+
const lines = data.map((r) => `${r.port_name ?? "?"} (${r.state ?? "?"}) — ${r.border ?? "?"}\n ${r.measure ?? "?"}: ${formatNum(r.value)} (${r.date?.split("T")[0] ?? "?"})`);
|
|
107
|
+
return { content: [{ type: "text", text: `${data.length} record(s):\n\n${lines.join("\n\n")}` }] };
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
export { sdkClearCache as clearCache };
|
|
112
|
+
//# sourceMappingURL=bts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bts.js","sourceRoot":"","sources":["../../src/modules/bts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,UAAU,IAAI,aAAa,GAE5B,MAAM,eAAe,CAAC;AAEvB,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,2CAA2C,CAAC;AACvE,MAAM,CAAC,MAAM,WAAW,GACtB,sRAAsR,CAAC;AACzR,MAAM,CAAC,MAAM,QAAQ,GACnB,kMAAkM,CAAC;AACrM,MAAM,CAAC,MAAM,IAAI,GACf,2PAA2P,CAAC;AAE9P,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,eAAe,EAAE,gBAAgB;IACjC,cAAc,EAAE,eAAe;IAC/B,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE;QACJ,eAAe,EAAE,uBAAuB;QACxC,mCAAmC,EAAE,kCAAkC;QACvE,sBAAsB,EAAE,kCAAkC;KAC3D;CACF,CAAC;AAEF,wEAAwE;AAExE,SAAS,SAAS,CAAC,GAAuB;IACxC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;AAC7C,CAAC;AAED,SAAS,uBAAuB,CAAC,OAA+B;IAC9D,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,4DAA4D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