@cyanheads/secedgar-mcp-server 0.15.6 → 0.15.7

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 (81) hide show
  1. package/AGENTS.md +23 -19
  2. package/CLAUDE.md +23 -19
  3. package/README.md +8 -5
  4. package/changelog/0.15.x/0.15.7.md +36 -0
  5. package/changelog/template.md +7 -7
  6. package/dist/config/server-config.d.ts +1 -0
  7. package/dist/config/server-config.d.ts.map +1 -1
  8. package/dist/config/server-config.js +7 -0
  9. package/dist/config/server-config.js.map +1 -1
  10. package/dist/index.js +5 -3
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp-server/resources/definitions/filing-types.resource.js +2 -2
  13. package/dist/mcp-server/resources/definitions/filing-types.resource.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts +8 -1
  15. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/company-search.tool.js +24 -8
  17. package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts +7 -0
  19. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +8 -0
  21. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/dataframe-query.tool.d.ts +31 -2
  23. package/dist/mcp-server/tools/definitions/dataframe-query.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/dataframe-query.tool.js +47 -5
  25. package/dist/mcp-server/tools/definitions/dataframe-query.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts +7 -0
  27. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js +8 -0
  29. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts +7 -0
  31. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/definitions/find-holders.tool.js +9 -1
  33. package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
  34. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts +7 -0
  35. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts.map +1 -1
  36. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +8 -0
  37. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
  38. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +7 -0
  39. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
  40. package/dist/mcp-server/tools/definitions/get-filing.tool.js +8 -0
  41. package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
  42. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts +7 -0
  43. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -1
  44. package/dist/mcp-server/tools/definitions/get-financials.tool.js +10 -0
  45. package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
  46. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts +8 -1
  47. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts.map +1 -1
  48. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +9 -1
  49. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
  50. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts +9 -2
  51. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
  52. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +19 -9
  53. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
  54. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +10 -3
  55. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
  56. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +25 -15
  57. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
  58. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts +7 -0
  59. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts.map +1 -1
  60. package/dist/mcp-server/tools/definitions/get-material-events.tool.js +18 -0
  61. package/dist/mcp-server/tools/definitions/get-material-events.tool.js.map +1 -1
  62. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts +7 -0
  63. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts.map +1 -1
  64. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +10 -0
  65. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -1
  66. package/dist/mcp-server/tools/definitions/index.d.ts +135 -12
  67. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  68. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +14 -4
  69. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
  70. package/dist/mcp-server/tools/definitions/search-filings.tool.js +37 -18
  71. package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
  72. package/dist/services/canvas-bridge/canvas-bridge.d.ts +4 -1
  73. package/dist/services/canvas-bridge/canvas-bridge.d.ts.map +1 -1
  74. package/dist/services/canvas-bridge/canvas-bridge.js +4 -1
  75. package/dist/services/canvas-bridge/canvas-bridge.js.map +1 -1
  76. package/dist/services/edgar/edgar-api-service.d.ts +29 -10
  77. package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
  78. package/dist/services/edgar/edgar-api-service.js +124 -28
  79. package/dist/services/edgar/edgar-api-service.js.map +1 -1
  80. package/package.json +7 -7
  81. package/server.json +17 -3
@@ -100,8 +100,15 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
100
100
  }, {
101
101
  readonly reason: "no_filings_found";
102
102
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
103
- readonly when: "No NPORT-P report exists for this fund, or none for the requested report_date";
103
+ readonly when: "No NPORT-P report exists for this fund, or none covers the report_date requested";
104
104
  readonly recovery: "Drop report_date to take the newest report, or use secedgar_search_filings with forms [\"NPORT-P\"] to see what the registrant has filed.";
105
+ }, {
106
+ readonly reason: "rate_limited";
107
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
108
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
109
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
110
+ readonly retryable: true;
111
+ readonly thrownBy: "service";
105
112
  }], {
106
113
  readonly as_of: import("zod").ZodString;
107
114
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
@@ -156,6 +163,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
156
163
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
157
164
  readonly when: "The query is ambiguous and matches several companies";
158
165
  readonly recovery: "Retry with a ticker symbol or the 10-digit CIK from the matches list.";
166
+ }, {
167
+ readonly reason: "rate_limited";
168
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
169
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
170
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
171
+ readonly retryable: true;
172
+ readonly thrownBy: "service";
159
173
  }], {
160
174
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
161
175
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -164,7 +178,7 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
164
178
  }> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
