@cyanheads/usaspending-mcp-server 0.4.3 → 0.4.4

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.
Files changed (46) hide show
  1. package/AGENTS.md +2 -2
  2. package/CLAUDE.md +2 -2
  3. package/README.md +106 -138
  4. package/changelog/0.4.x/0.4.4.md +31 -0
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js +2 -2
  8. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/dates.d.ts +95 -0
  10. package/dist/mcp-server/tools/definitions/dates.d.ts.map +1 -0
  11. package/dist/mcp-server/tools/definitions/dates.js +145 -0
  12. package/dist/mcp-server/tools/definitions/dates.js.map +1 -0
  13. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts +8 -1
  14. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js +93 -14
  16. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/filters.d.ts +11 -2
  18. package/dist/mcp-server/tools/definitions/filters.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/filters.js +12 -5
  20. package/dist/mcp-server/tools/definitions/filters.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/index.d.ts +81 -12
  22. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +31 -5
  24. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/search-awards.tool.js +212 -51
  26. package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts +14 -2
  28. package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/spending-by-category.tool.js +44 -12
  30. package/dist/mcp-server/tools/definitions/spending-by-category.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts +14 -2
  32. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts.map +1 -1
  33. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js +49 -19
  34. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js.map +1 -1
  35. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts +14 -2
  36. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts.map +1 -1
  37. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +44 -12
  38. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
  39. package/dist/services/usaspending/types.d.ts +28 -2
  40. package/dist/services/usaspending/types.d.ts.map +1 -1
  41. package/dist/services/usaspending/usaspending-service.d.ts +9 -13
  42. package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
  43. package/dist/services/usaspending/usaspending-service.js +109 -3
  44. package/dist/services/usaspending/usaspending-service.js.map +1 -1
  45. package/package.json +3 -3
  46. package/server.json +3 -3
@@ -2,11 +2,17 @@
2
2
  * @fileoverview Shared filter builder for USAspending analytics endpoints.
3
3
  * @module mcp-server/tools/definitions/filters
4
4
  */
