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,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* USGS module — earthquake data and water resources monitoring.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { searchEarthquakes, countEarthquakes, getSignificantEarthquakes, getWaterData, getDailyWaterData, searchWaterSites, WATER_PARAMS, ALERT_LEVELS, clearCache as sdkClearCache, } from "../sdk/usgs.js";
|
|
6
|
+
// ─── Metadata ────────────────────────────────────────────────────────
|
|
7
|
+
export const name = "usgs";
|
|
8
|
+
export const displayName = "USGS (U.S. Geological Survey)";
|
|
9
|
+
export const description = "Earthquake events (magnitude, location, depth, tsunami risk) and water resources monitoring (streamflow, water levels, temperature) from 13,000+ stations nationwide. No API key required.";
|
|
10
|
+
export const workflow = "Use usgs_earthquakes to search for earthquakes by magnitude/location/date → usgs_significant for recent notable events → usgs_water_data for streamflow and water levels at monitoring sites → usgs_water_sites to find stations.";
|
|
11
|
+
export const tips = "Earthquake magnitudes: 2.5+ felt by people, 4.0+ moderate, 5.0+ significant, 7.0+ major. Water parameter codes: 00060=discharge, 00065=gage height, 00010=water temp. Use state codes (CA, TX) for water site searches.";
|
|
12
|
+
export const reference = {
|
|
13
|
+
waterParams: WATER_PARAMS,
|
|
14
|
+
alertLevels: ALERT_LEVELS,
|
|
15
|
+
docs: {
|
|
16
|
+
"Earthquake API": "https://earthquake.usgs.gov/fdsnws/event/1/",
|
|
17
|
+
"Water Services": "https://waterservices.usgs.gov/",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
// ─── Helpers ─────────────────────────────────────────────────────────
|
|
21
|
+
function summarizeEarthquakes(features) {
|
|
22
|
+
if (!features.length)
|
|
23
|
+
return "No earthquakes found matching the criteria.";
|
|
24
|
+
const lines = features.map((f) => {
|
|
25
|
+
const p = f.properties;
|
|
26
|
+
const [lon, lat, depth] = f.geometry.coordinates;
|
|
27
|
+
const time = p.time ? new Date(p.time).toISOString() : "?";
|
|
28
|
+
const parts = [
|
|
29
|
+
`M${p.mag ?? "?"} — ${p.place ?? "Unknown location"}`,
|
|
30
|
+
` Time: ${time}`,
|
|
31
|
+
` Depth: ${depth?.toFixed(1) ?? "?"}km | Lat: ${lat?.toFixed(3)}, Lon: ${lon?.toFixed(3)}`,
|
|
32
|
+
];
|
|
33
|
+
if (p.alert)
|
|
34
|
+
parts.push(` Alert: ${p.alert.toUpperCase()} — ${ALERT_LEVELS[p.alert] ?? ""}`);
|
|
35
|
+
if (p.tsunami === 1)
|
|
36
|
+
parts.push(" âš TSUNAMI WARNING");
|
|
37
|
+
if (p.felt)
|
|
38
|
+
parts.push(` Felt by: ${p.felt} people`);
|
|
39
|
+
if (p.url)
|
|
40
|
+
parts.push(` Details: ${p.url}`);
|
|
41
|
+
return parts.join("\n");
|
|
42
|
+
});
|
|
43
|
+
return `${features.length} earthquake(s) found:\n\n${lines.join("\n\n")}`;
|
|
44
|
+
}
|
|
45
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
46
|
+
export const tools = [
|
|
47
|
+
{
|
|
48
|
+
name: "usgs_earthquakes",
|
|
49
|
+
description: "Search for earthquakes by magnitude, location, date range, and more.\n" +
|
|
50
|
+
"Returns magnitude, location, depth, time, alert level, tsunami risk, and felt reports.\n" +
|
|
51
|
+
"Magnitude scale: 2.5+ felt by people, 4.0+ moderate, 5.0+ significant, 7.0+ major.",
|
|
52
|
+
annotations: { title: "USGS: Earthquake Search", readOnlyHint: true },
|
|
53
|
+
parameters: z.object({
|
|
54
|
+
starttime: z.string().optional().describe("Start date ISO format: '2024-01-01'"),
|
|
55
|
+
endtime: z.string().optional().describe("End date ISO format: '2024-12-31'"),
|
|
56
|
+
minmagnitude: z.number().optional().describe("Minimum magnitude (e.g. 4.0, 5.0, 6.0)"),
|
|
57
|
+
maxmagnitude: z.number().optional().describe("Maximum magnitude"),
|
|
58
|
+
latitude: z.number().optional().describe("Center latitude for radius search"),
|
|
59
|
+
longitude: z.number().optional().describe("Center longitude for radius search"),
|
|
60
|
+
maxradiuskm: z.number().optional().describe("Search radius in km (requires lat/lon)"),
|
|
61
|
+
alertlevel: z.enum(["green", "yellow", "orange", "red"]).optional().describe("PAGER alert level filter"),
|
|
62
|
+
limit: z.number().int().max(200).optional().describe("Max results (default 20, max 200)"),
|
|
63
|
+
orderby: z.enum(["time", "time-asc", "magnitude", "magnitude-asc"]).optional().describe("Sort order (default: time)"),
|
|
64
|
+
}),
|
|
65
|
+
execute: async (args) => {
|
|
66
|
+
const data = await searchEarthquakes(args);
|
|
67
|
+
const header = `${data.metadata?.count ?? data.features.length} total matches`;
|
|
68
|
+
return { content: [{ type: "text", text: `${header}\n\n${summarizeEarthquakes(data.features)}` }] };
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "usgs_significant",
|
|
73
|
+
description: "Get significant earthquakes from the past 30 days (typically M4.5+ or felt/damaging events).\n" +
|
|
74
|
+
"Quick way to see the latest notable seismic activity worldwide.",
|
|
75
|
+
annotations: { title: "USGS: Significant Earthquakes", readOnlyHint: true },
|
|
76
|
+
parameters: z.object({}),
|
|
77
|
+
execute: async () => {
|
|
78
|
+
const data = await getSignificantEarthquakes();
|
|
79
|
+
return { content: [{ type: "text", text: summarizeEarthquakes(data.features) }] };
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "usgs_earthquake_count",
|
|
84
|
+
description: "Count earthquakes matching criteria without fetching full details.\n" +
|
|
85
|
+
"Useful for statistics: 'How many M5+ earthquakes occurred in 2024?'",
|
|
86
|
+
annotations: { title: "USGS: Earthquake Count", readOnlyHint: true },
|
|
87
|
+
parameters: z.object({
|
|
88
|
+
starttime: z.string().optional().describe("Start date: '2024-01-01'"),
|
|
89
|
+
endtime: z.string().optional().describe("End date: '2024-12-31'"),
|
|
90
|
+
minmagnitude: z.number().optional().describe("Minimum magnitude"),
|
|
91
|
+
maxmagnitude: z.number().optional().describe("Maximum magnitude"),
|
|
92
|
+
latitude: z.number().optional().describe("Center latitude for radius search"),
|
|
93
|
+
longitude: z.number().optional().describe("Center longitude for radius search"),
|
|
94
|
+
maxradiuskm: z.number().optional().describe("Search radius in km"),
|
|
95
|
+
}),
|
|
96
|
+
execute: async (args) => {
|
|
97
|
+
const data = await countEarthquakes(args);
|
|
98
|
+
return { content: [{ type: "text", text: `Earthquake count: ${data.count}` }] };
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "usgs_water_data",
|
|
103
|
+
description: "Get real-time water data (streamflow, gage height, temperature) from USGS monitoring sites.\n" +
|
|
104
|
+
"13,000+ stations nationwide. Parameter codes: 00060=discharge (cfs), 00065=gage height (ft), 00010=water temp (°C).\n" +
|
|
105
|
+
"Query by site ID, state, county, or hydrologic unit code (HUC).",
|
|
106
|
+
annotations: { title: "USGS: Water Data", readOnlyHint: true },
|
|
107
|
+
parameters: z.object({
|
|
108
|
+
sites: z.string().optional().describe("USGS site number(s), comma-separated: '01646500' or '01646500,01647000'"),
|
|
109
|
+
state_cd: z.string().optional().describe("Two-letter state code: 'CA', 'TX', 'NY'"),
|
|
110
|
+
parameter_cd: z.string().optional().describe("Parameter code: '00060' (discharge), '00065' (gage height), '00010' (temp). Default: 00060"),
|
|
111
|
+
period: z.string().optional().describe("ISO 8601 duration: 'P1D' (1 day, default), 'P7D' (7 days), 'P30D' (30 days)"),
|
|
112
|
+
start_dt: z.string().optional().describe("Start date: '2024-01-01' (overrides period)"),
|
|
113
|
+
end_dt: z.string().optional().describe("End date: '2024-01-31'"),
|
|
114
|
+
}),
|
|
115
|
+
execute: async (args) => {
|
|
116
|
+
const data = await getWaterData({
|
|
117
|
+
sites: args.sites,
|
|
118
|
+
stateCd: args.state_cd,
|
|
119
|
+
parameterCd: args.parameter_cd,
|
|
120
|
+
period: args.period,
|
|
121
|
+
startDT: args.start_dt,
|
|
122
|
+
endDT: args.end_dt,
|
|
123
|
+
});
|
|
124
|
+
const series = data?.value?.timeSeries ?? [];
|
|
125
|
+
if (!series.length)
|
|
126
|
+
return { content: [{ type: "text", text: "No water data found for the specified criteria." }] };
|
|
127
|
+
const summaries = series.slice(0, 20).map((ts) => {
|
|
128
|
+
const siteName = ts.sourceInfo?.siteName ?? "Unknown";
|
|
129
|
+
const siteCode = ts.sourceInfo?.siteCode?.[0]?.value ?? "?";
|
|
130
|
+
const varName = ts.variable?.variableName ?? "?";
|
|
131
|
+
const unit = ts.variable?.unit?.unitCode ?? "";
|
|
132
|
+
const values = ts.values?.[0]?.value ?? [];
|
|
133
|
+
const latest = values[values.length - 1];
|
|
134
|
+
return `${siteName} (${siteCode})\n ${varName}: ${latest?.value ?? "N/A"} ${unit} (${latest?.dateTime ?? "?"}) | ${values.length} readings`;
|
|
135
|
+
});
|
|
136
|
+
return { content: [{ type: "text", text: `${series.length} time series found:\n\n${summaries.join("\n\n")}` }] };
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "usgs_water_sites",
|
|
141
|
+
description: "Search for USGS water monitoring sites by state, county, or hydrologic unit.\n" +
|
|
142
|
+
"Site types: ST=stream, GW=groundwater, LK=lake, SP=spring.",
|
|
143
|
+
annotations: { title: "USGS: Water Sites", readOnlyHint: true },
|
|
144
|
+
parameters: z.object({
|
|
145
|
+
state_cd: z.string().optional().describe("Two-letter state code: 'CA', 'TX'"),
|
|
146
|
+
county_cd: z.string().optional().describe("County FIPS code"),
|
|
147
|
+
site_type: z.string().optional().describe("Site type: 'ST' (stream, default), 'GW' (groundwater), 'LK' (lake), 'SP' (spring)"),
|
|
148
|
+
}),
|
|
149
|
+
execute: async (args) => {
|
|
150
|
+
const data = await searchWaterSites({
|
|
151
|
+
stateCd: args.state_cd,
|
|
152
|
+
countyCd: args.county_cd,
|
|
153
|
+
siteType: args.site_type,
|
|
154
|
+
});
|
|
155
|
+
// RDB format comes back as a string
|
|
156
|
+
const text = typeof data === "string" ? data : JSON.stringify(data, null, 2);
|
|
157
|
+
const lines = text.split("\n").filter((l) => !l.startsWith("#"));
|
|
158
|
+
const preview = lines.slice(0, 50).join("\n");
|
|
159
|
+
return { content: [{ type: "text", text: `Water monitoring sites:\n\n${preview}${lines.length > 50 ? `\n\n... ${lines.length - 50} more rows` : ""}` }] };
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "usgs_daily_water_data",
|
|
164
|
+
description: "Get USGS daily value water data (historical daily averages).\n" +
|
|
165
|
+
"Unlike real-time instantaneous values, these are aggregated daily means — better for trend analysis.\n" +
|
|
166
|
+
"Parameter codes: 00060=discharge (cfs), 00065=gage height (ft), 00010=water temp (°C).",
|
|
167
|
+
annotations: { title: "USGS: Daily Water Data", readOnlyHint: true },
|
|
168
|
+
parameters: z.object({
|
|
169
|
+
sites: z.string().optional().describe("USGS site number(s): '01646500'"),
|
|
170
|
+
state_cd: z.string().optional().describe("Two-letter state code: 'CA', 'TX'"),
|
|
171
|
+
parameter_cd: z.string().optional().describe("Parameter code: '00060' (discharge), '00065' (gage height). Default: 00060"),
|
|
172
|
+
period: z.string().optional().describe("ISO 8601 duration: 'P30D' (default), 'P90D', 'P365D'"),
|
|
173
|
+
start_dt: z.string().optional().describe("Start date: '2024-01-01' (overrides period)"),
|
|
174
|
+
end_dt: z.string().optional().describe("End date: '2024-12-31'"),
|
|
175
|
+
}),
|
|
176
|
+
execute: async (args) => {
|
|
177
|
+
const data = await getDailyWaterData({
|
|
178
|
+
sites: args.sites,
|
|
179
|
+
stateCd: args.state_cd,
|
|
180
|
+
parameterCd: args.parameter_cd,
|
|
181
|
+
period: args.period,
|
|
182
|
+
startDT: args.start_dt,
|
|
183
|
+
endDT: args.end_dt,
|
|
184
|
+
});
|
|
185
|
+
const series = data?.value?.timeSeries ?? [];
|
|
186
|
+
if (!series.length)
|
|
187
|
+
return { content: [{ type: "text", text: "No daily water data found." }] };
|
|
188
|
+
const summaries = series.slice(0, 10).map((ts) => {
|
|
189
|
+
const siteName = ts.sourceInfo?.siteName ?? "Unknown";
|
|
190
|
+
const siteCode = ts.sourceInfo?.siteCode?.[0]?.value ?? "?";
|
|
191
|
+
const varName = ts.variable?.variableName ?? "?";
|
|
192
|
+
const unit = ts.variable?.unit?.unitCode ?? "";
|
|
193
|
+
const values = ts.values?.[0]?.value ?? [];
|
|
194
|
+
const latest = values[values.length - 1];
|
|
195
|
+
const earliest = values[0];
|
|
196
|
+
return `${siteName} (${siteCode})\n ${varName}: ${values.length} daily values\n Latest: ${latest?.value ?? "N/A"} ${unit} (${latest?.dateTime?.split("T")[0] ?? "?"})\n Earliest: ${earliest?.value ?? "N/A"} ${unit} (${earliest?.dateTime?.split("T")[0] ?? "?"})`;
|
|
197
|
+
});
|
|
198
|
+
return { content: [{ type: "text", text: `${series.length} time series found:\n\n${summaries.join("\n\n")}` }] };
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
];
|
|
202
|
+
export { sdkClearCache as clearCache };
|
|
203
|
+
//# sourceMappingURL=usgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usgs.js","sourceRoot":"","sources":["../../src/modules/usgs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,IAAI,aAAa,GAE5B,MAAM,gBAAgB,CAAC;AAExB,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAC3B,MAAM,CAAC,MAAM,WAAW,GAAG,+BAA+B,CAAC;AAC3D,MAAM,CAAC,MAAM,WAAW,GACtB,4LAA4L,CAAC;AAC/L,MAAM,CAAC,MAAM,QAAQ,GACnB,mOAAmO,CAAC;AACtO,MAAM,CAAC,MAAM,IAAI,GACf,yNAAyN,CAAC;AAE5N,MAAM,CAAC,MAAM,SAAS,GAAG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KAAK,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAE;YAC3Q,CAAC,CAAC,CAAC;YACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,0BAA0B,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC5H,CAAC;KACF;CACF,CAAC;AAEF,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* USPTO module — Patent search, inventor lookup, assignee analysis via PatentsView API
|
|
3
|
+
*/
|
|
4
|
+
import type { Tool } from "fastmcp";
|
|
5
|
+
import { clearCache as sdkClearCache } from "../sdk/uspto.js";
|
|
6
|
+
export declare const name = "uspto";
|
|
7
|
+
export declare const displayName = "USPTO PatentsView";
|
|
8
|
+
export declare const description = "U.S. Patent & Trademark Office patent data via PatentsView \u2014 search patents by keyword, assignee, inventor, date, or CPC class. Look up inventors and patent-holding organizations. Covers all U.S. utility, design, plant, and reissue patents.";
|
|
9
|
+
export declare const workflow = "Use uspto_search_patents to find patents by keyword, company, or inventor \u2192 uspto_patent_details for full details on a specific patent \u2192 uspto_search_assignees to find companies with the most patents in an area.";
|
|
10
|
+
export declare const tips = "Patent types: 'utility' (most common), 'design', 'plant', 'reissue'. CPC sections: A (Human Necessities), B (Operations/Transport), C (Chemistry), D (Textiles), E (Construction), F (Mechanical Engineering), G (Physics), H (Electricity). Use yearFrom/yearTo to filter by grant date. Patent numbers don't have commas (e.g. '11234567' not '11,234,567').";
|
|
11
|
+
export declare const tools: Tool<any, any>[];
|
|
12
|
+
export { sdkClearCache as clearCache };
|
|
13
|
+
//# sourceMappingURL=uspto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uspto.d.ts","sourceRoot":"","sources":["../../src/modules/uspto.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAKL,UAAU,IAAI,aAAa,EAC5B,MAAM,iBAAiB,CAAC;AAIzB,eAAO,MAAM,IAAI,UAAU,CAAC;AAC5B,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,WAAW,0PAC4N,CAAC;AACrP,eAAO,MAAM,QAAQ,kOACkM,CAAC;AACxN,eAAO,MAAM,IAAI,mWACiV,CAAC;AA4BnW,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EA0IjC,CAAC;AAEF,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* USPTO module — Patent search, inventor lookup, assignee analysis via PatentsView API
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { searchPatents, getPatent, searchInventors, searchAssignees, clearCache as sdkClearCache, } from "../sdk/uspto.js";
|
|
6
|
+
// ─── Metadata ────────────────────────────────────────────────────────
|
|
7
|
+
export const name = "uspto";
|
|
8
|
+
export const displayName = "USPTO PatentsView";
|
|
9
|
+
export const description = "U.S. Patent & Trademark Office patent data via PatentsView — search patents by keyword, assignee, inventor, date, or CPC class. Look up inventors and patent-holding organizations. Covers all U.S. utility, design, plant, and reissue patents.";
|
|
10
|
+
export const workflow = "Use uspto_search_patents to find patents by keyword, company, or inventor → uspto_patent_details for full details on a specific patent → uspto_search_assignees to find companies with the most patents in an area.";
|
|
11
|
+
export const tips = "Patent types: 'utility' (most common), 'design', 'plant', 'reissue'. CPC sections: A (Human Necessities), B (Operations/Transport), C (Chemistry), D (Textiles), E (Construction), F (Mechanical Engineering), G (Physics), H (Electricity). Use yearFrom/yearTo to filter by grant date. Patent numbers don't have commas (e.g. '11234567' not '11,234,567').";
|
|
12
|
+
// ─── Helpers ─────────────────────────────────────────────────────────
|
|
13
|
+
function formatPatent(p) {
|
|
14
|
+
const lines = [
|
|
15
|
+
`Patent ${p.patentNumber}: ${p.patentTitle}`,
|
|
16
|
+
` Date: ${p.patentDate} Type: ${p.patentType ?? "N/A"} Claims: ${p.numClaims ?? "N/A"}`,
|
|
17
|
+
];
|
|
18
|
+
if (p.assigneeOrganization)
|
|
19
|
+
lines.push(` Assignee: ${p.assigneeOrganization}`);
|
|
20
|
+
if (p.inventorNames.length)
|
|
21
|
+
lines.push(` Inventors: ${p.inventorNames.join(", ")}`);
|
|
22
|
+
if (p.cpcGroup)
|
|
23
|
+
lines.push(` CPC: ${p.cpcGroup}`);
|
|
24
|
+
if (p.patentAbstract)
|
|
25
|
+
lines.push(` Abstract: ${p.patentAbstract}`);
|
|
26
|
+
return lines.join("\n");
|
|
27
|
+
}
|
|
28
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
29
|
+
export const tools = [
|
|
30
|
+
{
|
|
31
|
+
name: "uspto_search_patents",
|
|
32
|
+
description: "Search U.S. patents by keyword, assignee (company), inventor name, date range, patent type, or CPC technology class. Returns patent number, title, date, assignee, inventors, and abstract.",
|
|
33
|
+
annotations: { title: "Search Patents", readOnlyHint: true },
|
|
34
|
+
parameters: z.object({
|
|
35
|
+
query: z.string().optional().describe("Search text — matches against title and abstract"),
|
|
36
|
+
assignee: z.string().optional().describe("Assignee organization name (e.g. 'Google', 'IBM', 'MIT')"),
|
|
37
|
+
inventor: z.string().optional().describe("Inventor name to search"),
|
|
38
|
+
year_from: z.number().optional().describe("Start year for patent grant date (e.g. 2020)"),
|
|
39
|
+
year_to: z.number().optional().describe("End year for patent grant date (e.g. 2024)"),
|
|
40
|
+
patent_type: z.enum(["utility", "design", "plant", "reissue"]).optional().describe("Patent type filter"),
|
|
41
|
+
cpc_section: z.string().optional().describe("CPC section letter: A-H (e.g. 'G' for Physics, 'H' for Electricity)"),
|
|
42
|
+
page: z.number().optional().describe("Page number (default 1)"),
|
|
43
|
+
per_page: z.number().max(50).optional().describe("Results per page (max 50, default 25)"),
|
|
44
|
+
}),
|
|
45
|
+
execute: async (args) => {
|
|
46
|
+
const result = await searchPatents({
|
|
47
|
+
query: args.query,
|
|
48
|
+
assignee: args.assignee,
|
|
49
|
+
inventor: args.inventor,
|
|
50
|
+
yearFrom: args.year_from,
|
|
51
|
+
yearTo: args.year_to,
|
|
52
|
+
patentType: args.patent_type,
|
|
53
|
+
cpcSection: args.cpc_section,
|
|
54
|
+
page: args.page,
|
|
55
|
+
perPage: args.per_page,
|
|
56
|
+
});
|
|
57
|
+
if (!result.patents.length) {
|
|
58
|
+
return { content: [{ type: "text", text: "No patents found matching the criteria." }] };
|
|
59
|
+
}
|
|
60
|
+
const header = `Found ${result.total.toLocaleString()} patent(s). Showing ${result.patents.length}:\n`;
|
|
61
|
+
const body = result.patents.map(formatPatent).join("\n\n");
|
|
62
|
+
return { content: [{ type: "text", text: header + body }] };
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "uspto_patent_details",
|
|
67
|
+
description: "Get details for a specific U.S. patent by patent number. Returns title, date, abstract, assignee, inventors, claims count, and CPC classification.",
|
|
68
|
+
annotations: { title: "Patent Details", readOnlyHint: true },
|
|
69
|
+
parameters: z.object({
|
|
70
|
+
patent_number: z.string().describe("Patent number (e.g. '11234567' — no commas)"),
|
|
71
|
+
}),
|
|
72
|
+
execute: async (args) => {
|
|
73
|
+
const patent = await getPatent(args.patent_number);
|
|
74
|
+
if (!patent) {
|
|
75
|
+
return { content: [{ type: "text", text: `Patent ${args.patent_number} not found.` }] };
|
|
76
|
+
}
|
|
77
|
+
return { content: [{ type: "text", text: formatPatent(patent) }] };
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "uspto_search_inventors",
|
|
82
|
+
description: "Search for patent inventors by name, state, or country. Shows inventor details and patent counts.",
|
|
83
|
+
annotations: { title: "Search Inventors", readOnlyHint: true },
|
|
84
|
+
parameters: z.object({
|
|
85
|
+
name: z.string().optional().describe("Inventor name to search (first or last)"),
|
|
86
|
+
first_name: z.string().optional().describe("Inventor first name"),
|
|
87
|
+
last_name: z.string().optional().describe("Inventor last name"),
|
|
88
|
+
state: z.string().optional().describe("U.S. state abbreviation (e.g. CA, TX)"),
|
|
89
|
+
country: z.string().optional().describe("Country code (e.g. US, CN, JP, DE)"),
|
|
90
|
+
page: z.number().optional().describe("Page number (default 1)"),
|
|
91
|
+
}),
|
|
92
|
+
execute: async (args) => {
|
|
93
|
+
const result = await searchInventors({
|
|
94
|
+
name: args.name,
|
|
95
|
+
firstName: args.first_name,
|
|
96
|
+
lastName: args.last_name,
|
|
97
|
+
state: args.state,
|
|
98
|
+
country: args.country,
|
|
99
|
+
page: args.page,
|
|
100
|
+
});
|
|
101
|
+
if (!result.inventors.length) {
|
|
102
|
+
return { content: [{ type: "text", text: "No inventors found matching the criteria." }] };
|
|
103
|
+
}
|
|
104
|
+
const lines = result.inventors.map((inv) => {
|
|
105
|
+
const loc = [inv.inventorCity, inv.inventorState, inv.inventorCountry].filter(Boolean).join(", ");
|
|
106
|
+
return `${inv.inventorFirstName} ${inv.inventorLastName} — ${loc || "Location unknown"} (${inv.patentCount} patent(s))`;
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: "text",
|
|
112
|
+
text: `Found ${result.total.toLocaleString()} inventor(s). Showing ${result.inventors.length}:\n${lines.join("\n")}`,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "uspto_search_assignees",
|
|
120
|
+
description: "Search for patent assignees (companies, universities, government agencies) by name, state, or country. Shows organization details and patent counts.",
|
|
121
|
+
annotations: { title: "Search Assignees", readOnlyHint: true },
|
|
122
|
+
parameters: z.object({
|
|
123
|
+
organization: z.string().optional().describe("Organization name (e.g. 'Apple', 'Stanford University')"),
|
|
124
|
+
state: z.string().optional().describe("U.S. state abbreviation (e.g. CA, TX)"),
|
|
125
|
+
country: z.string().optional().describe("Country code (e.g. US, CN, JP, DE)"),
|
|
126
|
+
type: z.string().optional().describe("Assignee type: 2=US company, 3=foreign company, 4=US individual, 5=foreign individual, 6=US government, 7=foreign government, 8=country govt, 9=state govt"),
|
|
127
|
+
page: z.number().optional().describe("Page number (default 1)"),
|
|
128
|
+
}),
|
|
129
|
+
execute: async (args) => {
|
|
130
|
+
const result = await searchAssignees({
|
|
131
|
+
organization: args.organization,
|
|
132
|
+
state: args.state,
|
|
133
|
+
country: args.country,
|
|
134
|
+
type: args.type,
|
|
135
|
+
page: args.page,
|
|
136
|
+
});
|
|
137
|
+
if (!result.assignees.length) {
|
|
138
|
+
return { content: [{ type: "text", text: "No assignees found matching the criteria." }] };
|
|
139
|
+
}
|
|
140
|
+
const lines = result.assignees.map((a) => {
|
|
141
|
+
const loc = [a.assigneeCity, a.assigneeState, a.assigneeCountry].filter(Boolean).join(", ");
|
|
142
|
+
const name = a.assigneeOrganization || "(Individual)";
|
|
143
|
+
return `${name} — ${loc || "Location unknown"} (${a.patentCount} patent(s))`;
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
content: [
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
text: `Found ${result.total.toLocaleString()} assignee(s). Showing ${result.assignees.length}:\n${lines.join("\n")}`,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
export { sdkClearCache as clearCache };
|
|
157
|
+
//# sourceMappingURL=uspto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uspto.js","sourceRoot":"","sources":["../../src/modules/uspto.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EA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AI,CAAC,CAAC;gBAC5F,MAAM,IAAI,GAAG,CAAC,CAAC,oBAAoB,IAAI,cAAc,CAAC;gBACtD,OAAO,GAAG,IAAI,MAAM,GAAG,IAAI,kBAAkB,KAAK,CAAC,CAAC,WAAW,aAAa,CAAC;YAC/E,CAAC,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,SAAS,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,yBAAyB,MAAM,CAAC,SAAS,CAAC,MAAM,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;qBACrH;iBACF;aACF,CAAC;QACJ,CAAC;KACF;CACF,CAAC;AAEF,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* World Bank MCP module — international economic comparisons.
|
|
3
|
+
*/
|
|
4
|
+
import type { Tool, InputPrompt } from "fastmcp";
|
|
5
|
+
export declare const name = "world-bank";
|
|
6
|
+
export declare const displayName = "World Bank";
|
|
7
|
+
export declare const description = "International economic indicators for 200+ countries: GDP, population, health spending, life expectancy, trade, inequality";
|
|
8
|
+
export declare const workflow = "wb_indicator for a single country, wb_compare to compare countries, wb_search to find indicator IDs";
|
|
9
|
+
export declare const tips = "Countries: US, GB, DE, JP, CN, IN, BR. Indicators: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (population), SP.DYN.LE00.IN (life expectancy)";
|
|
10
|
+
export declare const reference: {
|
|
11
|
+
popularIndicators: Record<string, string>;
|
|
12
|
+
docs: {
|
|
13
|
+
"API Docs": string;
|
|
14
|
+
"Indicator List": string;
|
|
15
|
+
"Country Codes": string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const tools: Tool<any, any>[];
|
|
19
|
+
export declare const prompts: InputPrompt<any, any>[];
|
|
20
|
+
export { clearCache } from "../sdk/world-bank.js";
|
|
21
|
+
//# sourceMappingURL=world-bank.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-bank.d.ts","sourceRoot":"","sources":["../../src/modules/world-bank.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKjD,eAAO,MAAM,IAAI,eAAe,CAAC;AACjC,eAAO,MAAM,WAAW,eAAe,CAAC;AACxC,eAAO,MAAM,WAAW,+HAA+H,CAAC;AACxJ,eAAO,MAAM,QAAQ,wGAAwG,CAAC;AAC9H,eAAO,MAAM,IAAI,wIAAwI,CAAC;AAE1J,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC;AAIF,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EA8FjC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAc1C,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* World Bank MCP module — international economic comparisons.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { getIndicator, compareCountries, searchIndicators, listCountries, POPULAR_INDICATORS } from "../sdk/world-bank.js";
|
|
6
|
+
// ─── Metadata ────────────────────────────────────────────────────────
|
|
7
|
+
export const name = "world-bank";
|
|
8
|
+
export const displayName = "World Bank";
|
|
9
|
+
export const description = "International economic indicators for 200+ countries: GDP, population, health spending, life expectancy, trade, inequality";
|
|
10
|
+
export const workflow = "wb_indicator for a single country, wb_compare to compare countries, wb_search to find indicator IDs";
|
|
11
|
+
export const tips = "Countries: US, GB, DE, JP, CN, IN, BR. Indicators: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (population), SP.DYN.LE00.IN (life expectancy)";
|
|
12
|
+
export const reference = {
|
|
13
|
+
popularIndicators: POPULAR_INDICATORS,
|
|
14
|
+
docs: {
|
|
15
|
+
"API Docs": "https://datahelpdesk.worldbank.org/knowledgebase/articles/889392",
|
|
16
|
+
"Indicator List": "https://data.worldbank.org/indicator",
|
|
17
|
+
"Country Codes": "https://datahelpdesk.worldbank.org/knowledgebase/articles/898590",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
// ─── Tools ───────────────────────────────────────────────────────────
|
|
21
|
+
export const tools = [
|
|
22
|
+
{
|
|
23
|
+
name: "wb_indicator",
|
|
24
|
+
description: "Get a World Bank indicator for a country.\nPopular: NY.GDP.MKTP.CD (GDP), SP.DYN.LE00.IN (life expectancy), SH.XPD.CHEX.PC.CD (health spend/capita), SL.UEM.TOTL.ZS (unemployment)",
|
|
25
|
+
annotations: { title: "World Bank: Get Indicator", readOnlyHint: true },
|
|
26
|
+
parameters: z.object({
|
|
27
|
+
indicator: z.string().describe("Indicator code, e.g. 'NY.GDP.MKTP.CD'"),
|
|
28
|
+
country: z.string().optional().describe("ISO2 code: US, GB, DE, JP, CN. Default: US"),
|
|
29
|
+
date_range: z.string().optional().describe("Year range: '2015:2024' or single year '2024'. Default: last 10 years"),
|
|
30
|
+
}),
|
|
31
|
+
execute: async ({ indicator, country, date_range }) => {
|
|
32
|
+
const now = new Date().getFullYear();
|
|
33
|
+
const result = await getIndicator(indicator, {
|
|
34
|
+
country: country ?? "US",
|
|
35
|
+
dateRange: date_range ?? `${now - 10}:${now}`,
|
|
36
|
+
});
|
|
37
|
+
if (!result.data.length)
|
|
38
|
+
return `No data for indicator ${indicator} in ${country ?? "US"}.`;
|
|
39
|
+
const valid = result.data.filter(d => d.value !== null);
|
|
40
|
+
return JSON.stringify({
|
|
41
|
+
summary: `${result.data[0]?.indicator?.value ?? indicator}: ${valid.length} data points for ${result.data[0]?.country?.value ?? country}`,
|
|
42
|
+
indicator: result.data[0]?.indicator,
|
|
43
|
+
country: result.data[0]?.country,
|
|
44
|
+
total: result.total,
|
|
45
|
+
data: valid.map(d => ({ year: d.date, value: d.value })),
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "wb_compare",
|
|
51
|
+
description: "Compare a World Bank indicator across multiple countries.\nGreat for 'How does US compare to...' questions.",
|
|
52
|
+
annotations: { title: "World Bank: Compare Countries", readOnlyHint: true },
|
|
53
|
+
parameters: z.object({
|
|
54
|
+
indicator: z.string().describe("Indicator code"),
|
|
55
|
+
countries: z.string().describe("Semicolon-separated ISO2 codes: 'US;GB;DE;JP;CN'"),
|
|
56
|
+
date_range: z.string().optional().describe("Year range: '2015:2024'. Default: last 5 years"),
|
|
57
|
+
}),
|
|
58
|
+
execute: async ({ indicator, countries, date_range }) => {
|
|
59
|
+
const now = new Date().getFullYear();
|
|
60
|
+
const countryList = countries.split(/[;,]/).map((c) => c.trim()).filter(Boolean);
|
|
61
|
+
const result = await compareCountries(indicator, countryList, {
|
|
62
|
+
dateRange: date_range ?? `${now - 5}:${now}`,
|
|
63
|
+
});
|
|
64
|
+
if (!result.data.length)
|
|
65
|
+
return `No data for ${indicator} across ${countries}.`;
|
|
66
|
+
// Group by country
|
|
67
|
+
const byCountry = {};
|
|
68
|
+
for (const d of result.data) {
|
|
69
|
+
const key = d.countryiso3code || d.country?.value || "?";
|
|
70
|
+
if (!byCountry[key])
|
|
71
|
+
byCountry[key] = [];
|
|
72
|
+
byCountry[key].push({ year: d.date, value: d.value });
|
|
73
|
+
}
|
|
74
|
+
return JSON.stringify({
|
|
75
|
+
summary: `${result.data[0]?.indicator?.value ?? indicator} comparison across ${Object.keys(byCountry).length} countries`,
|
|
76
|
+
indicator: result.data[0]?.indicator,
|
|
77
|
+
countries: byCountry,
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "wb_search",
|
|
83
|
+
description: "Search World Bank indicators by keyword.\nExamples: 'GDP', 'health expenditure', 'life expectancy', 'CO2 emissions'",
|
|
84
|
+
annotations: { title: "World Bank: Search Indicators", readOnlyHint: true },
|
|
85
|
+
parameters: z.object({
|
|
86
|
+
query: z.string().describe("Keywords to search for"),
|
|
87
|
+
}),
|
|
88
|
+
execute: async ({ query }) => {
|
|
89
|
+
const results = await searchIndicators(query, 30);
|
|
90
|
+
if (!results.length)
|
|
91
|
+
return `No indicators found for "${query}".`;
|
|
92
|
+
return JSON.stringify({
|
|
93
|
+
summary: `${results.length} indicators matching "${query}"`,
|
|
94
|
+
indicators: results.map(i => ({ id: i.id, name: i.name, source: i.source?.value })),
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "wb_countries",
|
|
100
|
+
description: "List World Bank countries with region, income level, and capital city.",
|
|
101
|
+
annotations: { title: "World Bank: List Countries", readOnlyHint: true },
|
|
102
|
+
parameters: z.object({}),
|
|
103
|
+
execute: async () => {
|
|
104
|
+
const countries = await listCountries();
|
|
105
|
+
return JSON.stringify({
|
|
106
|
+
summary: `${countries.length} countries`,
|
|
107
|
+
countries: countries.map(c => ({
|
|
108
|
+
code: c.iso2Code, name: c.name, region: c.region?.value,
|
|
109
|
+
income: c.incomeLevel?.value, capital: c.capitalCity,
|
|
110
|
+
})),
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
export const prompts = [
|
|
116
|
+
{
|
|
117
|
+
name: "international_comparison",
|
|
118
|
+
description: "Compare the U.S. to peer nations on key economic and social indicators.",
|
|
119
|
+
load: async () => "Use wb_compare to compare the U.S. (US) with major economies (GB, DE, JP, CN, CA, FR) on these indicators:\n\n" +
|
|
120
|
+
"1. NY.GDP.PCAP.CD — GDP per capita\n" +
|
|
121
|
+
"2. SH.XPD.CHEX.PC.CD — Health expenditure per capita\n" +
|
|
122
|
+
"3. SP.DYN.LE00.IN — Life expectancy at birth\n" +
|
|
123
|
+
"4. SL.UEM.TOTL.ZS — Unemployment rate\n" +
|
|
124
|
+
"5. GC.DOD.TOTL.GD.ZS — Government debt as % of GDP\n" +
|
|
125
|
+
"6. FP.CPI.TOTL.ZG — Inflation rate\n\n" +
|
|
126
|
+
"Use date range last 5 years. Present as a comparison table. Note where the U.S. ranks among peers and highlight any outliers.",
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
export { clearCache } from "../sdk/world-bank.js";
|
|
130
|
+
//# sourceMappingURL=world-bank.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-bank.js","sourceRoot":"","sources":["../../src/modules/world-bank.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE3H,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,4HAA4H,CAAC;AACxJ,MAAM,CAAC,MAAM,QAAQ,GAAG,qGAAqG,CAAC;AAC9H,MAAM,CAAC,MAAM,IAAI,GAAG,qIAAqI,CAAC;AAE1J,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kBAAkB;IACrC,IAAI,EAAE;QACJ,UAAU,EAAE,kEAAkE;QAC9E,gBAAgB,EAAE,sCAAsC;QACxD,eAAe,EAAE,kEAAkE;KACpF;CACF,CAAC;AAEF,wEAAwE;AAExE,MAAM,CAAC,MAAM,KAAK,GAAqB;IACrC;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,oLAAoL;QACjM,WAAW,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,IAAI,EAAE;QACvE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,S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ACtC,wDAAwD;YACxD,gDAAgD;YAChD,yCAAyC;YACzC,sDAAsD;YACtD,wCAAwC;YACxC,+HAA+H;KAClI;CACF,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-cutting analysis prompts — reusable multi-API investigation templates.
|
|
3
|
+
*
|
|
4
|
+
* These prompts span multiple modules and provide step-by-step instructions
|
|
5
|
+
* for common research patterns. Each returns a detailed plan telling the client
|
|
6
|
+
* which tools to call and in what order.
|
|
7
|
+
*
|
|
8
|
+
* Users invoke these from the MCP prompt picker (e.g. "/" menu in VS Code).
|
|
9
|
+
*/
|
|
10
|
+
import type { InputPrompt } from "fastmcp";
|
|
11
|
+
export declare const analysisPrompts: InputPrompt<any, any>[];
|
|
12
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EA85BlD,CAAC"}
|