165
179
  query: import("zod").ZodString;
166
180
  include_filings: import("zod").ZodDefault<import("zod").ZodBoolean>;
167
- form_types: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
181
+ forms: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
168
182
  filing_limit: import("zod").ZodDefault<import("zod").ZodNumber>;
169
183
  filed_after: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
170
184
  filed_before: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
@@ -205,6 +219,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
205
219
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
206
220
  readonly when: "Query is ambiguous and matches several companies";
207
221
  readonly recovery: "Specify a ticker symbol for an exact match instead of a name fragment.";
222
+ }, {
223
+ readonly reason: "rate_limited";
224
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
225
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
226
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
227
+ readonly retryable: true;
228
+ readonly thrownBy: "service";
208
229
  }], {
209
230
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
210
231
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -213,8 +234,8 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
213
234
  }> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
214
235
  query: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
215
236
  forms: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
216
- start_date: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
217
- end_date: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
237
+ filed_after: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
238
+ filed_before: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"">, import("zod").ZodString]>>;
218
239
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
219
240
  offset: import("zod").ZodDefault<import("zod").ZodNumber>;
220
241
  sort: import("zod").ZodDefault<import("zod").ZodEnum<{
@@ -258,23 +279,26 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
258
279
  }, import("zod/v4/core").$strip>, readonly [{
259
280
  readonly reason: "invalid_date_range";
260
281
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
261
- readonly when: "Only one of start_date or end_date was provided";
262
- readonly recovery: "Provide both start_date and end_date, or omit both to search all dates.";
282
+ readonly when: "Only one of filed_after or filed_before was provided";
283
+ readonly recovery: "Provide both filed_after and filed_before, or omit both to search all dates.";
263
284
  }, {
264
285
  readonly reason: "unresolved_ticker";
265
286
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
266
287
  readonly when: "A ticker: targeting token in the query does not resolve to a known company";
267
288
  readonly recovery: "Verify the symbol with secedgar_company_search, or target by CIK with cik:<number> instead.";
289
+ readonly thrownBy: "service";
268
290
  }, {
269
291
  readonly reason: "invalid_cik";
270
292
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
271
293
  readonly when: "A cik: targeting token in the query is not a 1-10 digit number";
272
294
  readonly recovery: "Pass a numeric CIK such as cik:320193 — find it with secedgar_company_search if unknown.";
295
+ readonly thrownBy: "service";
273
296
  }, {
274
297
  readonly reason: "entity_not_found";
275
298
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
276
299
  readonly when: "A cik: targeting token on a pre-2001 date range names a CIK with no EDGAR submissions history";
277
300
  readonly recovery: "Confirm the CIK with secedgar_company_search — an accession-number prefix names the filing agent, not the issuer.";
301
+ readonly thrownBy: "service";
278
302
  }, {
279
303
  readonly reason: "missing_criteria";
280
304
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
@@ -285,6 +309,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
285
309
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
286
310
  readonly when: "A date range reaching before 2001-01-01 carries free-text terms with no entity scope — no pre-2001 full-text index exists, and nothing bounds a local scan";
287
311
  readonly recovery: "Add ticker: or cik: entity scope to the query, drop the text terms to browse by form and date, or start the range at 2001-01-01.";
312
+ }, {
313
+ readonly reason: "rate_limited";
314
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
315
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
316
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
317
+ readonly retryable: true;
318
+ readonly thrownBy: "service";
288
319
  }], {
289
320
  readonly effectiveQuery: import("zod").ZodString;
290
321
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
@@ -377,6 +408,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
377
408
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
378
409
  readonly when: "The section string did not match any detected heading in the document";
379
410
  readonly recovery: "Pick a heading from the outline in the error message, or use offset paging instead.";
411
+ }, {
412
+ readonly reason: "rate_limited";
413
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
414
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
415
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
416
+ readonly retryable: true;
417
+ readonly thrownBy: "service";
380
418
  }], {
381
419
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
382
420
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -446,6 +484,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
446
484
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
447
485
  readonly when: "Concept has data but the period_type filter excluded all of it";
448
486
  readonly recovery: "Switch period_type to \"quarterly\" or \"all\" for balance sheet items.";
487
+ }, {
488
+ readonly reason: "rate_limited";
489
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
490
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
491
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
492
+ readonly retryable: true;
493
+ readonly thrownBy: "service";
449
494
  }], {
450
495
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
451
496
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -520,8 +565,15 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
520
565
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
521
566
  readonly when: "The filer has no XBRL facts at all — pre-XBRL, foreign private issuer, or a non-operating registrant";
522
567
  readonly recovery: "Check the filer files XBRL financial statements, or read the filings directly with secedgar_search_filings.";
568
+ }, {
569
+ readonly reason: "rate_limited";
570
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
571
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
572
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
573
+ readonly retryable: true;
574
+ readonly thrownBy: "service";
523
575
  }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