5
- /** Builds the `filters` object for spending analytics endpoints (geography, category, over-time). */
5
+ import { resolveDateRange } from './dates.js';
6
+ /**
7
+ * Builds the `filters` object for spending analytics endpoints (geography,
8
+ * category, over-time), and returns the time window it sent — padded, with a
9
+ * lone start or end filled per {@link resolveDateRange} — so the calling tool
10
+ * can echo exactly what was applied and disclose a filled bound.
11
+ */
6
12
  export function buildFilters(f) {
7
13
  const filters = {};
8
14
  if (!f)
9
- return filters;
15
+ return { filters, timePeriod: undefined };
10
16
  if (f.keywords?.length)
11
17
  filters.keywords = f.keywords;
12
18
  if (f.award_type_codes?.length)
@@ -18,9 +24,10 @@ export function buildFilters(f) {
18
24
  filters.recipient_id = f.recipient_id;
19
25
  if (f.naics_codes?.length)
20
26
  filters.naics_codes = { require: f.naics_codes };
21
- if (f.time_period_start && f.time_period_end) {
22
- filters.time_period = [{ start_date: f.time_period_start, end_date: f.time_period_end }];
27
+ const timePeriod = resolveDateRange(f.time_period_start, f.time_period_end);
28
+ if (timePeriod) {
29
+ filters.time_period = [{ start_date: timePeriod.start_date, end_date: timePeriod.end_date }];
23
30
  }
24
- return filters;
31
+ return { filters, timePeriod };
25
32
  }
26
33
  //# sourceMappingURL=filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/filters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qGAAqG;AACrG,MAAM,UAAU,YAAY,CAC1B,CAQQ;IAER,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC;IACvB,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM;QAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;IACtD,IAAI,CAAC,CAAC,gBAAgB,EAAE,MAAM;QAAE,OAAO,CAAC,gBAAgB,GAAG,CAAC,CAAC,gBAAgB,CAAC;IAC9E,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAClB,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,CAAC,CAAC,YAAY;QAAE,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM;QAAE,OAAO,CAAC,WAAW,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;I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BAAiB,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5E,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,WAAW,GAAG,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACjC,CAAC"}
@@ -111,9 +111,10 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
111
111
  agency_name: import("zod").ZodOptional<import("zod").ZodString>;
112
112
  recipient_name: import("zod").ZodOptional<import("zod").ZodString>;
113
113
  naics_codes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
114
+ assistance_listings: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
114
115
  time_period: import("zod").ZodOptional<import("zod").ZodObject<{
115
- start_date: import("zod").ZodString;
116
- end_date: import("zod").ZodString;
116
+ start_date: import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>;
117
+ end_date: import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>;
117
118
  }, import("zod/v4/core").$strip>>;
118
119
  location_filter: import("zod").ZodOptional<import("zod").ZodObject<{
119
120
  country: import("zod").ZodOptional<import("zod").ZodString>;
@@ -121,12 +122,15 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
121
122
  county: import("zod").ZodOptional<import("zod").ZodString>;
122
123
  city: import("zod").ZodOptional<import("zod").ZodString>;
123
124
  }, import("zod/v4/core").$strip>>;
124
- sort: import("zod").ZodDefault<import("zod").ZodEnum<{
125
+ sort: import("zod").ZodOptional<import("zod").ZodEnum<{
125
126
  "Award Amount": "Award Amount";
126
127
  "Awarding Agency": "Awarding Agency";
127
128
  "End Date": "End Date";
129
+ "Issued Date": "Issued Date";
130
+ "Loan Value": "Loan Value";
128
131
  "Recipient Name": "Recipient Name";
129
132
  "Start Date": "Start Date";
133
+ "Subsidy Cost": "Subsidy Cost";
130
134
  "Total Outlays": "Total Outlays";
131
135
  }>>;
132
136
  order: import("zod").ZodDefault<import("zod").ZodEnum<{
@@ -143,8 +147,8 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
143
147
  agency_name: import("zod").ZodOptional<import("zod").ZodString>;
144
148
  recipient_name: import("zod").ZodOptional<import("zod").ZodString>;
145
149
  naics_codes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
146
- time_period_start: import("zod").ZodOptional<import("zod").ZodString>;
147
- time_period_end: import("zod").ZodOptional<import("zod").ZodString>;
150
+ time_period_start: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
151
+ time_period_end: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
148
152
  }, import("zod/v4/core").$strip>>;
149
153
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
150
154
  results: import("zod").ZodArray<import("zod").ZodObject<{
@@ -153,6 +157,9 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
153
157
  recipient_name: import("zod").ZodOptional<import("zod").ZodString>;
154
158
  award_amount: import("zod").ZodOptional<import("zod").ZodNumber>;
155
159
  total_outlays: import("zod").ZodOptional<import("zod").ZodNumber>;
160
+ loan_value: import("zod").ZodOptional<import("zod").ZodNumber>;
161
+ subsidy_cost: import("zod").ZodOptional<import("zod").ZodNumber>;
162
+ issued_date: import("zod").ZodOptional<import("zod").ZodString>;
156
163
  awarding_agency: import("zod").ZodOptional<import("zod").ZodString>;
157
164
  awarding_sub_agency: import("zod").ZodOptional<import("zod").ZodString>;
158
165
  agency_slug: import("zod").ZodOptional<import("zod").ZodString>;
@@ -200,6 +207,24 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
200
207
  readonly when: "The resolved start date precedes the 2007-10-01 earliest date this endpoint can search.";
201
208
  readonly retryable: false;
202
209
  readonly recovery: "Re-request with a start date of 2007-10-01 or later. For award data back to 2000-10-01, use the Custom Award Download feature on usaspending.gov or the bulk_download API endpoints.";
210
+ }, {
211
+ readonly reason: "date_range_inverted";
212
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
213
+ readonly when: "Both ends of the date range were supplied and the start date falls after the end date.";
214
+ readonly retryable: false;
215
+ readonly recovery: "Swap the two dates so the start date is on or before the end date, then retry.";
216
+ }, {
217
+ readonly reason: "unsupported_sort";
218
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
219
+ readonly when: "The sort value is not one the award type group supports.";
220
+ readonly retryable: false;
221
+ readonly recovery: "Re-request with one of the sorts the error lists for this award type group, or omit sort to use the group default (Loan Value for loans, Award Amount otherwise).";
222
+ }, {
223
+ readonly reason: "assistance_listings_type_mismatch";
224
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
225
+ readonly when: "assistance_listings was given while the award type codes include contract or IDV codes, or were left at the contract default.";
226
+ readonly retryable: false;
227
+ readonly recovery: "Set award_type_codes to one assistance group — grants 02/03/04/05/F001/F002, direct payments 06/10/F006/F007, loans 07/08/F003/F004, or other assistance 09/11/-1/F005/F008/F009/F010 — alongside assistance_listings.";
203
228
  }], {
204
229
  readonly page: import("zod").ZodNumber;
205
230
  readonly has_next: import("zod").ZodBoolean;
@@ -210,6 +235,7 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
210
235
  readonly applied_keyword: import("zod").ZodOptional<import("zod").ZodString>;
211
236
  readonly applied_agency_name: import("zod").ZodOptional<import("zod").ZodString>;
212
237
  readonly applied_naics_codes: import("zod").ZodOptional<import("zod").ZodString>;
238
+ readonly applied_assistance_listings: import("zod").ZodOptional<import("zod").ZodString>;
213
239
  readonly applied_time_period_start: import("zod").ZodOptional<import("zod").ZodString>;
214
240
  readonly applied_time_period_end: import("zod").ZodOptional<import("zod").ZodString>;
215
241
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
@@ -689,8 +715,8 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
689
715
  agency_name: import("zod").ZodOptional<import("zod").ZodString>;
690
716
  recipient_id: import("zod").ZodOptional<import("zod").ZodString>;
691
717
  naics_codes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
692
- time_period_start: import("zod").ZodOptional<import("zod").ZodString>;
693
- time_period_end: import("zod").ZodOptional<import("zod").ZodString>;
718
+ time_period_start: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
719
+ time_period_end: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
694
720
  }, import("zod/v4/core").$strip>>;
695
721
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
696
722
  subawards: import("zod").ZodDefault<import("zod").ZodBoolean>;
@@ -721,6 +747,18 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
721
747
  readonly retryable: true;
722
748
  readonly thrownBy: "service";
723
749
  readonly recovery: "Narrow the filters — a shorter time_period or a coarser geo_layer — then retry the aggregation.";
750
+ }, {
751
+ readonly reason: "date_range_inverted";
752
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
753
+ readonly when: "Both filters.time_period_start and filters.time_period_end were supplied and the start falls after the end.";
754
+ readonly retryable: false;
755
+ readonly recovery: "Swap the two dates so the start date is on or before the end date, then retry.";
756
+ }, {
757
+ readonly reason: "date_before_earliest";
758
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
759
+ readonly when: "The resolved start date precedes the 2007-10-01 earliest date this endpoint can search.";
760
+ readonly retryable: false;
761
+ readonly recovery: "Re-request with a start date of 2007-10-01 or later. For award data back to 2000-10-01, use the Custom Award Download feature on usaspending.gov or the bulk_download API endpoints.";
724
762
  }], {
725
763
  readonly applied_scope: import("zod").ZodString;
726
764
  readonly applied_geo_layer: import("zod").ZodString;
@@ -754,8 +792,8 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
754
792
  agency_name: import("zod").ZodOptional<import("zod").ZodString>;
755
793
  recipient_id: import("zod").ZodOptional<import("zod").ZodString>;
756
794
  naics_codes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
757
- time_period_start: import("zod").ZodOptional<import("zod").ZodString>;
758
- time_period_end: import("zod").ZodOptional<import("zod").ZodString>;
795
+ time_period_start: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
796
+ time_period_end: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
759
797
  }, import("zod/v4/core").$strip>>;
