@cliwant/mcp-sam-gov 1.14.0 → 1.15.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.ja.md +2 -1
- package/README.ko.md +2 -1
- package/README.md +4 -2
- package/dist/arcgis-feature.d.ts.map +1 -1
- package/dist/arcgis-feature.js +8 -0
- package/dist/arcgis-feature.js.map +1 -1
- package/dist/bonfire.d.ts +1 -1
- package/dist/bonfire.d.ts.map +1 -1
- package/dist/bonfire.js +15 -11
- package/dist/bonfire.js.map +1 -1
- package/dist/data-map.d.ts +43 -0
- package/dist/data-map.d.ts.map +1 -0
- package/dist/data-map.js +289 -0
- package/dist/data-map.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +46 -11
- package/dist/server.js.map +1 -1
- package/dist/socrata.d.ts +1 -1
- package/dist/socrata.d.ts.map +1 -1
- package/dist/socrata.js +46 -1
- package/dist/socrata.js.map +1 -1
- package/package.json +1 -1
- package/src/arcgis-feature.ts +8 -0
- package/src/bonfire.ts +15 -11
- package/src/data-map.ts +329 -0
- package/src/server.ts +51 -10
- package/src/socrata.ts +47 -1
package/dist/data-map.js
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State & local data map — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* These entries are exported for:
|
|
5
|
+
* (a) the MCP resource samgov://data-map/state-local (resources/read)
|
|
6
|
+
* (b) consistency tests (SKILL.md table must agree on domain/id/rows)
|
|
7
|
+
*
|
|
8
|
+
* Keep verified row counts and notes current here only; SKILL.md table and
|
|
9
|
+
* the resource content are generated from this array.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Verified 2026-09-21 — all keyless.
|
|
13
|
+
*/
|
|
14
|
+
export const DATA_MAP_ENTRIES = [
|
|
15
|
+
// ── State-level ──────────────────────────────────────────────────────────
|
|
16
|
+
{
|
|
17
|
+
state: "VA",
|
|
18
|
+
jurisdiction: "Virginia",
|
|
19
|
+
dataLabel: "eVA PO line items 2023",
|
|
20
|
+
tool: "ckan_query",
|
|
21
|
+
keyArgs: "host=data.virginia.gov, resourceId=3c7f1bde-35b0-4fbf-b89c-978a19124d53",
|
|
22
|
+
rows: 1693227,
|
|
23
|
+
approximate: false,
|
|
24
|
+
notNote: "the live eVA portal (login-gated)",
|
|
25
|
+
extra: "Years 2016–2026 have separate resourceIds; ckan_discover_datasets host=data.virginia.gov q=eVA procurement lists them (2024=25a59527, 2025=b8dc22a8, 2026=76f6831d)",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
state: "MA",
|
|
29
|
+
jurisdiction: "Massachusetts",
|
|
30
|
+
dataLabel: "Comptroller vendor payments (CTHRU)",
|
|
31
|
+
tool: "socrata_query",
|
|
32
|
+
keyArgs: "domain=cthru.data.socrata.com, datasetId=pegc-naaa",
|
|
33
|
+
rows: 49000000,
|
|
34
|
+
approximate: true,
|
|
35
|
+
notNote: "an award or bid register; these are payment transactions",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
state: "NJ",
|
|
39
|
+
jurisdiction: "New Jersey",
|
|
40
|
+
dataLabel: "YourMoney agency purchasing by vendor",
|
|
41
|
+
tool: "socrata_query",
|
|
42
|
+
keyArgs: "domain=data.nj.gov, datasetId=ubnu-tqu7",
|
|
43
|
+
rows: 660425,
|
|
44
|
+
approximate: false,
|
|
45
|
+
notNote: "a solicitation or bid register; agency expenditure rows",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
state: "NY",
|
|
49
|
+
jurisdiction: "New York",
|
|
50
|
+
dataLabel: "State authority procurement contracts",
|
|
51
|
+
tool: "socrata_query",
|
|
52
|
+
keyArgs: "domain=data.ny.gov, datasetId=ehig-g5x3",
|
|
53
|
+
rows: 275763,
|
|
54
|
+
approximate: false,
|
|
55
|
+
notNote: "all NYS agencies (authorities only) and NOT active solicitations",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
state: "NY",
|
|
59
|
+
jurisdiction: "New York",
|
|
60
|
+
dataLabel: "MTA procurement contracts",
|
|
61
|
+
tool: "socrata_query",
|
|
62
|
+
keyArgs: "domain=data.ny.gov, datasetId=twsw-2mqa",
|
|
63
|
+
rows: 107503,
|
|
64
|
+
approximate: false,
|
|
65
|
+
notNote: "a live MTA bid portal; MTA historical contract records",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
state: "WA",
|
|
69
|
+
jurisdiction: "Washington",
|
|
70
|
+
dataLabel: "Agency contract register",
|
|
71
|
+
tool: "socrata_query",
|
|
72
|
+
keyArgs: "domain=data.wa.gov, datasetId=s8d5-pj78",
|
|
73
|
+
rows: 79329,
|
|
74
|
+
approximate: false,
|
|
75
|
+
notNote: "a solicitation or bid feed; awarded contract records",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
state: "WA",
|
|
79
|
+
jurisdiction: "Washington",
|
|
80
|
+
dataLabel: "Master-contract sales by vendor/customer",
|
|
81
|
+
tool: "socrata_query",
|
|
82
|
+
keyArgs: "domain=data.wa.gov, datasetId=n8q6-4twj",
|
|
83
|
+
rows: 245831,
|
|
84
|
+
approximate: false,
|
|
85
|
+
notNote: "open bids; sales reported off statewide master contracts",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
state: "MT",
|
|
89
|
+
jurisdiction: "Montana",
|
|
90
|
+
dataLabel: "DOA contracts awarded",
|
|
91
|
+
tool: "tableau_view_csv",
|
|
92
|
+
keyArgs: "view=mt_contracts_awarded",
|
|
93
|
+
rows: 4554,
|
|
94
|
+
approximate: true,
|
|
95
|
+
notNote: "a bid portal; awarded records only, freshness set by publisher",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
state: "SD",
|
|
99
|
+
jurisdiction: "South Dakota",
|
|
100
|
+
dataLabel: "Open Checkbook vendor payments",
|
|
101
|
+
tool: "open_checkbook_search",
|
|
102
|
+
keyArgs: "portal=sd",
|
|
103
|
+
rows: 741000,
|
|
104
|
+
approximate: true,
|
|
105
|
+
notNote: "an award register; only ~3 most-recent FYs, exact-match filters",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
state: "IL",
|
|
109
|
+
jurisdiction: "Illinois",
|
|
110
|
+
dataLabel: "CDB capital project future bids",
|
|
111
|
+
tool: "socrata_query",
|
|
112
|
+
keyArgs: "domain=data.illinois.gov, datasetId=6rb8-ntpm",
|
|
113
|
+
rows: 48,
|
|
114
|
+
approximate: false,
|
|
115
|
+
notNote: "a comprehensive solicitation feed; only ~48 upcoming CDB capital bids",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
state: "IL",
|
|
119
|
+
jurisdiction: "Illinois",
|
|
120
|
+
dataLabel: "IDHR certified eligible bidders",
|
|
121
|
+
tool: "socrata_query",
|
|
122
|
+
keyArgs: "domain=data.illinois.gov, datasetId=w8h2-q8hu",
|
|
123
|
+
rows: 7848,
|
|
124
|
+
approximate: false,
|
|
125
|
+
notNote: "a bid or award register; vendor-eligibility directory only",
|
|
126
|
+
},
|
|
127
|
+
// ── Texas — verified 2026-09-21 ──────────────────────────────────────────
|
|
128
|
+
{
|
|
129
|
+
state: "TX",
|
|
130
|
+
jurisdiction: "Texas",
|
|
131
|
+
dataLabel: "TxDOT current lettings (★live bid-line items)",
|
|
132
|
+
tool: "socrata_query",
|
|
133
|
+
keyArgs: "domain=data.texas.gov, datasetId=qh8x-rm8r",
|
|
134
|
+
rows: 8861,
|
|
135
|
+
approximate: false,
|
|
136
|
+
notNote: "rows are bid LINE ITEMS not projects (8,861 rows = 412 distinct project_ids — report project count not row count); TxDOT highway lettings ONLY, not all Texas procurement; rolling window only (past lettings dropped, cannot answer historical questions); ESBD/TxSmartBuy non-TxDOT solicitations are absent",
|
|
137
|
+
extra: "★First live state solicitation feed in this map. Use $select=count(distinct project_id) for open-bid count.",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
state: "TX",
|
|
141
|
+
jurisdiction: "Texas",
|
|
142
|
+
dataLabel: "DIR Cooperative Contract Sales FY2010–FY2025 (archive)",
|
|
143
|
+
tool: "socrata_query",
|
|
144
|
+
keyArgs: "domain=data.texas.gov, datasetId=w64c-ndf7",
|
|
145
|
+
rows: 10749743,
|
|
146
|
+
approximate: false,
|
|
147
|
+
notNote: "bids or awards; purchase line items off DIR cooperative contracts (historical)",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
state: "TX",
|
|
151
|
+
jurisdiction: "Texas",
|
|
152
|
+
dataLabel: "DIR Cooperative & Tele Contract Sales FY2026",
|
|
153
|
+
tool: "socrata_query",
|
|
154
|
+
keyArgs: "domain=data.texas.gov, datasetId=a743-wj72",
|
|
155
|
+
rows: 2077855,
|
|
156
|
+
approximate: false,
|
|
157
|
+
notNote: "historical FY2026 purchase lines (same shape as w64c-ndf7); not bids",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
state: "TX",
|
|
161
|
+
jurisdiction: "Texas",
|
|
162
|
+
dataLabel: "DIR Current Active Cooperative Contracts",
|
|
163
|
+
tool: "socrata_query",
|
|
164
|
+
keyArgs: "domain=data.texas.gov, datasetId=vipt-h4ye",
|
|
165
|
+
rows: 5167,
|
|
166
|
+
approximate: false,
|
|
167
|
+
notNote: "a solicitation feed; active cooperative contract register (not TxDOT lettings)",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
state: "TX",
|
|
171
|
+
jurisdiction: "Texas",
|
|
172
|
+
dataLabel: "TCEQ Current Contracts & Purchase Orders",
|
|
173
|
+
tool: "socrata_query",
|
|
174
|
+
keyArgs: "domain=data.texas.gov, datasetId=svjm-sdfz",
|
|
175
|
+
rows: 2067,
|
|
176
|
+
approximate: false,
|
|
177
|
+
notNote: "statewide; one agency (TCEQ) only",
|
|
178
|
+
},
|
|
179
|
+
// ── Maryland — verified 2026-09-21 ───────────────────────────────────────
|
|
180
|
+
{
|
|
181
|
+
state: "MD",
|
|
182
|
+
jurisdiction: "Maryland",
|
|
183
|
+
dataLabel: "eMaryland Marketplace (eMMA) bids — FY2018 exemplar",
|
|
184
|
+
tool: "socrata_query",
|
|
185
|
+
keyArgs: "domain=opendata.maryland.gov, datasetId=pgna-cxjh",
|
|
186
|
+
rows: 107303,
|
|
187
|
+
approximate: false,
|
|
188
|
+
notNote: "rows are bid LINE ITEMS not bids — FY2018 is 107,303 rows for only 3,067 bids (35× overcount); always use $select=count(distinct bid_number) for actual bid count. Coverage stops at FY2019 — eMMA migrated to Periscope mid-FY2019; there is no FY2020+ mirror and this dataset cannot answer questions about current Maryland bids",
|
|
189
|
+
extra: "All six FY datasetIds: FY2018=pgna-cxjh (107,303 rows/3,067 bids), FY2017=qkjf-rv4t (64,331/4,943), FY2016=7ang-84wj (45,204/4,818), FY2015=3hzs-sazv (46,895/4,898), FY2014=itax-4ccz (45,551/4,884), FY2019=ttg5-zfzj (4,623/388 — small because eMMA migrated to Periscope mid-year; first row is a sparse placeholder, subsequent rows are complete).",
|
|
190
|
+
},
|
|
191
|
+
// ── Oregon — verified 2026-09-21 ─────────────────────────────────────────
|
|
192
|
+
{
|
|
193
|
+
state: "OR",
|
|
194
|
+
jurisdiction: "Oregon",
|
|
195
|
+
dataLabel: "OregonBuys Purchases and Contracts FY2022–FY2025",
|
|
196
|
+
tool: "socrata_query",
|
|
197
|
+
keyArgs: "domain=data.oregon.gov, datasetId=qyug-f2km",
|
|
198
|
+
rows: 109119,
|
|
199
|
+
approximate: false,
|
|
200
|
+
notNote: "open solicitations — these are issued purchase orders and contracts (not bids). ORPIN was the retired system; OregonBuys is its replacement. qyug-f2km covers sent_date 2021-07-01 → 2025-07-01 (FY2022–FY2025); 92,224 distinct po_nbr",
|
|
201
|
+
extra: "Historical ORPIN datasets (retired system, same domain): Contracts Issued=6e9e-sfc4 (93,846 rows), Contracts Expired=8izy-bwhd (92,755 rows), Statewide Price Agreement Spend=gart-52me (5,224 rows). All keyless.",
|
|
202
|
+
},
|
|
203
|
+
// ── Vermont — verified 2026-09-21 ────────────────────────────────────────
|
|
204
|
+
{
|
|
205
|
+
state: "VT",
|
|
206
|
+
jurisdiction: "Vermont",
|
|
207
|
+
dataLabel: "Purchase Orders with Vendor Information (current FY, live-ish)",
|
|
208
|
+
tool: "socrata_query",
|
|
209
|
+
keyArgs: "domain=data.vermont.gov, datasetId=8ewu-igdm",
|
|
210
|
+
rows: 111271,
|
|
211
|
+
approximate: false,
|
|
212
|
+
notNote: "a bid or award register — issued purchase orders. 39,882 distinct po_id (~2.8 line items per PO). po_date 2025-07-02 → 2026-06-19 (current fiscal year, so this is live-ish state spend, not an archive)",
|
|
213
|
+
},
|
|
214
|
+
// ── Colorado (City of Denver on state portal) — verified 2026-09-21 ──────
|
|
215
|
+
{
|
|
216
|
+
state: "CO",
|
|
217
|
+
jurisdiction: "City of Denver",
|
|
218
|
+
dataLabel: "City of Denver Procurement Transactions (on CO state portal)",
|
|
219
|
+
tool: "socrata_query",
|
|
220
|
+
keyArgs: "domain=data.colorado.gov, datasetId=66zf-qjdd",
|
|
221
|
+
rows: 76357,
|
|
222
|
+
approximate: false,
|
|
223
|
+
notNote: "Colorado STATE procurement — this is City of Denver spend hosted on the Colorado state portal (data.colorado.gov). An agent that reads the domain as the jurisdiction gets this wrong. Updated 2026-09-20.",
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
state: "CO",
|
|
227
|
+
jurisdiction: "City of Denver",
|
|
228
|
+
dataLabel: "City of Denver Checkbook (on CO state portal)",
|
|
229
|
+
tool: "socrata_query",
|
|
230
|
+
keyArgs: "domain=data.colorado.gov, datasetId=wnau-xrqi",
|
|
231
|
+
rows: 154595,
|
|
232
|
+
approximate: false,
|
|
233
|
+
notNote: "Colorado STATE procurement — this is City of Denver checkbook data hosted on the Colorado state portal (data.colorado.gov). An agent that reads the domain as the jurisdiction gets this wrong. Updated 2026-09-20.",
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
/**
|
|
237
|
+
* Format a row count for display.
|
|
238
|
+
*
|
|
239
|
+
* HONESTY: an EXACT count (approximate:false) is printed in full with thousands
|
|
240
|
+
* separators — never rounded. The table header promises a "verified row count",
|
|
241
|
+
* so rounding a measured 1,693,227 to "2M" would overstate it by 18% while still
|
|
242
|
+
* reading as exact. Only an entry explicitly marked `approximate` is rounded, and
|
|
243
|
+
* that form always carries a leading `~` so the reader can tell the two apart.
|
|
244
|
+
*/
|
|
245
|
+
function fmtRows(e) {
|
|
246
|
+
if (e.rows === null)
|
|
247
|
+
return "?";
|
|
248
|
+
if (!e.approximate)
|
|
249
|
+
return e.rows.toLocaleString("en-US");
|
|
250
|
+
// Keep 2 significant figures below 10 units so "~5k" never stands in for a
|
|
251
|
+
// measured 4,554 (a 10% overstatement); 49,000,000 still renders "~49M".
|
|
252
|
+
const scale = (v, suffix) => `${v < 10 ? v.toFixed(1).replace(/\.0$/, "") : String(Math.round(v))}${suffix}`;
|
|
253
|
+
const n = e.rows >= 1000000 ? scale(e.rows / 1000000, "M") :
|
|
254
|
+
e.rows >= 1000 ? scale(e.rows / 1000, "k") :
|
|
255
|
+
String(e.rows);
|
|
256
|
+
return `~${n}`;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Render the state-level entries as a Markdown table.
|
|
260
|
+
* Matches the format in SKILL.md §State & local data map.
|
|
261
|
+
*/
|
|
262
|
+
export function renderStateTableMarkdown() {
|
|
263
|
+
const header = "| Jurisdiction | Data | Tool · key args | Rows | NOT |\n" +
|
|
264
|
+
"|---|---|---|---|---|\n";
|
|
265
|
+
const rows = DATA_MAP_ENTRIES.map((e) => {
|
|
266
|
+
const extra = e.extra ? ` ${e.extra}` : "";
|
|
267
|
+
return `| **${e.jurisdiction}** | ${e.dataLabel} | \`${e.tool}\` ${e.keyArgs} | ${fmtRows(e)} | ${e.notNote}${extra} |`;
|
|
268
|
+
});
|
|
269
|
+
return header + rows.join("\n");
|
|
270
|
+
}
|
|
271
|
+
/** Full resource content: header + state table */
|
|
272
|
+
export function renderDataMapMarkdown() {
|
|
273
|
+
return `# State & local data map
|
|
274
|
+
|
|
275
|
+
Agent-readable lookup: jurisdiction → data type → exact tool call → verified row count → what it is NOT (the most common source of agent error).
|
|
276
|
+
|
|
277
|
+
**State-level open-data sources (verified 2026-09-21, all keyless):**
|
|
278
|
+
|
|
279
|
+
${renderStateTableMarkdown()}
|
|
280
|
+
|
|
281
|
+
**County & city** — use \`socrata_discover_datasets\` to find dataset IDs for: NYC (data.cityofnewyork.us), Chicago (data.cityofchicago.org), Austin TX (data.austintexas.gov), Dallas TX (www.dallasopendata.com), LA (controllerdata.lacity.org), King County WA (data.kingcounty.gov), Cook County IL (datacatalog.cookcountyil.gov), Montgomery County MD (data.montgomerycountymd.gov). For Hennepin County MN and Charlotte-Mecklenburg NC capital project pipelines, use \`arcgis_feature_query\` (hennepin_transportation_cip / charlotte_mecklenburg_cip) — these are CIP pipelines, NOT solicitation or award registers.
|
|
282
|
+
|
|
283
|
+
**State portals with no keyless procurement content (measured absence, not unexplored):**
|
|
284
|
+
- Login-gated or WAF-blocked live-bid portals: CA (Cal eProcure), TX ESBD/TxSmartBuy non-TxDOT (TxDOT lettings ARE available via qh8x-rm8r above), OH, NC, MI, and Periscope-based portals for IL/MA/NJ live bids.
|
|
285
|
+
- Portal exists but carries no procurement datasets: PA (data.pa.gov is live; scoped catalog has 0 bid/vendor/procurement datasets matching). Michigan (data.michigan.gov) was checked 2026-09-21 and carries only NIGP commodity code reference tables (w3u3-uptp 9,333 rows; jv5q-yp8x 235 rows) — not procurement transactions.
|
|
286
|
+
- No state-level open-data portal: FL (data.fl.gov NXDOMAIN), GA (data.georgia.gov NXDOMAIN). These states have no keyless state procurement data source — this is a measured absence, not a connectivity block.
|
|
287
|
+
`;
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=data-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-map.js","sourceRoot":"","sources":["../src/data-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6BH;;GAEG;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qB;IACnC,OAAO;;;;;;EAMP,wBAAwB,EAAE;;;;;;;;CAQ3B,CAAC;AACF,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAUH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EAKb,MAAM,oBAAoB,CAAC;AAqlJ5B,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC;IAO1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE;QAAE,GAAG,EAAE,YAAY,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE,CAAC;AAoBF,eAAO,MAAM,KAAK,EAAE,OAAO,EAo0D1B,CAAC;AA8RF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,OAAO,CAAC,CAkClB;AAyBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CActD;AACD,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,IAAI,CAAC;IACnB,aAAa,EAAE,IAAI,CAAC;CACrB,CAEA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkE7E"}
|
package/dist/server.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
20
20
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
21
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
21
|
+
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
22
22
|
import { z } from "zod";
|
|
23
23
|
import { SamGovClient, daysUntilResponse, applyResponseDeadlineWindow, } from "./sam-gov/index.js";
|
|
24
24
|
import * as usas from "./usaspending.js";
|
|
@@ -86,6 +86,7 @@ import * as keys from "./keys.js";
|
|
|
86
86
|
import { toToolError, ToolErrorCarrier, errorFromResponse } from "./errors.js";
|
|
87
87
|
import * as feedback from "./feedback.js";
|
|
88
88
|
import { checkForUpdate } from "./update-check.js";
|
|
89
|
+
import { renderDataMapMarkdown } from "./data-map.js";
|
|
89
90
|
import { buildMeta, isMetaBundle, withMeta, } from "./meta.js";
|
|
90
91
|
import { pathToFileURL, fileURLToPath } from "node:url";
|
|
91
92
|
import { realpathSync } from "node:fs";
|
|
@@ -93,7 +94,7 @@ import { resolveToolsets, ALL_TOOLSET_NAMES, TOOLSET_HINTS, filterToolsFor, tool
|
|
|
93
94
|
const SERVER_NAME = "mcp-sam-gov";
|
|
94
95
|
// Kept in lockstep with package.json / manifest.json / server.json.
|
|
95
96
|
// Keep in sync with package.json "version" (asserted at release; see CHANGELOG).
|
|
96
|
-
const SERVER_VERSION = "1.
|
|
97
|
+
const SERVER_VERSION = "1.15.0";
|
|
97
98
|
// ─── Tool input schemas (Zod) ────────────────────────────────────
|
|
98
99
|
const SamSearchInput = z.object({
|
|
99
100
|
query: z.string().optional().describe("Free-text title query"),
|
|
@@ -1568,7 +1569,8 @@ const EdgarCompanyConceptInput = z.object({
|
|
|
1568
1569
|
// validated strings (a bad column ⇒ upstream 400 ⇒ invalid_input, surfaced).
|
|
1569
1570
|
const SocrataDomainEnum = z
|
|
1570
1571
|
.enum(socrata.SOCRATA_DOMAINS)
|
|
1571
|
-
.describe("Which allowlisted Socrata portal to query (
|
|
1572
|
+
.describe("Which allowlisted Socrata portal to query (the SSRF host allowlist — no free host). " +
|
|
1573
|
+
"Jurisdiction of non-obvious hosts: cthru.data.socrata.com=MASSACHUSETTS statewide (CTHRU); atlanta.data.socrata.com=Atlanta GA; controllerdata.lacity.org+data.lacity.org=Los Angeles; www.dallasopendata.com=Dallas TX; data.brla.gov=Baton Rouge LA; data.kcmo.org=Kansas City MO; data.cstx.gov=College Station TX; data.weho.org=West Hollywood CA; opendata.usac.org+datahub.usac.org=federal USAC E-rate. data.colorado.gov's procurement data is CITY OF DENVER, not CO state.");
|
|
1572
1574
|
const SocrataQueryInput = z.object({
|
|
1573
1575
|
domain: SocrataDomainEnum,
|
|
1574
1576
|
datasetId: z
|
|
@@ -1621,7 +1623,8 @@ const SocrataDiscoverDatasetsInput = z.object({
|
|
|
1621
1623
|
.string()
|
|
1622
1624
|
.min(1)
|
|
1623
1625
|
.describe("Keyword(s) to find datasets, e.g. 'procurement', 'vendor payments', 'checkbook'."),
|
|
1624
|
-
domain: SocrataDomainEnum.optional().describe("Optional: scope discovery to ONE
|
|
1626
|
+
domain: SocrataDomainEnum.optional().describe("Optional: scope discovery to ONE portal; omit to search all. The catalog does not index every host (USAC returns 0); those stay queryable via socrata_query with a known 4x4. " +
|
|
1627
|
+
"Jurisdiction of non-obvious hosts: cthru.data.socrata.com=MASSACHUSETTS statewide (CTHRU); atlanta.data.socrata.com=Atlanta GA; controllerdata.lacity.org+data.lacity.org=Los Angeles; www.dallasopendata.com=Dallas TX; data.brla.gov=Baton Rouge LA; data.kcmo.org=Kansas City MO; data.cstx.gov=College Station TX; data.weho.org=West Hollywood CA; opendata.usac.org+datahub.usac.org=federal USAC E-rate. data.colorado.gov's procurement data is CITY OF DENVER, not CO state."),
|
|
1625
1628
|
limit: z
|
|
1626
1629
|
.number()
|
|
1627
1630
|
.int()
|
|
@@ -2625,7 +2628,7 @@ const TableauViewCsvInput = z.object({
|
|
|
2625
2628
|
const ArcgisFeatureQueryInput = z.object({
|
|
2626
2629
|
service: z
|
|
2627
2630
|
.enum(arcgisFeature.ARCGIS_SERVICES.map((s) => s.key))
|
|
2628
|
-
.describe("Service key (SSRF allowlist;
|
|
2631
|
+
.describe("Service key (SSRF allowlist; 29 services). DC OCP PASS (solicitations/contracts/purchase_orders/payments). US local govs: Asheville NC, Bellevue WA, Miami-Dade FL×2, Suffolk County NY, Mat-Su AK, Las Vegas NV×2, Baltimore MD, Naperville IL, Worcester MA, Topeka KS (FY2015–23), Hennepin County MN (CIP pipeline), Charlotte-Mecklenburg NC (CIP pipeline); TX/AK/IA/OK DOT bid/award registers. ND DOT flex-funding to local agencies (nddot_flex×4 — NOT vendor contracts)."),
|
|
2629
2632
|
where: z
|
|
2630
2633
|
.string()
|
|
2631
2634
|
.min(1)
|
|
@@ -4913,7 +4916,7 @@ export const TOOLS = [
|
|
|
4913
4916
|
// ━━━ Socrata / SODA — keyless SLED + E-rate open data (2) ━━━ ADR-0004
|
|
4914
4917
|
defineTool({
|
|
4915
4918
|
name: "socrata_query",
|
|
4916
|
-
description: "Query rows from an allowlisted Socrata/SODA open-data portal (keyless; ~a dozen US state portals + USAC E-rate on one identical API — state spend/checkbook/contract/vendor-payment datasets). Input `domain` (curated allowlist enum — the SSRF host guard), `datasetId` (4x4, from socrata_discover_datasets), optional SoQL `select`/`where`/`order`/`q`, `limit` (≤1000, def 100), `offset`, `withTotal` (def true). HONESTY: SODA's row response has no total, so a count(*) companion supplies an exact totalAvailable; if it fails the rows still return with totalAvailable:null + a note (hasMore is then inferred from page-fill, never a false complete). Genuine-empty ⇒ complete:true/total:0; an outage/400/404 THROWS (never a fake empty). Value fields are strings.",
|
|
4919
|
+
description: "Query rows from an allowlisted Socrata/SODA open-data portal (keyless; ~a dozen US state portals + USAC E-rate on one identical API — state spend/checkbook/contract/vendor-payment datasets). State procurement mirrors: NY ehig-g5x3, NJ ubnu-tqu7, WA s8d5-pj78, MA cthru.data.socrata.com pegc-naaa (~49M payment rows). Full map: read resource samgov://data-map/state-local. Input `domain` (curated allowlist enum — the SSRF host guard), `datasetId` (4x4, from socrata_discover_datasets), optional SoQL `select`/`where`/`order`/`q`, `limit` (≤1000, def 100), `offset`, `withTotal` (def true). HONESTY: SODA's row response has no total, so a count(*) companion supplies an exact totalAvailable; if it fails the rows still return with totalAvailable:null + a note (hasMore is then inferred from page-fill, never a false complete). Genuine-empty ⇒ complete:true/total:0; an outage/400/404 THROWS (never a fake empty). Value fields are strings.",
|
|
4917
4920
|
inputSchema: SocrataQueryInput,
|
|
4918
4921
|
handler: (input) => socrata.query(input),
|
|
4919
4922
|
}),
|
|
@@ -4926,7 +4929,7 @@ export const TOOLS = [
|
|
|
4926
4929
|
// ━━━ CKAN datastore_search — keyless SLED open data (2) ━━━ ADR-0006
|
|
4927
4930
|
defineTool({
|
|
4928
4931
|
name: "ckan_query",
|
|
4929
|
-
description: "Query rows from an allowlisted CKAN datastore resource (keyless;
|
|
4932
|
+
description: "Query rows from an allowlisted CKAN datastore resource (keyless; state/city spend/checkbook/procurement/vendor tables on the CKAN Action API). VA eVA PO lines: host=data.virginia.gov resourceId=3c7f1bde-35b0-4fbf-b89c-978a19124d53. Full map: read resource samgov://data-map/state-local. Input `host` (curated allowlist enum — the SSRF host guard: data.ca.gov, data.virginia.gov, data.boston.gov), `resourceId` (36-char lowercase UUID, from ckan_discover_datasets), optional `q` (full-text), `filters` (constrained object {field:value} we JSON.stringify), `sort`, `limit` (≤1000, def 100), `offset`. HONESTY: CKAN's envelope carries a real result.total — the DEFAULT is an EXACT total (exact totalAvailable + hasMore); the rare estimated total (total_was_estimated:true) is disclosed via totalIsEstimated + a note and does NOT drive pagination (it can be above OR below the truth). Genuine-empty ⇒ complete:true/total:0; an outage/404/409 or success:false THROWS (never a fake empty). Values are typed per result.fields[].type.",
|
|
4930
4933
|
inputSchema: CkanQueryInput,
|
|
4931
4934
|
handler: (input) => ckan.query(input),
|
|
4932
4935
|
}),
|
|
@@ -5260,12 +5263,12 @@ export const TOOLS = [
|
|
|
5260
5263
|
}),
|
|
5261
5264
|
// ━━━ Bonfire (Euna) — keyless per-org open-opportunity RSS (SLED bids) ━━━
|
|
5262
5265
|
// SLED bid campaign. Thousands of US state/local govs on Bonfire expose a keyless
|
|
5263
|
-
// RSS of open opportunities. Ships a curated
|
|
5266
|
+
// RSS of open opportunities. Ships a curated 195-org live-verified seed directory
|
|
5264
5267
|
// (Bonfire's authoritative org API is auth-gated → out of bounds). Fixed-suffix
|
|
5265
5268
|
// SSRF (.bonfirehub.com). RSS = the complete open set (totalAvailable honest).
|
|
5266
5269
|
defineTool({
|
|
5267
5270
|
name: "bonfire_list_organizations",
|
|
5268
|
-
description: "List US governments on the Bonfire (Euna) eProcurement platform — the directory for bonfire_search_opportunities (keyless). Bonfire hosts thousands of US state/local governments' open-bid portals, each with a keyless RSS feed. Filter the curated seed by `state` (2-letter) / `query` (case-insensitive name substring); `limit`(1..200)/`offset`. Output: { organizations:[{ org, name, state }] }. Feed a result's `org` to bonfire_search_opportunities. ★HONESTY: this is a CURATED, live-verified SEED of
|
|
5271
|
+
description: "List US governments on the Bonfire (Euna) eProcurement platform — the directory for bonfire_search_opportunities (keyless). Bonfire hosts thousands of US state/local governments' open-bid portals, each with a keyless RSS feed. Filter the curated seed by `state` (2-letter) / `query` (case-insensitive name substring); `limit`(1..200)/`offset`. Output: { organizations:[{ org, name, state }] }. Feed a result's `org` to bonfire_search_opportunities. ★HONESTY: this is a CURATED, live-verified SEED of 195 US orgs — Bonfire has NO keyless org-list API (its authoritative directory is auth-gated, out of bounds), and Euna markets up to ~900 US orgs, so the seed is PARTIAL (disclosed in _meta); probe `{slug}.bonfirehub.com/opportunities/rss` to extend. totalAvailable = the exact filtered seed count.",
|
|
5269
5272
|
inputSchema: BonfireListOrganizationsInput,
|
|
5270
5273
|
handler: (input) => bonfire.listOrganizations(input),
|
|
5271
5274
|
}),
|
|
@@ -5679,7 +5682,7 @@ async function main() {
|
|
|
5679
5682
|
// not using the default (all). The default instructions stay byte-identical.
|
|
5680
5683
|
// B2: unknown toolset names are reported here (not only stderr) because
|
|
5681
5684
|
// stderr is invisible in Claude Desktop.
|
|
5682
|
-
const BASE_INSTRUCTIONS = "This server wraps US government open data (keyless-first). If a tool result looks wrong, a tool stays broken, or the user wants a capability this server lacks, help improve it: call the `feedback` tool — or use the `report` URL present on schema_drift / upstream_unavailable errors — to get a PREFILLED GitHub issue link, and offer it to the user to open and submit. Nothing is posted automatically; the user submits. Never include secrets or personal data in a report (the repo is public).";
|
|
5685
|
+
const BASE_INSTRUCTIONS = "This server wraps US government open data (keyless-first). State/local dataset IDs (Socrata, CKAN, etc.) are listed in the MCP resource samgov://data-map/state-local. If a tool result looks wrong, a tool stays broken, or the user wants a capability this server lacks, help improve it: call the `feedback` tool — or use the `report` URL present on schema_drift / upstream_unavailable errors — to get a PREFILLED GitHub issue link, and offer it to the user to open and submit. Nothing is posted automatically; the user submits. Never include secrets or personal data in a report (the repo is public).";
|
|
5683
5686
|
let serverInstructions;
|
|
5684
5687
|
if (isAllTools && tsResult.unknown.length === 0) {
|
|
5685
5688
|
// Default: byte-identical to main.
|
|
@@ -5708,7 +5711,7 @@ async function main() {
|
|
|
5708
5711
|
serverInstructions = `${BASE_INSTRUCTIONS} ${parts.join(" ")}`;
|
|
5709
5712
|
}
|
|
5710
5713
|
const server = new Server({ name: SERVER_NAME, version: SERVER_VERSION }, {
|
|
5711
|
-
capabilities: { tools: {} },
|
|
5714
|
+
capabilities: { tools: {}, resources: {} },
|
|
5712
5715
|
// Surfaced to the agent at initialize. Tells it how to route real-usage
|
|
5713
5716
|
// friction back to the project WITHOUT the server ever posting anything.
|
|
5714
5717
|
instructions: serverInstructions,
|
|
@@ -5723,6 +5726,38 @@ async function main() {
|
|
|
5723
5726
|
})),
|
|
5724
5727
|
};
|
|
5725
5728
|
});
|
|
5729
|
+
// ── MCP Resources: state & local data map ──────────────────────────────
|
|
5730
|
+
const DATA_MAP_URI = "samgov://data-map/state-local";
|
|
5731
|
+
const DATA_MAP_NAME = "State & local data map";
|
|
5732
|
+
const DATA_MAP_DESCRIPTION = "Jurisdiction → verified tool call → row count for every allowlisted state/local Socrata, CKAN, Tableau and Open Checkbook dataset.";
|
|
5733
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
5734
|
+
return {
|
|
5735
|
+
resources: [
|
|
5736
|
+
{
|
|
5737
|
+
uri: DATA_MAP_URI,
|
|
5738
|
+
name: DATA_MAP_NAME,
|
|
5739
|
+
description: DATA_MAP_DESCRIPTION,
|
|
5740
|
+
mimeType: "text/markdown",
|
|
5741
|
+
},
|
|
5742
|
+
],
|
|
5743
|
+
};
|
|
5744
|
+
});
|
|
5745
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (req) => {
|
|
5746
|
+
const { uri } = req.params;
|
|
5747
|
+
if (uri !== DATA_MAP_URI) {
|
|
5748
|
+
throw new Error(`Unknown resource: ${uri}`);
|
|
5749
|
+
}
|
|
5750
|
+
return {
|
|
5751
|
+
contents: [
|
|
5752
|
+
{
|
|
5753
|
+
uri: DATA_MAP_URI,
|
|
5754
|
+
mimeType: "text/markdown",
|
|
5755
|
+
text: renderDataMapMarkdown(),
|
|
5756
|
+
},
|
|
5757
|
+
],
|
|
5758
|
+
};
|
|
5759
|
+
});
|
|
5760
|
+
// ── end MCP Resources ──────────────────────────────────────────────────
|
|
5726
5761
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
5727
5762
|
const { name, arguments: args } = req.params;
|
|
5728
5763
|
// Check if the tool exists but is not loaded in the current toolset profile.
|