524
- ticker_or_cik: import("zod").ZodString;
576
+ company: import("zod").ZodString;
525
577
  transaction_type: import("zod").ZodDefault<import("zod").ZodEnum<{
526
578
  all: "all";
527
579
  purchase: "purchase";
@@ -566,20 +618,27 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
566
618
  }, import("zod/v4/core").$strip>, readonly [{
567
619
  readonly reason: "company_not_found";
568
620
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
569
- readonly when: "The ticker or CIK does not resolve to a known company";
621
+ readonly when: "The company input does not resolve to a known company";
570
622
  readonly recovery: "Use secedgar_company_search to find the correct ticker or CIK.";
571
623
  }, {
572
624
  readonly reason: "no_filings_found";
573
625
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
574
626
  readonly when: "No Form 4 filings exist for this company in the recent submissions window";
575
627
  readonly recovery: "Use secedgar_search_filings with forms=[\"4\"] for broader historical coverage.";
628
+ }, {
629
+ readonly reason: "rate_limited";
630
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
631
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
632
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
633
+ readonly retryable: true;
634
+ readonly thrownBy: "service";
576
635
  }], {
577
636
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
578
637
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
579
638
  readonly shown: import("zod").ZodOptional<import("zod").ZodNumber>;
580
639
  readonly cap: import("zod").ZodOptional<import("zod").ZodNumber>;
581
640
  }> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
582
- ticker_or_cik: import("zod").ZodString;
641
+ company: import("zod").ZodString;
583
642
  quarter: import("zod").ZodOptional<import("zod").ZodString>;
584
643
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
585
644
  offset: import("zod").ZodDefault<import("zod").ZodNumber>;