760
798
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
761
799
  page: import("zod").ZodDefault<import("zod").ZodNumber>;
@@ -787,6 +825,18 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
787
825
  readonly retryable: true;
788
826
  readonly thrownBy: "service";
789
827
  readonly recovery: "Narrow the query — a shorter time_period in filters, or a smaller limit — then retry.";
828
+ }, {
829
+ readonly reason: "date_range_inverted";
830
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
831
+ readonly when: "Both filters.time_period_start and filters.time_period_end were supplied and the start falls after the end.";
832
+ readonly retryable: false;
833
+ readonly recovery: "Swap the two dates so the start date is on or before the end date, then retry.";
834
+ }, {
835
+ readonly reason: "date_before_earliest";
836
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
837
+ readonly when: "The resolved start date precedes the 2007-10-01 earliest date this endpoint can search.";
838
+ readonly retryable: false;
839
+ readonly recovery: "Re-request with a start date of 2007-10-01 or later. For award data back to 2000-10-01, use the Custom Award Download feature on usaspending.gov or the bulk_download API endpoints.";
790
840
  }], {
791
841
  readonly totalCount: import("zod").ZodOptional<import("zod").ZodNumber>;
792
842
  readonly page: import("zod").ZodNumber;
@@ -809,8 +859,8 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
809
859
  agency_name: import("zod").ZodOptional<import("zod").ZodString>;
810
860
  recipient_id: import("zod").ZodOptional<import("zod").ZodString>;
811
861
  naics_codes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
812
- time_period_start: import("zod").ZodOptional<import("zod").ZodString>;
813
- time_period_end: import("zod").ZodOptional<import("zod").ZodString>;
862
+ time_period_start: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
863
+ time_period_end: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>, unknown>>;
814
864
  }, import("zod/v4/core").$strip>>;
