@cliwant/mcp-sam-gov 1.7.0 → 1.9.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 +5 -5
- package/README.ko.md +5 -5
- package/README.md +8 -7
- package/dist/ecfr.d.ts +14 -0
- package/dist/ecfr.d.ts.map +1 -1
- package/dist/ecfr.js +131 -1
- package/dist/ecfr.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +24 -3
- 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 +9 -0
- package/dist/socrata.js.map +1 -1
- package/dist/usaspending.d.ts +1 -0
- package/dist/usaspending.d.ts.map +1 -1
- package/dist/usaspending.js +8 -1
- package/dist/usaspending.js.map +1 -1
- package/package.json +2 -2
- package/src/ecfr.ts +160 -1
- package/src/server.ts +26 -3
- package/src/socrata.ts +9 -0
- package/src/usaspending.ts +9 -1
package/src/server.ts
CHANGED
|
@@ -102,7 +102,7 @@ import { realpathSync } from "node:fs";
|
|
|
102
102
|
const SERVER_NAME = "mcp-sam-gov";
|
|
103
103
|
// Kept in lockstep with package.json / manifest.json / server.json.
|
|
104
104
|
// Keep in sync with package.json "version" (asserted at release; see CHANGELOG).
|
|
105
|
-
const SERVER_VERSION = "1.
|
|
105
|
+
const SERVER_VERSION = "1.9.0";
|
|
106
106
|
|
|
107
107
|
// ─── Tool input schemas (Zod) ────────────────────────────────────
|
|
108
108
|
|
|
@@ -572,6 +572,22 @@ const EcfrSearchInput = z.object({
|
|
|
572
572
|
|
|
573
573
|
const EcfrListTitlesInput = z.object({});
|
|
574
574
|
|
|
575
|
+
const EcfrGetSectionInput = z.object({
|
|
576
|
+
titleNumber: z
|
|
577
|
+
.number()
|
|
578
|
+
.int()
|
|
579
|
+
.min(1)
|
|
580
|
+
.max(50)
|
|
581
|
+
.describe("CFR title (1–50). e.g. 2 = federal financial assistance (grants), 29 = Labor, 26 = IRS. For FAR/DFARS (title 48) prefer far_clause_lookup."),
|
|
582
|
+
section: z
|
|
583
|
+
.string()
|
|
584
|
+
.describe("The section citation, e.g. '200.1' (2 CFR 200.1) or '52.204-21' — the part number is the pre-dot integer. Charclass-validated (^[0-9]{1,3}\\.[0-9]{1,4}(-[0-9]{1,4})?$)."),
|
|
585
|
+
date: z
|
|
586
|
+
.string()
|
|
587
|
+
.optional()
|
|
588
|
+
.describe("Optional eCFR issue date YYYY-MM-DD; omit to use the title's LATEST issue (disclosed in _meta)."),
|
|
589
|
+
});
|
|
590
|
+
|
|
575
591
|
// FAR / DFARS clause lookup (eCFR versioner full endpoint)
|
|
576
592
|
const FarClauseLookupInput = z.object({
|
|
577
593
|
clauseNumber: z
|
|
@@ -5381,14 +5397,21 @@ export const TOOLS: ToolDef[] = [
|
|
|
5381
5397
|
handler: (input) => fedreg.publicInspection(input),
|
|
5382
5398
|
}),
|
|
5383
5399
|
|
|
5384
|
-
// ━━━ eCFR (
|
|
5400
|
+
// ━━━ eCFR (6) ━━━
|
|
5385
5401
|
defineTool({
|
|
5386
5402
|
name: "ecfr_search",
|
|
5387
5403
|
description:
|
|
5388
|
-
"Full-text search across the entire CFR (Code of Federal Regulations). Use for
|
|
5404
|
+
"Full-text search across the entire CFR (Code of Federal Regulations). Use for DISCOVERY — pass titleNumber=48 for FAR (Federal Acquisition Regulation), titleNumber=2 for federal financial assistance, etc. Returns a ranked EXCERPT (snippet, not full text) + section path + ecfrUrl per hit. To then read the COMPLETE text of a hit: for a FAR/DFARS clause (title 48) use far_clause_lookup (adds prescription + revision); for any other title's section use ecfr_get_section; or open the ecfrUrl.",
|
|
5389
5405
|
inputSchema: EcfrSearchInput,
|
|
5390
5406
|
handler: (input) => ecfr.search(input),
|
|
5391
5407
|
}),
|
|
5408
|
+
defineTool({
|
|
5409
|
+
name: "ecfr_get_section",
|
|
5410
|
+
description:
|
|
5411
|
+
"Get the FULL in-force text of ONE CFR section by citation (the companion to ecfr_search, which returns only snippets). Input titleNumber (1–50) + section (e.g. '200.1' → 2 CFR 200.1, uniform grants guidance; '1601.1' → 29 CFR labor) + optional issue date (default = the title's latest). Returns { citation, alternateReference, heading, fullText, issueDate, ecfrUrl }. ★For a FAR/DFARS clause (title 48) prefer far_clause_lookup — it adds the prescription, revision, and FAR-overhaul-risk this generic tool does not; use ecfr_get_section for the OTHER 49 titles (grants/labor/IRS/SBA/…). HONESTY: text is the eCFR's own, de-XMLed (no fabrication); a nonexistent section ⇒ not_found (never a fake/wrong section); the resolved issue date is disclosed (the title's latest is a moving target); a bad section format ⇒ invalid_input (SSRF charclass); an outage ⇒ throws. Keyless.",
|
|
5412
|
+
inputSchema: EcfrGetSectionInput,
|
|
5413
|
+
handler: (input) => ecfr.getSection(input),
|
|
5414
|
+
}),
|
|
5392
5415
|
defineTool({
|
|
5393
5416
|
name: "ecfr_list_titles",
|
|
5394
5417
|
description:
|
package/src/socrata.ts
CHANGED
|
@@ -130,6 +130,15 @@ export const SOCRATA_DOMAINS = [
|
|
|
130
130
|
"data.pa.gov", // PA — e.g. mcba-yywm
|
|
131
131
|
"data.mo.gov", // MO — e.g. gfq7-aa86
|
|
132
132
|
"data.delaware.gov", // DE — e.g. 5zy2-grhr
|
|
133
|
+
// ── SLED city/county tier (loop cycle 1, 2026-07-18; host-scoped catalog +
|
|
134
|
+
// /resource/<4x4>.json 200 bare-array live-verified; all .gov; B2G
|
|
135
|
+
// procurement/vendor/contract data — the fragmented local layer above the
|
|
136
|
+
// state portals). ─────────────────────────────────────────────────────
|
|
137
|
+
"data.austintexas.gov", // Austin TX (city) — e.g. 3ebq-e9iz (Purchase Orders)
|
|
138
|
+
"data.kingcounty.gov", // King County WA — e.g. dqit-zt74 (Procurement Contracts)
|
|
139
|
+
"data.montgomerycountymd.gov", // Montgomery County MD — e.g. vmu2-pnrc (Contracts)
|
|
140
|
+
"data.mesaaz.gov", // Mesa AZ (city) — e.g. j7s9-qiuq (Vendor Payments)
|
|
141
|
+
"data.cambridgema.gov", // Cambridge MA (city) — e.g. gp98-ja4f (Contracts bid list)
|
|
133
142
|
"opendata.usac.org", // USAC E-rate (.org, m6) — e.g. avi8-svp9
|
|
134
143
|
] as const;
|
|
135
144
|
|
package/src/usaspending.ts
CHANGED
|
@@ -2112,6 +2112,11 @@ export async function getAgencyProfile(toptierCode: string) {
|
|
|
2112
2112
|
website: json.website,
|
|
2113
2113
|
subtierAgencyCount: json.subtier_agency_count,
|
|
2114
2114
|
congressionalJustificationUrl: json.congressional_justification_url,
|
|
2115
|
+
// #4 (agent-eval 2026-07-18): this endpoint carries NO spending total, and an
|
|
2116
|
+
// agent asked "how much did agency X obligate?" dead-ends here. Point it to
|
|
2117
|
+
// where obligations actually live (account-level vs award-level vs contracts).
|
|
2118
|
+
spendingNote:
|
|
2119
|
+
"This profile has NO obligation/spending figure. For this agency's obligations use: usas_get_agency_awards_summary(toptierCode) = AWARD-level obligations for a fiscal year; usas_list_toptier_agencies → this agency's `obligatedAmount` = ACCOUNT-level total (all spending, higher than award-level). For CONTRACTS-only, usas_spending_over_time / usas_search_*_spending by the agency's canonical name.",
|
|
2115
2120
|
};
|
|
2116
2121
|
}
|
|
2117
2122
|
|
|
@@ -2169,6 +2174,7 @@ export async function getAgencyAwardsSummary(args: {
|
|
|
2169
2174
|
filtersApplied: ["toptierCode", "fiscalYear"],
|
|
2170
2175
|
notes: [
|
|
2171
2176
|
"SCOPE: `obligations` and `transactionCount` cover ALL award types (contracts, grants, direct payments incl. benefits, loans) for this agency — NOT prime contracts only. For a benefit-heavy agency (VA/SSA/HHS) direct benefit payments DOMINATE this figure (VA FY2024: ~$238B all-awards vs ~$67B prime contract awards A/B/C/D); for a procurement-heavy agency (DoD/DHS) obligations closely tracks contract spending. For the CONTRACTS-only obligation use usas_spending_over_time (contractObligations) or usas_search_*_spending — those filter by the agency's canonical NAME, so first resolve it from this toptierCode via usas_get_agency_profile (→ name).",
|
|
2177
|
+
"LEVEL: this is AWARD-level obligations (award transactions). It is LOWER than the agency's ACCOUNT-LEVEL total in usas_list_toptier_agencies.obligatedAmount, which counts ALL obligations, not just awards (e.g. VA ~$205B award-level here vs ~$298B account-level there) — pick the one your question means.",
|
|
2172
2178
|
],
|
|
2173
2179
|
});
|
|
2174
2180
|
}
|
|
@@ -2842,7 +2848,9 @@ export async function listToptierAgencies(args: { limit?: number }) {
|
|
|
2842
2848
|
totalAvailable: results.length,
|
|
2843
2849
|
limitHonored: false,
|
|
2844
2850
|
extraNotes: [
|
|
2845
|
-
"The toptier_agencies endpoint returns the COMPLETE list of ~111 toptier agencies regardless of the `limit` value (limit is ignored upstream).",
|
|
2851
|
+
"The toptier_agencies endpoint returns the COMPLETE list of ~111 toptier agencies regardless of the `limit` value (limit is ignored upstream) — the returned count IS the total.",
|
|
2852
|
+
"The list is ordered ALPHABETICALLY by name, NOT by spending — for 'top N agencies by obligation', sort the returned rows by obligatedAmount client-side (there is no server-side ranking).",
|
|
2853
|
+
"`obligatedAmount` is each agency's ACCOUNT-LEVEL total obligations for its active fiscal year (ALL spending). This is HIGHER than usas_get_agency_awards_summary.obligations, which counts AWARD transactions only (e.g. VA ~$298B account-level vs ~$205B award-level) — do not conflate the two.",
|
|
2846
2854
|
],
|
|
2847
2855
|
}),
|
|
2848
2856
|
// P5 provenance — threaded ONLY when NON-live ⇒ live stays byte-identical.
|