@@ -622,7 +681,7 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
622
681
  }, import("zod/v4/core").$strip>, readonly [{
623
682
  readonly reason: "company_not_found";
624
683
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
625
- readonly when: "The ticker or CIK does not resolve to a known company or institution";
684
+ readonly when: "The company input does not resolve to a known company or institution";
626
685
  readonly recovery: "Use secedgar_company_search to find the correct CIK or full entity name.";
627
686
  }, {
628
687
  readonly reason: "ambiguous_entity";
@@ -639,6 +698,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
639
698
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
640
699
  readonly when: "The 13F-HR filing was found but the information table XML document could not be located";
641
700
  readonly recovery: "Use secedgar_get_filing with the accession number to inspect the filing documents directly.";
701
+ }, {
702
+ readonly reason: "rate_limited";
703
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
704
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
705
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
706
+ readonly retryable: true;
707
+ readonly thrownBy: "service";
642
708
  }], {
643
709
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
644
710
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -688,6 +754,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
688
754
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
689
755
  readonly when: "The issuer name matches several EDGAR companies and no cusip was given";
690
756
  readonly recovery: "Retry with the ticker or the 10-digit CIK of the intended issuer from the matches list.";
757
+ }, {
758
+ readonly reason: "rate_limited";
759
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
760
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
761
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
762
+ readonly retryable: true;
763
+ readonly thrownBy: "service";
691
764
  }], {
692
765
  readonly ordering: import("zod").ZodString;
693
766
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
@@ -767,6 +840,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
767
840
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
768
841
  readonly when: "The issuer has no structured SCHEDULE 13D/13G filings matching the requested form kind";
769
842
  readonly recovery: "Use secedgar_search_filings with forms [\"SC 13D\",\"SC 13G\"] to reach the pre-2024-12-18 text filings, then read them with secedgar_get_filing.";
843
+ }, {
844
+ readonly reason: "rate_limited";
845
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
846
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
847
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
848
+ readonly retryable: true;
849
+ readonly thrownBy: "service";
770
850
  }], {
771
851
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
772
852
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -837,6 +917,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
837
917
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
838
918
  readonly when: "Concept resolves but no companies report this metric for the requested period and unit";
839
919
  readonly recovery: "Check duration vs instant period, unit, and that the period exists post-CY2009.";
920
+ }, {
921
+ readonly reason: "rate_limited";
922
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
923
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
924
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
925
+ readonly retryable: true;
926
+ readonly thrownBy: "service";
840
927
  }], {
841
928
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
842
929
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -914,6 +1001,13 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
914
1001
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
915
1002
  readonly when: "Companies resolved but not one of them reports any of the requested concepts for the requested period type";
916
1003
  readonly recovery: "Switch period_type, or discover reported concept names with secedgar_search_concepts.";
1004
+ }, {
1005
+ readonly reason: "rate_limited";
1006
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
1007
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
1008
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
1009
+ readonly retryable: true;
1010
+ readonly thrownBy: "service";
917
1011
  }], {
918
1012
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
919
1013
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -1005,26 +1099,55 @@ export declare function buildToolDefinitions(options: ToolDefinitionOptions): (i
1005
1099
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1006
1100
  readonly when: "The SQL query references a denied DuckDB system catalog (information_schema, pg_catalog, sqlite_master, duckdb_*)";
1007
1101
  readonly recovery: "Query only df_<id> tables. Use secedgar_dataframe_describe to list available dataframes.";
1102
+ readonly thrownBy: "service";
1008
1103
  }, {
1009
1104
  readonly reason: "missing_table";
1010
1105
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1011
1106
  readonly when: "The SQL query references a df_<id> table that does not exist or has expired";
1012
1107
  readonly recovery: "Use secedgar_dataframe_describe to list available dataframes and verify the table name.";
1108
+ readonly thrownBy: "service";
1013
1109
  }, {
1014
1110
  readonly reason: "invalid_sql";
1015
1111
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1016
- readonly when: "The SQL statement contains a syntax or execution error not covered by a more specific reason";
1112
+ readonly when: "The SELECT fails to prepare — an unknown column or an invalid expression — or hits an engine error no more specific reason covers";
1017
1113
  readonly recovery: "Check SQL syntax, column names, and table references against secedgar_dataframe_describe.";
1114
+ readonly thrownBy: "service";
1115
+ }, {
1116
+ readonly reason: "sql_execution_error";
1117
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1118
+ readonly when: "The SELECT prepared but failed on the data it read — a cast or conversion that does not fit, an out-of-range value, or invalid input to a function";
1119
+ readonly recovery: "Wrap the failing cast in TRY_CAST, or filter out the rows the error message names before converting them.";
1120
+ readonly thrownBy: "service";
1018
1121
  }, {
1019
1122
  readonly reason: "register_as_clash";
1020
1123
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1021
1124
  readonly when: "The register_as target name already exists on the canvas";
1022
1125
  readonly recovery: "Drop the existing dataframe with secedgar_dataframe_drop (when enabled), choose a different df_XXXXX_XXXXX name, or omit register_as.";
1126
+ readonly thrownBy: "service";
1023
1127
  }, {
1024
1128
  readonly reason: "non_select_statement";
1025
1129
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1026
- readonly when: "The SQL is a non-SELECT statement (DROP, INSERT, UPDATE, DDL, etc.) — only read-only SELECTs run against dataframes";
1130
+ readonly when: "The SQL is not a SELECT (DROP, INSERT, UPDATE, DDL, PRAGMA, EXPLAIN, etc.) or does not parse — only read-only SELECTs run against dataframes";
1027
1131
  readonly recovery: "Query only SELECT statements against df_<id> tables. Use secedgar_dataframe_describe to inspect available dataframes.";
1132
+ readonly thrownBy: "service";
1133
+ }, {
1134
+ readonly reason: "multi_statement";
1135
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1136
+ readonly when: "The SQL holds more than one statement";
1137
+ readonly recovery: "Send exactly one SELECT statement per call, and split multi-statement SQL into separate calls.";
1138
+ readonly thrownBy: "service";
1139
+ }, {
1140
+ readonly reason: "denied_function";
1141
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1142
+ readonly when: "The SQL calls a file-reading or external-data table function such as read_csv, read_parquet, or glob";
1143
+ readonly recovery: "Remove the file-reading function and query only the df_<id> tables secedgar_dataframe_describe lists.";
1144
+ readonly thrownBy: "service";
1145
+ }, {
1146
+ readonly reason: "plan_operator_not_allowed";
1147
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1148
+ readonly when: "The query plan uses an operator outside the read-only allowlist, such as the range() or generate_series() table functions";
1149
+ readonly recovery: "Rewrite with read-only SELECT constructs — joins, aggregates, window functions, CTEs, and unnest() are supported.";
1150
+ readonly thrownBy: "service";
1028
1151
  }], {
1029
1152
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
1030
1153
  readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqBH,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BlE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqBH,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BlE"}
@@ -10,8 +10,8 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
10
  export declare const searchFilingsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
11
  query: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
12
12
  forms: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
- start_date: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
14
- end_date: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
13
+ filed_after: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
14
+ filed_before: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
15
15
  limit: z.ZodDefault<z.ZodNumber>;
16
16
  offset: z.ZodDefault<z.ZodNumber>;
17
17
  sort: z.ZodDefault<z.ZodEnum<{
@@ -55,23 +55,26 @@ export declare const searchFilingsTool: import("@cyanheads/mcp-ts-core").ToolDef
55
55
  }, z.core.$strip>, readonly [{
56
56
  readonly reason: "invalid_date_range";
57
57
  readonly code: JsonRpcErrorCode.ValidationError;
58
- readonly when: "Only one of start_date or end_date was provided";
59
- readonly recovery: "Provide both start_date and end_date, or omit both to search all dates.";
58
+ readonly when: "Only one of filed_after or filed_before was provided";
59
+ readonly recovery: "Provide both filed_after and filed_before, or omit both to search all dates.";
60
60
  }, {
61
61
  readonly reason: "unresolved_ticker";
62
62
  readonly code: JsonRpcErrorCode.ValidationError;
63
63
  readonly when: "A ticker: targeting token in the query does not resolve to a known company";
64
64
  readonly recovery: "Verify the symbol with secedgar_company_search, or target by CIK with cik:<number> instead.";
65
+ readonly thrownBy: "service";
65
66
  }, {
66
67
  readonly reason: "invalid_cik";
67
68
  readonly code: JsonRpcErrorCode.ValidationError;
68
69
  readonly when: "A cik: targeting token in the query is not a 1-10 digit number";
69
70
  readonly recovery: "Pass a numeric CIK such as cik:320193 — find it with secedgar_company_search if unknown.";
71
+ readonly thrownBy: "service";
70
72
  }, {
71
73
  readonly reason: "entity_not_found";
72
74
  readonly code: JsonRpcErrorCode.NotFound;
73
75
  readonly when: "A cik: targeting token on a pre-2001 date range names a CIK with no EDGAR submissions history";
74
76
  readonly recovery: "Confirm the CIK with secedgar_company_search — an accession-number prefix names the filing agent, not the issuer.";
77
+ readonly thrownBy: "service";
75
78
  }, {
76
79
  readonly reason: "missing_criteria";
77
80
  readonly code: JsonRpcErrorCode.ValidationError;
@@ -82,6 +85,13 @@ export declare const searchFilingsTool: import("@cyanheads/mcp-ts-core").ToolDef
82
85
  readonly code: JsonRpcErrorCode.ValidationError;
83
86
  readonly when: "A date range reaching before 2001-01-01 carries free-text terms with no entity scope — no pre-2001 full-text index exists, and nothing bounds a local scan";
84
87
  readonly recovery: "Add ticker: or cik: entity scope to the query, drop the text terms to browse by form and date, or start the range at 2001-01-01.";
88
+ }, {
89
+ readonly reason: "rate_limited";
90
+ readonly code: JsonRpcErrorCode.RateLimited;
91
+ readonly when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs";
92
+ readonly recovery: "Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.";
93
+ readonly retryable: true;
94
+ readonly thrownBy: "service";
85
95
  }], {
86
96
  readonly effectiveQuery: z.ZodString;
87
97
  readonly notice: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"search-filings.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-filings.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAIjB,MAAM,+BAA+B,CAAC;AA0lBvC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAslB5B,CAAC"}
1
+ {"version":3,"file":"search-filings.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-filings.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAIjB,MAAM,+BAA+B,CAAC;AA0lBvC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0mB5B,CAAC"}
@@ -465,26 +465,29 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
465
465
  {
466
466
  reason: 'invalid_date_range',
467
467
  code: JsonRpcErrorCode.ValidationError,
468
- when: 'Only one of start_date or end_date was provided',
469
- recovery: 'Provide both start_date and end_date, or omit both to search all dates.',
468
+ when: 'Only one of filed_after or filed_before was provided',
469
+ recovery: 'Provide both filed_after and filed_before, or omit both to search all dates.',
470
470
  },
471
471
  {
472
472
  reason: 'unresolved_ticker',
473
473
  code: JsonRpcErrorCode.ValidationError,
474
474
  when: 'A ticker: targeting token in the query does not resolve to a known company',
475
475
  recovery: 'Verify the symbol with secedgar_company_search, or target by CIK with cik:<number> instead.',
476
+ thrownBy: 'service',
476
477
  },
477
478
  {
478
479
  reason: 'invalid_cik',
479
480
  code: JsonRpcErrorCode.ValidationError,
480
481
  when: 'A cik: targeting token in the query is not a 1-10 digit number',
481
482
  recovery: 'Pass a numeric CIK such as cik:320193 — find it with secedgar_company_search if unknown.',
483
+ thrownBy: 'service',
482
484
  },
483
485
  {
484
486
  reason: 'entity_not_found',
485
487
  code: JsonRpcErrorCode.NotFound,
486
488
  when: 'A cik: targeting token on a pre-2001 date range names a CIK with no EDGAR submissions history',
487
489
  recovery: 'Confirm the CIK with secedgar_company_search — an accession-number prefix names the filing agent, not the issuer.',
490
+ thrownBy: 'service',
488
491
  },
489
492
  {
490
493
  reason: 'missing_criteria',
@@ -498,6 +501,14 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
498
501
  when: 'A date range reaching before 2001-01-01 carries free-text terms with no entity scope — no pre-2001 full-text index exists, and nothing bounds a local scan',
499
502
  recovery: 'Add ticker: or cik: entity scope to the query, drop the text terms to browse by form and date, or start the range at 2001-01-01.',
500
503
  },
504
+ {
505
+ reason: 'rate_limited',
506
+ code: JsonRpcErrorCode.RateLimited,
507
+ when: "SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs",
508
+ recovery: 'Wait the retryAfter seconds the error carries, then retry — SEC lifts the block only once requests stop for ten minutes.',
509
+ retryable: true,
510
+ thrownBy: 'service',
511
+ },
501
512
  ],