815
865
  subawards: import("zod").ZodDefault<import("zod").ZodBoolean>;
816
866
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -844,6 +894,18 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
844
894
  readonly retryable: true;
845
895
  readonly thrownBy: "service";
846
896
  readonly recovery: "Narrow the filters — a shorter time_period or a coarser group — then retry the aggregation.";
897
+ }, {
898
+ readonly reason: "date_range_inverted";
899
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
900
+ readonly when: "Both filters.time_period_start and filters.time_period_end were supplied and the start falls after the end.";
901
+ readonly retryable: false;
902
+ readonly recovery: "Swap the two dates so the start date is on or before the end date, then retry.";
903
+ }, {
904
+ readonly reason: "date_before_earliest";
905
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
906
+ readonly when: "The resolved start date precedes the 2007-10-01 earliest date this endpoint can search.";
907
+ readonly retryable: false;
908
+ readonly recovery: "Re-request with a start date of 2007-10-01 or later. For award data back to 2000-10-01, use the Custom Award Download feature on usaspending.gov or the bulk_download API endpoints.";
847
909
  }], {
848
910
  readonly time_group: import("zod").ZodString;
849
911
  readonly period_count: import("zod").ZodNumber;
@@ -893,12 +955,19 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
893
955
  public_law: import("zod").ZodOptional<import("zod").ZodString>;
894
956
  }, import("zod/v4/core").$strip>>>;
895
957
  }, import("zod/v4/core").$strip>>;
