usaspending-mcp 0.1.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 +164 -0
- package/dist/api/client.d.ts +45 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +145 -0
- package/dist/api/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +17 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/awards.d.ts +10 -0
- package/dist/tools/awards.d.ts.map +1 -0
- package/dist/tools/awards.js +308 -0
- package/dist/tools/awards.js.map +1 -0
- package/dist/tools/recipients.d.ts +10 -0
- package/dist/tools/recipients.d.ts.map +1 -0
- package/dist/tools/recipients.js +148 -0
- package/dist/tools/recipients.js.map +1 -0
- package/dist/tools/references.d.ts +10 -0
- package/dist/tools/references.d.ts.map +1 -0
- package/dist/tools/references.js +80 -0
- package/dist/tools/references.js.map +1 -0
- package/dist/tools/search.d.ts +10 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +230 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/types/filters.d.ts +87 -0
- package/dist/types/filters.d.ts.map +1 -0
- package/dist/types/filters.js +150 -0
- package/dist/types/filters.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search & Discovery Tools
|
|
3
|
+
*
|
|
4
|
+
* The primary search tools for finding and analyzing federal spending data.
|
|
5
|
+
* These tools use the shared filter schemas from types/filters.ts to provide
|
|
6
|
+
* flexible, composable search across awards, transactions, and aggregations.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { client } from "../api/client.js";
|
|
10
|
+
import { SearchFiltersSchema, PaginationSchema, buildFilters } from "../types/filters.js";
|
|
11
|
+
export function registerSearchTools(server) {
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// search_awards
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
server.registerTool("search_awards", {
|
|
16
|
+
title: "Search Awards",
|
|
17
|
+
description: "Search federal awards (contracts, grants, IDVs, loans) with flexible filters. " +
|
|
18
|
+
"Supports filtering by agency, recipient, NAICS/PSC codes, date range, award type, " +
|
|
19
|
+
"keywords, and geography. Returns paginated results. This is the primary search tool " +
|
|
20
|
+
"for finding federal contracts and awards.",
|
|
21
|
+
inputSchema: SearchFiltersSchema.merge(PaginationSchema).extend({
|
|
22
|
+
fields: z
|
|
23
|
+
.array(z.string())
|
|
24
|
+
.optional()
|
|
25
|
+
.default([
|
|
26
|
+
"Award ID",
|
|
27
|
+
"Recipient Name",
|
|
28
|
+
"Award Amount",
|
|
29
|
+
"Total Outlays",
|
|
30
|
+
"Description",
|
|
31
|
+
"Contract Award Type",
|
|
32
|
+
"Awarding Agency",
|
|
33
|
+
"Awarding Sub Agency",
|
|
34
|
+
"Start Date",
|
|
35
|
+
"End Date",
|
|
36
|
+
"recipient_id",
|
|
37
|
+
"prime_award_recipient_id",
|
|
38
|
+
])
|
|
39
|
+
.describe("Fields to include in the response"),
|
|
40
|
+
subawards: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.optional()
|
|
43
|
+
.default(false)
|
|
44
|
+
.describe("Whether to search subawards instead of prime awards"),
|
|
45
|
+
}),
|
|
46
|
+
}, async (input) => {
|
|
47
|
+
const { page, limit, sort, order, fields, subawards, ...filterParams } = input;
|
|
48
|
+
const body = {
|
|
49
|
+
filters: buildFilters(filterParams),
|
|
50
|
+
fields,
|
|
51
|
+
page,
|
|
52
|
+
limit,
|
|
53
|
+
sort: sort ?? "Award Amount",
|
|
54
|
+
order: order ?? "desc",
|
|
55
|
+
subawards,
|
|
56
|
+
};
|
|
57
|
+
const data = await client.post("/search/spending_by_award/", body);
|
|
58
|
+
const enriched = client.addSummary(data);
|
|
59
|
+
return {
|
|
60
|
+
content: [{ type: "text", text: JSON.stringify(enriched, null, 2) }],
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// search_awards_count
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
server.registerTool("search_awards_count", {
|
|
67
|
+
title: "Search Awards Count",
|
|
68
|
+
description: "Get counts of awards matching your filters, broken down by award type " +
|
|
69
|
+
"(contracts, IDVs, grants, direct payments, loans, other). Useful for " +
|
|
70
|
+
"understanding the scale of results before doing a full search.",
|
|
71
|
+
inputSchema: SearchFiltersSchema,
|
|
72
|
+
}, async (filters) => {
|
|
73
|
+
const body = {
|
|
74
|
+
filters: buildFilters(filters),
|
|
75
|
+
};
|
|
76
|
+
const data = await client.post("/search/spending_by_award_count/", body);
|
|
77
|
+
return {
|
|
78
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// search_subawards
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
server.registerTool("search_subawards", {
|
|
85
|
+
title: "Search Subawards",
|
|
86
|
+
description: "Search subaward records across all prime awards. Returns subcontractor/sub-grantee " +
|
|
87
|
+
"details including amounts and recipients.",
|
|
88
|
+
inputSchema: SearchFiltersSchema.merge(PaginationSchema),
|
|
89
|
+
}, async (input) => {
|
|
90
|
+
const { page, limit, sort, order, ...filterParams } = input;
|
|
91
|
+
const body = {
|
|
92
|
+
filters: buildFilters(filterParams),
|
|
93
|
+
page,
|
|
94
|
+
limit,
|
|
95
|
+
sort: sort ?? "subaward_number",
|
|
96
|
+
order: order ?? "desc",
|
|
97
|
+
};
|
|
98
|
+
const data = await client.post("/search/subawards/", body);
|
|
99
|
+
const enriched = client.addSummary(data);
|
|
100
|
+
return {
|
|
101
|
+
content: [{ type: "text", text: JSON.stringify(enriched, null, 2) }],
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// search_by_category
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
server.registerTool("search_by_category", {
|
|
108
|
+
title: "Search by Category",
|
|
109
|
+
description: "Group and aggregate spending by a dimension: awarding_agency, awarding_subagency, " +
|
|
110
|
+
"funding_agency, funding_subagency, recipient_name, naics, psc, cfda, county, " +
|
|
111
|
+
"district, state_territory, country, federal_account. Returns top results ranked by amount.",
|
|
112
|
+
inputSchema: SearchFiltersSchema.merge(PaginationSchema).extend({
|
|
113
|
+
category: z
|
|
114
|
+
.string()
|
|
115
|
+
.describe("The grouping dimension. One of: awarding_agency, awarding_subagency, " +
|
|
116
|
+
"funding_agency, funding_subagency, recipient_name, naics, psc, cfda, " +
|
|
117
|
+
"county, district, state_territory, country, federal_account"),
|
|
118
|
+
}),
|
|
119
|
+
}, async (input) => {
|
|
120
|
+
const { page, limit, sort, order, category, ...filterParams } = input;
|
|
121
|
+
const body = {
|
|
122
|
+
filters: buildFilters(filterParams),
|
|
123
|
+
category,
|
|
124
|
+
page,
|
|
125
|
+
limit,
|
|
126
|
+
};
|
|
127
|
+
const data = await client.post(`/search/spending_by_category/${category}/`, body);
|
|
128
|
+
const enriched = client.addSummary(data);
|
|
129
|
+
return {
|
|
130
|
+
content: [{ type: "text", text: JSON.stringify(enriched, null, 2) }],
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// search_new_awards_over_time
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
server.registerTool("search_new_awards_over_time", {
|
|
137
|
+
title: "New Awards Over Time",
|
|
138
|
+
description: "Track the volume of new awards over time matching your filters. Returns counts " +
|
|
139
|
+
"grouped by time period. Great for spotting trends in new contract issuance.",
|
|
140
|
+
inputSchema: SearchFiltersSchema.extend({
|
|
141
|
+
group: z
|
|
142
|
+
.enum(["month", "quarter", "fiscal_year"])
|
|
143
|
+
.describe("Time grouping for results: month, quarter, or fiscal_year"),
|
|
144
|
+
}),
|
|
145
|
+
}, async (input) => {
|
|
146
|
+
const { group, ...filterParams } = input;
|
|
147
|
+
const body = {
|
|
148
|
+
filters: buildFilters(filterParams),
|
|
149
|
+
group,
|
|
150
|
+
};
|
|
151
|
+
const data = await client.post("/search/new_awards_over_time/", body);
|
|
152
|
+
return {
|
|
153
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
// search_spending_over_time
|
|
158
|
+
// ---------------------------------------------------------------------------
|
|
159
|
+
server.registerTool("search_spending_over_time", {
|
|
160
|
+
title: "Spending Over Time",
|
|
161
|
+
description: "Track spending amounts over time matching your filters. Returns aggregated " +
|
|
162
|
+
"amounts grouped by time period.",
|
|
163
|
+
inputSchema: SearchFiltersSchema.extend({
|
|
164
|
+
group: z
|
|
165
|
+
.enum(["month", "quarter", "fiscal_year"])
|
|
166
|
+
.describe("Time grouping for results: month, quarter, or fiscal_year"),
|
|
167
|
+
}),
|
|
168
|
+
}, async (input) => {
|
|
169
|
+
const { group, ...filterParams } = input;
|
|
170
|
+
const body = {
|
|
171
|
+
filters: buildFilters(filterParams),
|
|
172
|
+
group,
|
|
173
|
+
};
|
|
174
|
+
const data = await client.post("/search/spending_over_time/", body);
|
|
175
|
+
return {
|
|
176
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
// search_spending_by_geography
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
server.registerTool("search_spending_by_geography", {
|
|
183
|
+
title: "Spending by Geography",
|
|
184
|
+
description: "Break down spending geographically. Shows spending by state, county, or " +
|
|
185
|
+
"congressional district based on either place of performance or recipient location.",
|
|
186
|
+
inputSchema: SearchFiltersSchema.extend({
|
|
187
|
+
scope: z
|
|
188
|
+
.enum(["place_of_performance", "recipient_location"])
|
|
189
|
+
.describe("Geographic scope: where the work is performed or where the recipient is located"),
|
|
190
|
+
geo_layer: z
|
|
191
|
+
.enum(["state", "county", "district"])
|
|
192
|
+
.describe("Geographic granularity: state, county, or congressional district"),
|
|
193
|
+
}),
|
|
194
|
+
}, async (input) => {
|
|
195
|
+
const { scope, geo_layer, ...filterParams } = input;
|
|
196
|
+
const body = {
|
|
197
|
+
filters: buildFilters(filterParams),
|
|
198
|
+
scope,
|
|
199
|
+
geo_layer,
|
|
200
|
+
};
|
|
201
|
+
const data = await client.post("/search/spending_by_geography/", body);
|
|
202
|
+
return {
|
|
203
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
// ---------------------------------------------------------------------------
|
|
207
|
+
// search_by_transaction
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
server.registerTool("search_by_transaction", {
|
|
210
|
+
title: "Search Transactions",
|
|
211
|
+
description: "Search at the transaction level across all awards. Returns individual funding " +
|
|
212
|
+
"actions/modifications. More granular than search_awards.",
|
|
213
|
+
inputSchema: SearchFiltersSchema.merge(PaginationSchema),
|
|
214
|
+
}, async (input) => {
|
|
215
|
+
const { page, limit, sort, order, ...filterParams } = input;
|
|
216
|
+
const body = {
|
|
217
|
+
filters: buildFilters(filterParams),
|
|
218
|
+
page,
|
|
219
|
+
limit,
|
|
220
|
+
sort: sort ?? "Transaction Amount",
|
|
221
|
+
order: order ?? "desc",
|
|
222
|
+
};
|
|
223
|
+
const data = await client.post("/search/spending_by_transaction/", body);
|
|
224
|
+
const enriched = client.addSummary(data);
|
|
225
|
+
return {
|
|
226
|
+
content: [{ type: "text", text: JSON.stringify(enriched, null, 2) }],
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|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AG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAC9E,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod filter schemas for USASpending API search endpoints.
|
|
3
|
+
*
|
|
4
|
+
* The USASpending search endpoints accept a common `filters` object.
|
|
5
|
+
* Each search tool composes the filters it needs by merging/extending
|
|
6
|
+
* these schemas:
|
|
7
|
+
*
|
|
8
|
+
* SearchFiltersSchema.merge(PaginationSchema).extend({ ... })
|
|
9
|
+
*
|
|
10
|
+
* The `buildFilters` helper strips undefined values before sending
|
|
11
|
+
* to the API.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
export declare const TimePeriodSchema: z.ZodObject<{
|
|
15
|
+
start_date: z.ZodString;
|
|
16
|
+
end_date: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const AgencyFilterSchema: z.ZodObject<{
|
|
19
|
+
type: z.ZodEnum<{
|
|
20
|
+
awarding: "awarding";
|
|
21
|
+
funding: "funding";
|
|
22
|
+
}>;
|
|
23
|
+
tier: z.ZodEnum<{
|
|
24
|
+
toptier: "toptier";
|
|
25
|
+
subtier: "subtier";
|
|
26
|
+
}>;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const LocationFilterSchema: z.ZodObject<{
|
|
30
|
+
country: z.ZodString;
|
|
31
|
+
state: z.ZodOptional<z.ZodString>;
|
|
32
|
+
county: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export declare const PaginationSchema: z.ZodObject<{
|
|
35
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
36
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
37
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
38
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
asc: "asc";
|
|
40
|
+
desc: "desc";
|
|
41
|
+
}>>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const SearchFiltersSchema: z.ZodObject<{
|
|
44
|
+
time_period: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
45
|
+
start_date: z.ZodString;
|
|
46
|
+
end_date: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
48
|
+
award_type_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
agencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
type: z.ZodEnum<{
|
|
51
|
+
awarding: "awarding";
|
|
52
|
+
funding: "funding";
|
|
53
|
+
}>;
|
|
54
|
+
tier: z.ZodEnum<{
|
|
55
|
+
toptier: "toptier";
|
|
56
|
+
subtier: "subtier";
|
|
57
|
+
}>;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
}, z.core.$strip>>>;
|
|
60
|
+
recipient_search_text: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
recipient_id: z.ZodOptional<z.ZodString>;
|
|
62
|
+
naics_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
+
psc_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
place_of_performance_locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
65
|
+
country: z.ZodString;
|
|
66
|
+
state: z.ZodOptional<z.ZodString>;
|
|
67
|
+
county: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
recipient_locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
country: z.ZodString;
|
|
71
|
+
state: z.ZodOptional<z.ZodString>;
|
|
72
|
+
county: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
74
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export type TimePeriod = z.infer<typeof TimePeriodSchema>;
|
|
77
|
+
export type AgencyFilter = z.infer<typeof AgencyFilterSchema>;
|
|
78
|
+
export type LocationFilter = z.infer<typeof LocationFilterSchema>;
|
|
79
|
+
export type Pagination = z.infer<typeof PaginationSchema>;
|
|
80
|
+
export type SearchFilters = z.infer<typeof SearchFiltersSchema>;
|
|
81
|
+
/**
|
|
82
|
+
* Takes a parsed SearchFilters object and returns a clean record with
|
|
83
|
+
* only the defined keys. This is the object you pass as `filters` in
|
|
84
|
+
* the POST body to USASpending search endpoints.
|
|
85
|
+
*/
|
|
86
|
+
export declare function buildFilters(filters: z.infer<typeof SearchFiltersSchema>): Record<string, unknown>;
|
|
87
|
+
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/types/filters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gBAAgB;;;iBAO3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAU7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;iBAY/B,CAAC;AAMH,eAAO,MAAM,gBAAgB;;;;;;;;iBAyB3B,CAAC;AAMH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2D9B,CAAC;AAMH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod filter schemas for USASpending API search endpoints.
|
|
3
|
+
*
|
|
4
|
+
* The USASpending search endpoints accept a common `filters` object.
|
|
5
|
+
* Each search tool composes the filters it needs by merging/extending
|
|
6
|
+
* these schemas:
|
|
7
|
+
*
|
|
8
|
+
* SearchFiltersSchema.merge(PaginationSchema).extend({ ... })
|
|
9
|
+
*
|
|
10
|
+
* The `buildFilters` helper strips undefined values before sending
|
|
11
|
+
* to the API.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Primitive filter schemas
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
export const TimePeriodSchema = z.object({
|
|
18
|
+
start_date: z
|
|
19
|
+
.string()
|
|
20
|
+
.describe("Start date in YYYY-MM-DD format (e.g. '2024-10-01' for FY2025 start)"),
|
|
21
|
+
end_date: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("End date in YYYY-MM-DD format (e.g. '2025-09-30' for FY2025 end)"),
|
|
24
|
+
});
|
|
25
|
+
export const AgencyFilterSchema = z.object({
|
|
26
|
+
type: z
|
|
27
|
+
.enum(["awarding", "funding"])
|
|
28
|
+
.describe("Agency role: 'awarding' (who issued the award) or 'funding' (who provided the money)"),
|
|
29
|
+
tier: z
|
|
30
|
+
.enum(["toptier", "subtier"])
|
|
31
|
+
.describe("Agency tier: 'toptier' (e.g. Department of Defense) or 'subtier' (e.g. Army)"),
|
|
32
|
+
name: z
|
|
33
|
+
.string()
|
|
34
|
+
.describe("Agency name as it appears in USASpending (e.g. 'Department of Defense')"),
|
|
35
|
+
});
|
|
36
|
+
export const LocationFilterSchema = z.object({
|
|
37
|
+
country: z
|
|
38
|
+
.string()
|
|
39
|
+
.describe("Country code (e.g. 'USA', 'GBR')"),
|
|
40
|
+
state: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("State FIPS code or abbreviation (e.g. 'VA', '51')"),
|
|
44
|
+
county: z
|
|
45
|
+
.string()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("County FIPS code (e.g. '059' for Fairfax County, VA)"),
|
|
48
|
+
});
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// Pagination schema
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
export const PaginationSchema = z.object({
|
|
53
|
+
page: z
|
|
54
|
+
.number()
|
|
55
|
+
.int()
|
|
56
|
+
.positive()
|
|
57
|
+
.optional()
|
|
58
|
+
.default(1)
|
|
59
|
+
.describe("Page number (starts at 1)"),
|
|
60
|
+
limit: z
|
|
61
|
+
.number()
|
|
62
|
+
.int()
|
|
63
|
+
.positive()
|
|
64
|
+
.max(100)
|
|
65
|
+
.optional()
|
|
66
|
+
.default(20)
|
|
67
|
+
.describe("Results per page (max 100)"),
|
|
68
|
+
sort: z
|
|
69
|
+
.string()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Field name to sort by (varies by endpoint)"),
|
|
72
|
+
order: z
|
|
73
|
+
.enum(["asc", "desc"])
|
|
74
|
+
.optional()
|
|
75
|
+
.default("desc")
|
|
76
|
+
.describe("Sort order: 'asc' (ascending) or 'desc' (descending, default)"),
|
|
77
|
+
});
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
// Main search filters schema
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
export const SearchFiltersSchema = z.object({
|
|
82
|
+
time_period: z
|
|
83
|
+
.array(TimePeriodSchema)
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("Date range filters. Each entry narrows results to awards active within that range. " +
|
|
86
|
+
"Fiscal years run Oct 1 - Sep 30 (e.g. FY2025 = 2024-10-01 to 2025-09-30)."),
|
|
87
|
+
award_type_codes: z
|
|
88
|
+
.array(z.string())
|
|
89
|
+
.optional()
|
|
90
|
+
.describe("Award type codes to filter by. Common codes: " +
|
|
91
|
+
"Contracts: 'A' (BPA Call), 'B' (Purchase Order), 'C' (Delivery Order), 'D' (Definitive Contract). " +
|
|
92
|
+
"IDVs: 'IDV_A' (GWAC), 'IDV_B' (IDC), 'IDV_B_A' (IDC/IDIQ), 'IDV_B_B' (IDC/Multiple Award Schedule), " +
|
|
93
|
+
"'IDV_B_C' (IDC/BOA), 'IDV_C' (FSS), 'IDV_D' (BPA), 'IDV_E' (BOA). " +
|
|
94
|
+
"Grants: '02' (Block Grant), '03' (Formula Grant), '04' (Project Grant), '05' (Cooperative Agreement). " +
|
|
95
|
+
"Loans: '07' (Direct Loan), '08' (Guaranteed/Insured Loan). " +
|
|
96
|
+
"Direct Payments: '06' (Direct Payment for Specified Use), '10' (Direct Payment with Unrestricted Use). " +
|
|
97
|
+
"Other: '09' (Insurance), '11' (Other Financial Assistance)."),
|
|
98
|
+
agencies: z
|
|
99
|
+
.array(AgencyFilterSchema)
|
|
100
|
+
.optional()
|
|
101
|
+
.describe("Filter by awarding or funding agencies"),
|
|
102
|
+
recipient_search_text: z
|
|
103
|
+
.array(z.string())
|
|
104
|
+
.optional()
|
|
105
|
+
.describe("Search for recipients by name (e.g. ['Lockheed Martin', 'Raytheon'])"),
|
|
106
|
+
recipient_id: z
|
|
107
|
+
.string()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("Filter to a specific recipient by their hash ID (from autocomplete_recipient or search results)"),
|
|
110
|
+
naics_codes: z
|
|
111
|
+
.array(z.string())
|
|
112
|
+
.optional()
|
|
113
|
+
.describe("NAICS industry codes to filter by (e.g. ['541512'] for Computer Systems Design, " +
|
|
114
|
+
"['541511'] for Custom Programming). Use search_naics to find codes."),
|
|
115
|
+
psc_codes: z
|
|
116
|
+
.array(z.string())
|
|
117
|
+
.optional()
|
|
118
|
+
.describe("Product/Service Classification codes to filter by (e.g. ['D306'] for IT and Telecom - " +
|
|
119
|
+
"Systems Development). Use search_psc to find codes."),
|
|
120
|
+
place_of_performance_locations: z
|
|
121
|
+
.array(LocationFilterSchema)
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("Filter by where the work is performed (geographic location)"),
|
|
124
|
+
recipient_locations: z
|
|
125
|
+
.array(LocationFilterSchema)
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Filter by where the recipient is located (geographic location)"),
|
|
128
|
+
keywords: z
|
|
129
|
+
.array(z.string())
|
|
130
|
+
.optional()
|
|
131
|
+
.describe("Full-text keyword search across award descriptions (e.g. ['cybersecurity', 'cloud migration'])"),
|
|
132
|
+
});
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// Helper: strip undefined values from a filters object
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
/**
|
|
137
|
+
* Takes a parsed SearchFilters object and returns a clean record with
|
|
138
|
+
* only the defined keys. This is the object you pass as `filters` in
|
|
139
|
+
* the POST body to USASpending search endpoints.
|
|
140
|
+
*/
|
|
141
|
+
export function buildFilters(filters) {
|
|
142
|
+
const result = {};
|
|
143
|
+
for (const [key, value] of Object.entries(filters)) {
|
|
144
|
+
if (value !== undefined) {
|
|
145
|
+
result[key] = value;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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-0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "usaspending-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for the USASpending.gov API - federal spending intelligence",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"usaspending-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"start:http": "node dist/index.js --transport http --port 3001",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"mcp",
|
|
19
|
+
"usaspending",
|
|
20
|
+
"federal-spending",
|
|
21
|
+
"government-contracts",
|
|
22
|
+
"model-context-protocol"
|
|
23
|
+
],
|
|
24
|
+
"author": "Joe Bucci",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/boejucci/usa-spending-mcp.git"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
35
|
+
"express": "^5.2.1",
|
|
36
|
+
"zod": "^4.3.6"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/express": "^5.0.6",
|
|
40
|
+
"@types/node": "^25.2.0",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
|
+
}
|
|
43
|
+
}
|