502
513
  input: z.object({
503
514
  query: z
@@ -515,7 +526,7 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
515
526
  .array(z.string())
516
527
  .optional()
517
528
  .describe('Filter to specific form types (e.g., ["10-K", "10-Q", "8-K"]). Without this, searches all form types. Note: "10-K" also matches amendments filed as 10-K/A. SEC renamed the blockholder schedules on 2024-12-18 — filings before that date are "SC 13D"/"SC 13G", filings after are "SCHEDULE 13D"/"SCHEDULE 13G" — so a filter spanning that boundary must list both spellings. Ownership forms (3, 4, 5) are indexed by the reporting person (e.g., "LEVINSON ARTHUR D"), not the issuer — rows carry no transaction code, share count, or price. Use secedgar_get_insider_transactions to retrieve parsed ownership XML with person, relationship, transaction code, shares, and price.'),
518
- start_date: z
529
+ filed_after: z
519
530
  .union([
520
531
  z.literal(''),
521
532
  z
@@ -524,8 +535,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
524
535
  .describe('YYYY-MM-DD'),
525
536
  ])
526
537
  .optional()
527
- .describe('Start of date range (YYYY-MM-DD). Both start_date and end_date must be provided for date filtering.'),
528
- end_date: z
538
+ .describe('Only include filings filed on or after this date (YYYY-MM-DD). This tool filters by date only with both bounds — pair it with filed_before.'),
539
+ filed_before: z
529
540
  .union([
530
541
  z.literal(''),
531
542
  z
@@ -534,7 +545,7 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
534
545
  .describe('YYYY-MM-DD'),
535
546
  ])
536
547
  .optional()
537
- .describe('End of date range (YYYY-MM-DD). Both start_date and end_date must be provided for date filtering.'),
548
+ .describe('Only include filings filed on or before this date (YYYY-MM-DD). This tool filters by date only with both bounds — pair it with filed_after.'),
538
549
  limit: z.number().int().min(1).max(100).default(20).describe('Results per page. Max 100.'),
539
550
  offset: z
540
551
  .number()
@@ -548,6 +559,14 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
548
559
  .default('filing_date_desc')
549
560
  .describe('Result ordering. "filing_date_desc" (default) returns most recent first. "filing_date_asc" returns oldest first. "relevance" returns SEC\'s native search-score order, which weights term match strength over recency. Date sorts re-order the top 100 hits returned by the search index — for broad queries with more than 100 matches and no entity targeting, date-newest filings may sit outside that window. Entity targeting (ticker:/cik:) or a narrower query keeps matches inside the window when absolute recency matters. On the no-query browse path (forms/entity only), EFTS has no relevance signal — every hit scores null — and returns filings in natural date-descending order, so all sort modes effectively yield newest-first. Pre-2001 archive results carry no relevance score either, so relevance collapses to date-descending there.'),
550
561
  }),