958
+ totals: import("zod").ZodOptional<import("zod").ZodObject<{
959
+ obligation: import("zod").ZodOptional<import("zod").ZodNumber>;
960
+ outlay: import("zod").ZodOptional<import("zod").ZodNumber>;
961
+ total_budgetary_resources: import("zod").ZodOptional<import("zod").ZodNumber>;
962
+ award_count: import("zod").ZodOptional<import("zod").ZodNumber>;
963
+ }, import("zod/v4/core").$strip>>;
896
964
  results: import("zod").ZodArray<import("zod").ZodObject<{
897
965
  id: import("zod").ZodOptional<import("zod").ZodString>;
898
966
  code: import("zod").ZodOptional<import("zod").ZodString>;
899
967
  name: import("zod").ZodOptional<import("zod").ZodString>;
900
968
  obligation: import("zod").ZodOptional<import("zod").ZodNumber>;
901
969
  outlay: import("zod").ZodOptional<import("zod").ZodNumber>;
970
+ total_budgetary_resources: import("zod").ZodOptional<import("zod").ZodNumber>;
902
971
  award_count: import("zod").ZodOptional<import("zod").ZodNumber>;
903
972
  face_value_of_loan: import("zod").ZodOptional<import("zod").ZodNumber>;
904
973
  shape_code: import("zod").ZodOptional<import("zod").ZodString>;
@@ -926,7 +995,7 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
926
995
  readonly when: "USAspending.gov did not respond before the request deadline elapsed.";
927
996
  readonly retryable: true;
928
997
  readonly thrownBy: "service";
929
- readonly recovery: "Narrow the query — fewer DEF codes in filters, or a smaller limit — then retry.";
998
+ readonly recovery: "By dimension — agency, cfda, recipient: pass fewer filters.def_codes or a smaller limit, then retry. geography: pass fewer filters.def_codes, then retry. overview: the upstream endpoint can run past the request budget on its own, so retry later, or call dimension \"agency\" with filters.def_codes (e.g. [\"L\", \"M\", \"N\", \"O\", \"P\"] for COVID-19), spending_type \"total\", and limit 100 for per-agency obligations and outlays plus overall totals.";
930
999
  }], {
931
1000
  readonly applied_dimension: import("zod").ZodString;
932
1001
  readonly totalCount: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmBrB,CAAC"}
@@ -11,9 +11,10 @@ export declare const searchAwardsTool: import("@cyanheads/mcp-ts-core").ToolDefi
11
11
  agency_name: z.ZodOptional<z.ZodString>;
12
12
  recipient_name: z.ZodOptional<z.ZodString>;
13
13
  naics_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ assistance_listings: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
15
  time_period: z.ZodOptional<z.ZodObject<{
15
- start_date: z.ZodString;
16
- end_date: z.ZodString;
16
+ start_date: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>;
17
+ end_date: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>;
17
18
  }, z.core.$strip>>;
18
19
  location_filter: z.ZodOptional<z.ZodObject<{
19
20
  country: z.ZodOptional<z.ZodString>;
@@ -21,12 +22,15 @@ export declare const searchAwardsTool: import("@cyanheads/mcp-ts-core").ToolDefi
21
22
  county: z.ZodOptional<z.ZodString>;
22
23
  city: z.ZodOptional<z.ZodString>;
23
24
  }, z.core.$strip>>;
24
- sort: z.ZodDefault<z.ZodEnum<{
25
+ sort: z.ZodOptional<z.ZodEnum<{
25
26
  "Award Amount": "Award Amount";
26
27
  "Awarding Agency": "Awarding Agency";
27
28
  "End Date": "End Date";
29
+ "Issued Date": "Issued Date";
30
+ "Loan Value": "Loan Value";
28
31
  "Recipient Name": "Recipient Name";
29
32
  "Start Date": "Start Date";
33
+ "Subsidy Cost": "Subsidy Cost";
30
34
  "Total Outlays": "Total Outlays";
31
35
  }>>;
32
36
  order: z.ZodDefault<z.ZodEnum<{
@@ -43,8 +47,8 @@ export declare const searchAwardsTool: import("@cyanheads/mcp-ts-core").ToolDefi
43
47
  agency_name: z.ZodOptional<z.ZodString>;
44
48
  recipient_name: z.ZodOptional<z.ZodString>;
45
49
  naics_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
- time_period_start: z.ZodOptional<z.ZodString>;
47
- time_period_end: z.ZodOptional<z.ZodString>;
50
+ time_period_start: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
51
+ time_period_end: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
48
52
  }, z.core.$strip>>;
49
53
  }, z.core.$strip>, z.ZodObject<{
50
54
  results: z.ZodArray<z.ZodObject<{
@@ -53,6 +57,9 @@ export declare const searchAwardsTool: import("@cyanheads/mcp-ts-core").ToolDefi
53
57
  recipient_name: z.ZodOptional<z.ZodString>;
54
58
  award_amount: z.ZodOptional<z.ZodNumber>;
55
59
  total_outlays: z.ZodOptional<z.ZodNumber>;
60
+ loan_value: z.ZodOptional<z.ZodNumber>;
61
+ subsidy_cost: z.ZodOptional<z.ZodNumber>;
62
+ issued_date: z.ZodOptional<z.ZodString>;
56
63
  awarding_agency: z.ZodOptional<z.ZodString>;
57
64
  awarding_sub_agency: z.ZodOptional<z.ZodString>;
58
65
  agency_slug: z.ZodOptional<z.ZodString>;
@@ -100,6 +107,24 @@ export declare const searchAwardsTool: import("@cyanheads/mcp-ts-core").ToolDefi
100
107
  readonly when: "The resolved start date precedes the 2007-10-01 earliest date this endpoint can search.";
101
108
  readonly retryable: false;
102
109
  readonly recovery: "Re-request with a start date of 2007-10-01 or later. For award data back to 2000-10-01, use the Custom Award Download feature on usaspending.gov or the bulk_download API endpoints.";
110
+ }, {
111
+ readonly reason: "date_range_inverted";
112
+ readonly code: JsonRpcErrorCode.ValidationError;
113
+ readonly when: "Both ends of the date range were supplied and the start date falls after the end date.";
114
+ readonly retryable: false;
115
+ readonly recovery: "Swap the two dates so the start date is on or before the end date, then retry.";
116
+ }, {
117
+ readonly reason: "unsupported_sort";
118
+ readonly code: JsonRpcErrorCode.ValidationError;
119
+ readonly when: "The sort value is not one the award type group supports.";
120
+ readonly retryable: false;
121
+ readonly recovery: "Re-request with one of the sorts the error lists for this award type group, or omit sort to use the group default (Loan Value for loans, Award Amount otherwise).";
122
+ }, {
123
+ readonly reason: "assistance_listings_type_mismatch";
124
+ readonly code: JsonRpcErrorCode.ValidationError;
125
+ readonly when: "assistance_listings was given while the award type codes include contract or IDV codes, or were left at the contract default.";
126
+ readonly retryable: false;
127
+ readonly recovery: "Set award_type_codes to one assistance group — grants 02/03/04/05/F001/F002, direct payments 06/10/F006/F007, loans 07/08/F003/F004, or other assistance 09/11/-1/F005/F008/F009/F010 — alongside assistance_listings.";
103
128
  }], {
104
129
  readonly page: z.ZodNumber;
105
130
  readonly has_next: z.ZodBoolean;
@@ -110,6 +135,7 @@ export declare const searchAwardsTool: import("@cyanheads/mcp-ts-core").ToolDefi
110
135
  readonly applied_keyword: z.ZodOptional<z.ZodString>;
111
136
  readonly applied_agency_name: z.ZodOptional<z.ZodString>;
112
137
  readonly applied_naics_codes: z.ZodOptional<z.ZodString>;
138
+ readonly applied_assistance_listings: z.ZodOptional<z.ZodString>;
113
139
  readonly applied_time_period_start: z.ZodOptional<z.ZodString>;
114
140
  readonly applied_time_period_end: z.ZodOptional<z.ZodString>;
115
141
  readonly notice: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"search-awards.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-awards.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,+BAA+B,CAAC;AAqDlF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkkB3B,CAAC"}
1
+ {"version":3,"file":"search-awards.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-awards.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,+BAA+B,CAAC;AAiJlF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+rB3B,CAAC"}