562
+ // This tool's former date spellings, and other spellings in use across tools (#115).
563
+ inputAliases: {
564
+ start_date: 'filed_after',
565
+ date_from: 'filed_after',
566
+ end_date: 'filed_before',
567
+ date_to: 'filed_before',
568
+ form_types: 'forms',
569
+ },
551
570
  output: z.object({
552
571
  total: z
553
572
  .number()
@@ -632,8 +651,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
632
651
  }),
633
652
  async handler(input, ctx) {
634
653
  // Validate date range: both or neither
635
- if ((input.start_date && !input.end_date) || (!input.start_date && input.end_date)) {
636
- throw ctx.fail('invalid_date_range', 'Both start_date and end_date are required when filtering by date.', { ...ctx.recoveryFor('invalid_date_range') });
654
+ if ((input.filed_after && !input.filed_before) || (!input.filed_after && input.filed_before)) {
655
+ throw ctx.fail('invalid_date_range', 'Both filed_after and filed_before are required when filtering by date.', { ...ctx.recoveryFor('invalid_date_range') });
637
656
  }
638
657
  // Browse mode (#79): EFTS accepts a forms-only or entity-scoped request with no
639
658
  // full-text term, but rejects one with neither ("Blank search not valid"). Guard
@@ -652,8 +671,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
652
671
  // indexes filings from 2001, so a range reaching earlier is served from the
653
672
  // archives — entirely, or (when it also reaches 2001 onward) as the older half
654
673
  // of a two-source merge split at the floor (#77, #87).
655
- const startDate = input.start_date || undefined;
656
- const endDate = input.end_date || undefined;
674
+ const startDate = input.filed_after || undefined;
675
+ const endDate = input.filed_before || undefined;
657
676
  const hasFreeText = query.trim().length > 0;
658
677
  if (startDate && endDate && startDate < EFTS_FULLTEXT_FLOOR) {
659
678
  const straddles = endDate >= EFTS_FULLTEXT_FLOOR;
@@ -730,8 +749,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
730
749
  query: hasFreeText ? query : undefined,
731
750
  entity_cik: entityCik,
732
751
  forms: input.forms,
733
- start_date: startDate,
734
- end_date: endDate,
752
+ filed_after: startDate,
753
+ filed_before: endDate,
735
754
  source: straddles ? 'efts+archive' : entityCik ? 'submissions' : 'full-index',
736
755
  },
737
756
  effectiveQuery: straddles
@@ -760,8 +779,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
760
779
  query,
761
780
  forms: input.forms,
762
781
  ciks: entityCik ? [entityCik] : undefined,
763
- startDate: input.start_date,
764
- endDate: input.end_date,
782
+ startDate: input.filed_after,
783
+ endDate: input.filed_before,
765
784
  from: fetchFrom,
766
785
  size: fetchSize,
767
786
  });
@@ -830,8 +849,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
830
849
  queryParams: {
831
850
  query,
832
851
  forms: input.forms,
833
- start_date: input.start_date,
834
- end_date: input.end_date,
852
+ filed_after: input.filed_after,
853
+ filed_before: input.filed_before,
835
854
  entity_cik: entityCik,
836
855
  source: 'efts',
837
856
  },
@@ -861,8 +880,8 @@ export const searchFilingsTool = tool('secedgar_search_filings', {
861
880
  criteria.push(`entity CIK ${entityCik}`);
862
881
  if (input.forms?.length)
863
882
  criteria.push(`forms [${input.forms.join(', ')}]`);
864
- if (input.start_date && input.end_date) {
865
- criteria.push(`dates ${input.start_date} to ${input.end_date}`);
883
+ if (input.filed_after && input.filed_before) {
884
+ criteria.push(`dates ${input.filed_after} to ${input.filed_before}`);
866
885
  }
867
886
  const criteriaText = criteria.length > 0 ? criteria.join(', ') : 'the given criteria';
868
887
  ctx.enrich.notice(`No filings matched ${criteriaText}. Broaden the query, remove the form filter, or widen the date range.`);