@cyanheads/secedgar-mcp-server 0.20.1 → 0.21.1

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 (126) hide show
  1. package/AGENTS.md +33 -26
  2. package/CLAUDE.md +33 -26
  3. package/README.md +23 -12
  4. package/changelog/0.21.x/0.21.0.md +35 -0
  5. package/changelog/0.21.x/0.21.1.md +29 -0
  6. package/dist/mcp-server/prompts/definitions/company-analysis.prompt.js +3 -3
  7. package/dist/mcp-server/prompts/definitions/company-analysis.prompt.js.map +1 -1
  8. package/dist/mcp-server/tools/annual-report-reads.d.ts +53 -0
  9. package/dist/mcp-server/tools/annual-report-reads.d.ts.map +1 -0
  10. package/dist/mcp-server/tools/annual-report-reads.js +145 -0
  11. package/dist/mcp-server/tools/annual-report-reads.js.map +1 -0
  12. package/dist/mcp-server/tools/blockquote.d.ts +13 -0
  13. package/dist/mcp-server/tools/blockquote.d.ts.map +1 -0
  14. package/dist/mcp-server/tools/blockquote.js +18 -0
  15. package/dist/mcp-server/tools/blockquote.js.map +1 -0
  16. package/dist/mcp-server/tools/calendar-quarter.d.ts +22 -0
  17. package/dist/mcp-server/tools/calendar-quarter.d.ts.map +1 -0
  18. package/dist/mcp-server/tools/calendar-quarter.js +34 -0
  19. package/dist/mcp-server/tools/calendar-quarter.js.map +1 -0
  20. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/company-search.tool.js +10 -21
  22. package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts +12 -2
  24. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +120 -29
  26. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/find-holders.tool.js +9 -16
  29. package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts +31 -9
  31. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +268 -88
  33. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
  34. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +10 -0
  35. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
  36. package/dist/mcp-server/tools/definitions/get-filing.tool.js +164 -10
  37. package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
  38. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts +1 -0
  39. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -1
  40. package/dist/mcp-server/tools/definitions/get-financials.tool.js +219 -128
  41. package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
  42. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +2 -3
  44. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
  45. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts +44 -0
  46. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +336 -75
  48. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
  49. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +12 -0
  50. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
  51. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +16 -31
  52. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
  53. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts +15 -0
  54. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts.map +1 -1
  55. package/dist/mcp-server/tools/definitions/get-material-events.tool.js +107 -54
  56. package/dist/mcp-server/tools/definitions/get-material-events.tool.js.map +1 -1
  57. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts +5 -0
  58. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts.map +1 -1
  59. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +48 -17
  60. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -1
  61. package/dist/mcp-server/tools/definitions/index.d.ts +526 -464
  62. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  63. package/dist/mcp-server/tools/definitions/search-concepts.tool.js +1 -1
  64. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +16 -0
  65. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
  66. package/dist/mcp-server/tools/definitions/search-filings.tool.js +194 -70
  67. package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
  68. package/dist/mcp-server/tools/filing-dates.d.ts +48 -0
  69. package/dist/mcp-server/tools/filing-dates.d.ts.map +1 -0
  70. package/dist/mcp-server/tools/filing-dates.js +99 -0
  71. package/dist/mcp-server/tools/filing-dates.js.map +1 -0
  72. package/dist/mcp-server/tools/limit-clamp.d.ts.map +1 -1
  73. package/dist/mcp-server/tools/limit-clamp.js +6 -2
  74. package/dist/mcp-server/tools/limit-clamp.js.map +1 -1
  75. package/dist/services/edgar/body-text-decoder.d.ts +33 -0
  76. package/dist/services/edgar/body-text-decoder.d.ts.map +1 -0
  77. package/dist/services/edgar/body-text-decoder.js +103 -0
  78. package/dist/services/edgar/body-text-decoder.js.map +1 -0
  79. package/dist/services/edgar/call-scope.d.ts +9 -0
  80. package/dist/services/edgar/call-scope.d.ts.map +1 -1
  81. package/dist/services/edgar/call-scope.js +3 -0
  82. package/dist/services/edgar/call-scope.js.map +1 -1
  83. package/dist/services/edgar/concept-map.d.ts.map +1 -1
  84. package/dist/services/edgar/concept-map.js +70 -12
  85. package/dist/services/edgar/concept-map.js.map +1 -1
  86. package/dist/services/edgar/concept-series.d.ts +126 -9
  87. package/dist/services/edgar/concept-series.d.ts.map +1 -1
  88. package/dist/services/edgar/concept-series.js +217 -21
  89. package/dist/services/edgar/concept-series.js.map +1 -1
  90. package/dist/services/edgar/edgar-api-service.d.ts +31 -15
  91. package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
  92. package/dist/services/edgar/edgar-api-service.js +182 -36
  93. package/dist/services/edgar/edgar-api-service.js.map +1 -1
  94. package/dist/services/edgar/eight-k-items.d.ts +19 -1
  95. package/dist/services/edgar/eight-k-items.d.ts.map +1 -1
  96. package/dist/services/edgar/eight-k-items.js +24 -1
  97. package/dist/services/edgar/eight-k-items.js.map +1 -1
  98. package/dist/services/edgar/filing-headers.d.ts +22 -10
  99. package/dist/services/edgar/filing-headers.d.ts.map +1 -1
  100. package/dist/services/edgar/filing-headers.js +98 -15
  101. package/dist/services/edgar/filing-headers.js.map +1 -1
  102. package/dist/services/edgar/filing-to-text.d.ts +13 -6
  103. package/dist/services/edgar/filing-to-text.d.ts.map +1 -1
  104. package/dist/services/edgar/filing-to-text.js +23 -3
  105. package/dist/services/edgar/filing-to-text.js.map +1 -1
  106. package/dist/services/edgar/fiscal-periods.d.ts +14 -1
  107. package/dist/services/edgar/fiscal-periods.d.ts.map +1 -1
  108. package/dist/services/edgar/fiscal-periods.js +47 -18
  109. package/dist/services/edgar/fiscal-periods.js.map +1 -1
  110. package/dist/services/edgar/form4-amendments.d.ts +63 -0
  111. package/dist/services/edgar/form4-amendments.d.ts.map +1 -0
  112. package/dist/services/edgar/form4-amendments.js +99 -0
  113. package/dist/services/edgar/form4-amendments.js.map +1 -0
  114. package/dist/services/edgar/mirror/companyfacts-sync.d.ts +6 -1
  115. package/dist/services/edgar/mirror/companyfacts-sync.d.ts.map +1 -1
  116. package/dist/services/edgar/mirror/companyfacts-sync.js +29 -6
  117. package/dist/services/edgar/mirror/companyfacts-sync.js.map +1 -1
  118. package/dist/services/edgar/ownership-parser.d.ts +24 -0
  119. package/dist/services/edgar/ownership-parser.d.ts.map +1 -1
  120. package/dist/services/edgar/ownership-parser.js +82 -0
  121. package/dist/services/edgar/ownership-parser.js.map +1 -1
  122. package/dist/services/edgar/types.d.ts +5 -1
  123. package/dist/services/edgar/types.d.ts.map +1 -1
  124. package/package.json +3 -3
  125. package/server.json +3 -3
  126. package/skills/secedgar-guide/SKILL.md +11 -7
package/README.md CHANGED
@@ -44,7 +44,7 @@ SEC EDGAR filings, financials, and ownership data. Look up companies by ticker,
44
44
  | `secedgar_get_insider_transactions` | Form 4 / 4-A insider transactions parsed from ownership XML, of an issuer's insiders or of one insider across issuers |
45
45
  | `secedgar_get_institutional_holdings` | 13F-HR quarterly holdings of one institutional manager |
46
46
  | `secedgar_find_holders` | Reverse 13F lookup: which managers reported holding an issuer |
47
- | `secedgar_get_beneficial_owners` | 5%+ blockholders of an issuer from structured SCHEDULE 13D / 13G filings |
47
+ | `secedgar_get_beneficial_owners` | 5%+ blockholders of an issuer from structured SCHEDULE 13D / 13G filings, or a holder's own 13D/13G stakes across issuers (`role: "filer"`) |
48
48
  | `secedgar_get_fund_holdings` | ETF and mutual fund portfolio holdings from the quarterly NPORT-P report |
49
49
  | `secedgar_fetch_frames` | One XBRL concept × one period across every reporting company |
50
50
  | `secedgar_compare_companies` | Compare named companies across several concepts, aligned on fiscal years or calendar quarters |
@@ -94,8 +94,9 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
94
94
  - Full-text `query` (phrases, `OR`, `-exclusion`, `wildcard*`, and one `ticker:` / `cik:` term to scope it, which fails as `unsupported_entity_scope` when led by `-` or `NOT` or joined by a second), or browse by `forms` and/or entity with no query; `filed_after` / `filed_before` work alone (a lone `filed_after` runs through today, a lone `filed_before` starts at 2001-01-01, or at 1993-01-01 before 2001); `limit` up to 100 (default 20; a value up to 1,000 is served at 100), `offset` up to 9,999, with `next_offset` naming the next page; only `sort: "relevance"` on a 2001-onward search without `ticker:` / `cik:` scope pages EDGAR server-side, where offsets reach 9,900 (a page of 100 there ends at its 10,000-document cap) and a deeper one fails as `offset_out_of_range`
95
95
  - Full text covers 2001 onward; earlier ranges back to 1993 come from the archives, where free text needs `ticker:` / `cik:` scope and reads up to 50 documents (`scan` reports the counts)
96
96
  - `ticker:` takes the spellings `secedgar_company_search` resolves, and `effectiveQuery` names the CIK it scoped to and how a market-data spelling was read (`CIK 0001334933, UEC.N read as UEC (URANIUM ENERGY CORP)`)
97
+ - 8-K and 8-K/A rows carry `items`, decoded as `secedgar_get_material_events` decodes them (`[]` when EDGAR records none; absent on other forms and on full-index rows, whose index lists none), and the dataframe adds `item_codes`, `item_labels`, and `item_regime` (null on rows without items), so a cross-company item screen filters its `item_codes`
97
98
  - One row per filing, tagged with `source` (`efts`, `submissions`, `full-index`); full-text rows list `matched_documents` (filenames for `secedgar_get_filing`); the response carries `total`, `form_distribution`, `total_is_exact`, and `total_documents` for full-text searches
98
- - `next_offset` is the next page's offset (in documents under `sort: "relevance"`, in the call's assembled filings elsewhere) and is absent on the last page; a relevance page is last when `offset + limit` reaches an exact `total_documents`. `truncated` and the paging notice appear only when filings lie past the page; when no `next_offset` reaches them (a date-sorted or entity window short of the match set, an archive or scan cap, offset 9,900), the notice says how to narrow
99
+ - `next_offset` is the next page's offset (in `offset`'s unit: documents under `sort: "relevance"` on an unscoped 2001-onward search that is not split by forms, the call's assembled filings elsewhere) and is absent on the last page; a relevance page is last when `offset + limit` reaches an exact `total_documents`. `truncated` and the paging notice appear only when filings lie past the page; when no `next_offset` reaches them (a date-sorted or entity window short of the match set, an archive or scan cap, offset 9,900), the notice says how to narrow
99
100
 
100
101
  ---
101
102
 
@@ -108,15 +109,17 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
108
109
  - A structured XML form the filer's submissions feed records through SEC's stylesheet (a recent Form 4, SCHEDULE 13D, or NPORT-P) reads as SEC renders it, with its labels and line breaks, so `section` reaches its Items; `documents` still lists the raw XML, which `document` returns as filed. A holdings report whose raw file passes 600 KB reads as filed
109
110
  - A 2000–2001 document the archive doesn't serve under its listed name (`0001.htm`) is read under its accession-prefixed name, and `document` takes either spelling; if neither is served, the full submission `<accession>.txt` is read instead and the notice says so
110
111
  - Without `cik`, the filer is found through EDGAR full-text search and the accession number's prefix, then, when none of those directories serves the filing, through the filers on the filing's index page — so a pre-2001 filing made through a filing agent resolves on its own, and a full-text search outage falls back instead of failing the call
112
+ - `later_filings` lists, oldest first, the filings after this one that amend or withdraw it, read from the submissions feed's recent window with no added request: the `/A` of a 10-K, 10-KT, 10-Q, 10-QT, 20-F, or 40-F for the same period, or the `/A` or `RW` of an S-1, S-3, S-4, S-11, F-1, F-3, F-4, F-6, F-10, SF-1, or SF-3 under the same `333-` file number; the notice names them, and for a filing outside the window says how far back the window reached, whether or not it names one. A registration statement outside the window is checked on the `333-` number of the resolved filer's party block in its SEC header (a co-registrant's own suffixed number, matched exactly). It says nothing was looked for when the period cannot be read, when the filer has no `333-` number (none in the header, a number outside the `333-` series, or a feed that records no file numbers), or when the filing is newer than the cached feed, and it names a same-day amendment of such a filing as of unknown order
111
113
  - A filing EDGAR shows exists (full-text search lists it, or its index page answers) whose archive listing answers 404 under every CIK tried fails `filing_not_served`, retryable, rather than `filing_not_found`, with or without `cik`; `filing_not_found` means no EDGAR source lists the accession
112
114
 
113
115
  ---
114
116
 
115
117
  ### `secedgar_get_financials` <sub>tool</sub>
116
118
 
117
- - `company` (ticker or CIK) plus `concept` as a friendly name or raw XBRL tag; `taxonomy` `us-gaap` (default), `ifrs-full`, or `dei`; `period_type` `annual`, `quarterly`, or `all`; `unit` picks one SEC unit key (`ZAR`, `USD`, `USD/EUR`) when a concept is reported in several; `limit` 1–100 trims the inline series
119
+ - `company` (ticker or CIK) plus `concept` as a friendly name or raw XBRL tag; `taxonomy` `us-gaap` (default), `ifrs-full`, or `dei`; `period_type` `annual`, `quarterly`, `all`, or `ytd` (year-to-date values from 10-Q, 10-QT, and 6-K durations longer than a quarter and shorter than a year, keyed by `start` / `end` and never mixed with calendar-period rows); `unit` picks one SEC unit key (`ZAR`, `USD`, `USD/EUR`) when a concept is reported in several; `limit` 1–100 trims the inline series
118
120
  - Returns a deduplicated series, newest first, one value per calendar period with `form`, `filed`, `accession_number`, and `tag`, all in one `unit` (other units are named in `caveats`); `tags_tried` lists the tags checked, and an empty result fails as `no_concept_data`, `no_frame_data`, `no_period_data`, or `no_unit_data`
119
121
  - When the filer reports a related us-gaap tag past where the concept's own tags stop (`ProfitLoss` for `net_income`, which includes noncontrolling interests), `caveats` name it with its newest period in place of the generic staleness caveat, and the `no_concept_data` and `no_frame_data` hints name it; values never change, and passing the tag as `concept` reads it. Related tags are never read under `ifrs-full` or `dei`
122
+ - Under `taxonomy: "ifrs-full"` the call also reads the filer's submissions feed once and, when SEC's XBRL data holds none of the statement facts of the filer's newest annual report (20-F or 40-F), adds a caveat saying so and pointing to `secedgar_get_filing`; a failed read only drops the caveat
120
123
  - A friendly name matches in any case or separator form, in lowerCamelCase (`operatingIncome`), or spelled from its label (`capital_expenditures` for `capex`); a `concept` that is neither a friendly name nor an UpperCamelCase tag fails as `unknown_concept`, with a formula for standard combinations (`free_cash_flow`, `ebitda`, `working_capital`) or up to three closest friendly names
121
124
 
122
125
  ---
@@ -124,7 +127,9 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
124
127
  ### `secedgar_get_snapshot` <sub>tool</sub>
125
128
 
126
129
  - `company`, `taxonomy` `us-gaap` (default) or `ifrs-full`, and `period_type` `annual`, `quarterly`, or `both` (default); one companyfacts read covers every supported concept, and nothing is staged as a dataframe
127
- - Each `lines` entry reports the latest `annual` and `quarterly` value for a duration concept, or the latest `instant` value for balance-sheet and entity-info concepts, each with the `tag` it came from, under the line's `taxonomy`; concepts the filer doesn't report land in `gaps` with `tags_tried`; a line or gap whose related tag the filer reports past it gets a concept-prefixed `caveats` entry naming that tag
130
+ - Each `lines` entry reports the latest `annual` and `quarterly` value for a duration concept, or the latest `instant` value for balance-sheet and entity-info concepts, each with the `tag` it came from, under the line's `taxonomy`; concepts the filer doesn't report land in `gaps` with `tags_tried`, and a gap the other taxonomy answers adds `retry_taxonomy` and `retry_tag`, the value to pass as `taxonomy` and the tag it resolves to there; a line or gap whose related tag the filer reports past it gets a concept-prefixed `caveats` entry naming that tag
131
+ - Under `taxonomy: "ifrs-full"` the call reads the filer's submissions feed once more, and a caveat says when SEC's XBRL data holds none of the statement facts of the newest annual report (the newest values then come from earlier filings)
132
+ - When the other taxonomy carries the filer's statements through a later period than the requested one, the first `caveats` entry says to retry with it (a 20-F filer read under `us-gaap` whose statements run on under `ifrs-full`)
128
133
 
129
134
  ---
130
135
 
@@ -132,6 +137,7 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
132
137
 
133
138
  - `company` plus up to 20 `items` codes, dotted (`2.02`) since 2004-08-23 and single integers (`12`) before; the two regimes don't overlap, so pair them across the changeover; `filed_after` / `filed_before` work alone and reach into the archive; `limit` 1–1,000, served at 100 (default 20)
134
139
  - Each filing decodes its `items` to `code`, `label`, and `regime` (`current` / `legacy`); `item_distribution` counts every code in the window, and `total_8k_scanned` against `total_matched` shows what the filter removed
140
+ - A scan that finds no 8-K says how far it read, and when the rows read hold Form 6-K reports (a foreign private issuer files 6-K in place of 8-K) it counts them and gives the `secedgar_search_filings` call that lists them
135
141
  - A date window reads up to 10 archive pages; `history_scanned_through` reports how far the scan reached, `older_filings_unexamined` whether older filings went unread, and `dataset.truncated` whether pages in the window did
136
142
 
137
143
  ---
@@ -141,7 +147,10 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
141
147
  - `company` is the issuer, as a ticker, CIK, or current or former name, or with `role: "reporting_owner"` the insider who filed (a person resolves only by CIK); `role` is `issuer` (default) or `reporting_owner`, which reads the Form 4s that CIK filed as an insider across every issuer and takes the person and relationship from the owner entry matching it; a name matching several companies fails as `ambiguous_company`, listing up to 10 by CIK, name, and ticker to retry with, plus the full count in `total_matches`; `transaction_type` `purchase` (code P), `sale` (code S), or `all` (default); `limit` 1–1,000, served at 100 (default 20); does not cover Forms 3 or 5
142
148
  - Without a date window it scans up to 100 of the newest Form 4 / 4-A filings; `filed_after` / `filed_before` (inclusive, either alone) read any period since mid-2003, up to 100 filings
143
149
  - The scan reads whole filing dates: without a canvas it stops at the end of the date on which `limit` is met, a date that would carry it past the scan cap is left to the next call, and one date holding more Form 4s than the cap is read up to it. `history_scanned_through` is the oldest filing date reached, on every call that reached a Form 4. When Form 4s remain past it, the notice ends with the way on: `filed_before=<the day before>`; `filed_before=<that date>` with a note to dedupe on `accession_number`, for a date over a scan cap below 100 or a dated walk the 10-page archive cap ended; or, when an undated scan read the whole recent window and archive pages exist, the same `filed_before` worded "may exist". Without a canvas, when `limit` cuts `transactions`, the notice resumes at the filing date of the first row cut and says the rows shown from that date repeat and the next call's rows for it replace them
144
- - Each transaction carries the reporting person, relationship, `transaction_code` and `transaction_type`, `is_derivative`, unsigned `shares_traded` with `direction` (`acquire` / `dispose`), price per share, and shares owned after; `dataset.truncated` means Form 4 filings exist, or may exist, past those read, and `filings_other_issuer` counts Form 4s the company filed as a reporting owner of another issuer, which add no rows (the notice points to `role: "reporting_owner"`, which reads them; the count is 0 under it). Under `reporting_owner` each transaction also carries `issuer_cik`, `issuer_name`, and `issuer_ticker`, and `role` is echoed; dataframe rows carry the three issuer columns under both roles. The top-level issuer name comes from the submissions document when SEC's ticker file has none. Price text preserves the numeric digits in fixed-point notation, with at least two decimal places.
150
+ - Each transaction carries the reporting person, relationship, `transaction_code` and `transaction_type`, `is_derivative`, unsigned `shares_traded` with `direction` (`acquire` / `dispose`), price per share, and shares owned after; `dataset.truncated` means Form 4 filings exist, or may exist, past those read, and `filings_other_issuer` counts Form 4s the company filed as a reporting owner of another issuer, which add no rows (the notice points to `role: "reporting_owner"`, which reads them; the count is 0 under it). Most of them are recognized by the submissions feed's file number without being read, so `filings_scanned`, which includes them, can exceed the 100 filings one call reads. Under `reporting_owner` each transaction also carries `issuer_cik`, `issuer_name`, and `issuer_ticker`, and `role` is echoed; dataframe rows carry the three issuer columns under both roles. The top-level issuer name comes from the submissions document when SEC's ticker file has none. Price text preserves the numeric digits in fixed-point notation, with at least two decimal places.
151
+ - Rows carry `rule10b5_1`, the filing's `aff10b5One` box: one value for every row of the filing, including rows no plan covers, and absent when the filing has no box (filings before April 2023) or another value. Rows carry `footnotes: [{id, field}]` in filing order, where `field` names the output field the citing element annotates (`securityTitle` → `security_title`, `transactionDate` → `transaction_date`, `transactionCoding` → `transaction_code`, `transactionShares` → `shares_traded`, `transactionAcquiredDisposedCode` → `direction`, `transactionPricePerShare` → `price_per_share`, `sharesOwnedFollowingTransaction` → `shares_owned_after`, `directOrIndirectOwnership` → `ownership_type`, `natureOfOwnership` → `ownership_nature`; any other element takes its snake_case name). Top-level `footnote_texts: [{accession_number, id, text}]` lists each footnote an inline row cites once per filing, uncut; footnotes cited only by rows `limit` cuts appear only in the dataframe. `content[]` shows `| Rule 10b5-1: true|false` on each row's Code line, a `Footnotes:` line per row, and a closing `Footnotes in <accession>:` section with each text as a blockquote
152
+ - A joint filing is one row per transaction: `reporting_person` is the first owner listed (under `reporting_owner`, the one with the filer's CIK), `reporting_person_cik` its CIK, and `joint_filers` the other owners with CIK and relationship, since the XML ties no transaction to one owner (the dataframe's `joint_filers` column lists them as `Name (CIK x, relationship)` joined by `; `, NULL on a single-owner filing)
153
+ - Rows carry `form` (`4` or `4/A`); a 4/A row adds `amends_filing_date`, and a row of the original Form 4 that a 4/A in the scan restates carries `amended_by`, the 4/A's accession, so a net-activity sum adds `WHERE amended_by IS NULL` to count the trade once, as corrected. The notice names each pair, and flags the cases it cannot settle, naming the `filed_after` or `filed_before` that reaches an original outside the window: a 4/A that states no original date or matches several Form 4s, two 4/As amending one Form 4, a 4/A row matching no row of its original, and a restated key shared by several rows, none of which carries `amended_by`
145
154
 
146
155
  ---
147
156
 
@@ -166,11 +175,13 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
166
175
 
167
176
  ### `secedgar_get_beneficial_owners` <sub>tool</sub>
168
177
 
169
- - `issuer` is the company being held; `form_kind` `all` (default), `13D`, or `13G`; `include_amendments` (default true); `limit` 1–20 matching parsed filings (default 10; up to 1,000 is served at 20). The newest-first scan examines at most 50 documents, excluding schedules naming another issuer; exclusions and failed documents do not consume `limit`
178
+ - `issuer` is the company being held, or with `role: "filer"` the holder whose own schedules to read (a holder with no ticker resolves only by CIK); `role` is `issuer` (default) or `filer`; `form_kind` `all` (default), `13D`, or `13G`; `include_amendments` (default true); `filed_after` / `filed_before` (inclusive filing dates, either alone) and `offset` (default 0, the matching schedules to skip, newest first by filing date, acceptance time, then accession number); `limit` 1–20 matching parsed filings (default 10; up to 1,000 is served at 20). The newest-first scan examines at most 50 documents, excluding schedules naming another issuer; exclusions and failed documents do not consume `limit`
179
+ - A window reads the recent submissions, then archive pages newest first, up to 10 pages, from the later of `filed_after` and 2024-12-18; a window ending before that date reads no page and says structured coverage starts then. Without a window, `offset` pages the recent submissions only. A truncated result ends with `To continue, repeat the call with filed_before=<date> and offset=<n>, its other arguments unchanged`; when the page cap stopped the scan, the notice names the filing date it reached and no `limit` lever is offered. A window with no match is a success with a notice, and `offset` past every match says so
170
180
  - Each filing lists `reporting_persons` with voting power, dispositive power, and `percent_of_class` per person, which joint filers report for the same shares, so they don't sum; a 13D carries `purpose_of_transaction`, a 13G has none
171
181
  - `purpose_of_transaction` and each person's `notes` come back as filed, line breaks included, up to 5,000 and 2,000 characters; a longer value keeps its first characters and sets `purpose_truncated` or `notes_truncated`, and the notice points to the whole text in the dataframe's `purpose_of_transaction` and `notes` columns or through `secedgar_get_filing`
172
- - Coverage starts 2024-12-18 with the structured XML schedules; `legacy_filings_before_coverage` counts the issuer's older `SC 13D` / `SC 13G` text filings
173
- - `total_structured_filings` partitions into `filings_examined` + `filings_not_examined`; examined documents partition into `filings_parsed` + `filings_excluded_other_issuer` + `filings_failed.length`. Failed accessions carry `document_not_found` (404) or `unparseable` (including missing issuer identity), and set `partial`. `truncated` means indexed schedules remain unexamined after the result limit or scan ceiling, independently of failures
182
+ - The submissions feed lists each schedule under both its subject and its filer, and each role reads its own side by `fileNumber` before any document is read, counting the other side for its notice; under `role: "filer"` each filing carries its subject as `issuer_cik` / `issuer_name`, the dataframe's `issuer_*` columns name each schedule's subject, and a co-reporting person named only on another filer's cover page is found with `secedgar_search_filings` on its quoted 10-digit CIK. A side with no schedules while the other holds some is a zero-filing success, and `no_filings_found` means both are empty on an undated call
183
+ - Coverage starts 2024-12-18 with the structured XML schedules; `legacy_filings_before_coverage` counts the role's side of older `SC 13D` / `SC 13G` text filings
184
+ - `total_structured_filings`, counted on the role's side, partitions into `filings_examined` + `filings_not_examined`; examined documents partition into `filings_parsed` + `filings_excluded_other_issuer` + `filings_failed.length`. Failed accessions carry `document_not_found` (404) or `unparseable` (including missing issuer identity), and set `partial`. `truncated` means indexed schedules remain unexamined after the result limit or scan ceiling, or the 10-page archive cap stopped a windowed scan, independently of failures. With a window the totals count the role's matches from `offset` on in the pages read
174
185
 
175
186
  ---
176
187
 
@@ -193,8 +204,8 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
193
204
  ### `secedgar_compare_companies` <sub>tool</sub>
194
205
 
195
206
  - 2–10 `companies` × 1–8 `concepts` (up to 100 of each are accepted: the first 10 companies and first 8 distinct concepts are compared, and the rest come back unread in `deferred_companies` / `deferred_concepts`, with a notice naming the re-calls that compare them); `taxonomy` `us-gaap` (default) or `ifrs-full`; `period_type` `annual` (default) or `quarterly`; `periods` 1–12 (default 4; up to 1,000 is served at 12), trimmed further when the inline matrix gets too large
196
- - `cells` align each value on a calendar `period` and keep its `frame`, `period_end`, and source `tag`; a call with no comparable annual data fails `no_comparable_data`
197
- - `failed_companies` (reason `not_found`, `ambiguous`, or `no_company_facts`) and `gaps` report what's missing, and `caveats` flag differing period ends and unit mismatches between companies, a related tag a company reports past a concept's series, and say how a ticker spelling EDGAR doesn't list was read (`UEC.N read as UEC (URANIUM ENERGY CORP)`); a company named twice (a ticker and its CIK) is read once, under the first input
207
+ - Under `taxonomy: "ifrs-full"` each company's submissions feed is read once, and a company-prefixed caveat says when SEC's XBRL data holds none of the statement facts of its newest annual report; `cells` align each value on a calendar `period` and keep its `frame`, `period_end`, and source `tag`; a call with no comparable annual data fails `no_comparable_data`, whose hint lists what the payloads support, in order: the taxonomy to retry with, any related tag to pass as a raw concept (with `period_type` only when the requested one holds none of its periods), then `period_type: "quarterly"` for off-year-end snapshots
208
+ - `failed_companies` (reason `not_found`, `ambiguous`, or `no_company_facts`) and `gaps` report what's missing, a gap the other taxonomy answers adding `retry_taxonomy` and `retry_tag`, and `caveats` flag differing period ends and unit mismatches between companies, a related tag a company reports past a concept's series, a company whose statements run further under the other taxonomy (company-prefixed, to compare in a separate call since `taxonomy` applies to every company in one call), and say how a ticker spelling EDGAR doesn't list was read (`UEC.N read as UEC (URANIUM ENERGY CORP)`); a company named twice (a ticker and its CIK) is read once, under the first input
198
209
  - An unrecognized concept is listed in `unknown_concepts` with a hint; the call fails as `unknown_concept` only when every concept is unrecognized
199
210
 
200
211
  ---
@@ -245,7 +256,7 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
245
256
  ### `secedgar_company_analysis` <sub>prompt</sub>
246
257
 
247
258
  - Arguments: `company` required; `focus_areas` optional free text
248
- - Returns one user message with a numbered workflow (company search, a financial profile via `secedgar_get_snapshot` with trends via `secedgar_get_financials`, filing review, material events, and a peer comparison via `secedgar_compare_companies` with `secedgar_fetch_frames` for a market-wide ranking) and a findings template; insider, institutional, or blockholder terms in `focus_areas` add those ownership steps, and "ownership" adds all three
259
+ - Returns one user message with a numbered workflow (company search, a financial profile via `secedgar_get_snapshot` with trends via `secedgar_get_financials`, filing review, material events, and a peer comparison via `secedgar_compare_companies` with `secedgar_fetch_frames` for a market-wide ranking) and a findings template; the workflow points a 20-F or 40-F filer at `taxonomy: "ifrs-full"` and its 6-Ks, and says to compare IFRS and us-gaap peers in separate calls; insider, institutional, or blockholder terms in `focus_areas` add those ownership steps, and "ownership" adds all three
249
260
 
250
261
  ## Features
251
262
 
@@ -264,7 +275,7 @@ Agent-friendly output:
264
275
  - In-conversation SQL: any tool whose response carries a `dataset` field has staged its full result as a DuckDB dataframe (`df_<id>`), while the inline list stays capped at `limit`; inspect it with `secedgar_dataframe_describe`, then query it with `secedgar_dataframe_query`
265
276
  - Discriminated outputs and explicit gaps: `source` on filing-search rows, `search_mode`, 8-K item `regime`, typed `failed_companies` reasons, and `gaps` with `tags_tried` in place of zero-filled values
266
277
  - Completeness disclosure: `history_scanned_through`, `older_filings_unexamined`, `total_is_exact`, `publication_lag_days`, and `dataset.truncated` tell agents how deep a scan went and what it left out
267
- - One parameter name per concept: `company`, `filed_after` / `filed_before`, and `forms` mean the same thing on every tool, and common alternate spellings (`ticker`, `cik`, `start_date`, `end_date`, `form_types`, and others) are accepted as aliases, as is `filing_limit` for `limit` on `secedgar_search_filings`, `secedgar_get_material_events`, and `secedgar_get_beneficial_owners`, where `limit` counts filings
278
+ - One parameter name per concept: `company`, `filed_after` / `filed_before`, and `forms` mean the same thing on every tool, and common alternate spellings (`ticker`, `cik`, `start_date`, `end_date`, `form_types`, and others) are accepted as aliases, as is `filing_limit` for `limit` on `secedgar_search_filings`, `secedgar_get_material_events`, and `secedgar_get_beneficial_owners`, where `limit` counts filings. A date bound must be a real calendar day, and a `filed_after` later than `filed_before` fails `invalid_arguments` before any request, naming the field; `secedgar_get_institutional_holdings` fails a malformed `quarter` as `invalid_quarter`
268
279
 
269
280
  ## Getting started
270
281
 
@@ -0,0 +1,35 @@
1
+ ---
2
+ summary: "The debt concept reads LongTermDebtNoncurrent only (breaking: a filer tagging only LongTermDebt now fails no_concept_data); get_insider_transactions marks joint filers and 4/A restatements; get_filing names later amendments; get_beneficial_owners reads a holder's own 13D/13G stakes; dividends_per_share is a concept."
3
+ breaking: true
4
+ security: false
5
+ ---
6
+
7
+ # 0.21.0 — 2026-12-03
8
+
9
+ ## Added
10
+
11
+ - **`secedgar_get_beneficial_owners` takes `role: "filer"`** ([#276](https://github.com/cyanheads/secedgar-mcp-server/issues/276)). It reads the SCHEDULE 13D/13G a CIK filed across issuers, each filing adding `issuer_cik` and `issuer_name`, and leads its unread-schedules notice with `limit: <n>` when one call can read them all. The default `issuer` role also selects its side of the feed by `fileNumber` before reading, so it no longer parses a company's own schedules only to drop them.
12
+ - **`secedgar_get_filing` returns `later_filings`** ([#268](https://github.com/cyanheads/secedgar-mcp-server/issues/268)): the `/A` of a periodic report's period, or the `/A` or `RW` of a registration statement, from the submissions feed it already reads. The notice says when amendments were not looked for: the period, `333-` file number, or filing date is unreadable; the filing predates the feed's recent window; or the feed omits the filing, which is then placed by its filing date, with same-day amendments named as of unknown order.
13
+ - **`secedgar_search_filings` 8-K and 8-K/A rows carry decoded `items`** ([#277](https://github.com/cyanheads/secedgar-mcp-server/issues/277)), inline, in `content[]`, and as dataframe columns `item_codes`, `item_labels`, and `item_regime`, so a cross-company item screen filters the dataframe.
14
+ - **`dividends_per_share` concept** ([#278](https://github.com/cyanheads/secedgar-mcp-server/issues/278)): `CommonStockDividendsPerShareDeclared`, with `CommonStockDividendsPerShareCashPaid` filling the periods it lacks; `ifrs-full` reads `DividendsRecognisedAsDistributionsToOwnersPerShare`, then `DividendsPaidOrdinarySharesPerShare`.
15
+ - **`secedgar_get_snapshot` and `secedgar_compare_companies` name the taxonomy that answers a gap** ([#271](https://github.com/cyanheads/secedgar-mcp-server/issues/271)): gap rows gain optional `retry_taxonomy` and `retry_tag`, and a caveat names the taxonomy where the filer's statements run later.
16
+
17
+ ## Changed
18
+
19
+ - **Breaking: `debt` reads `LongTermDebtNoncurrent` only, labeled "Long-Term Debt (Excluding Current Maturities)"** ([#270](https://github.com/cyanheads/secedgar-mcp-server/issues/270)). A filer that tags only `LongTermDebt`, banks among them, now fails `secedgar_get_financials` `no_concept_data` where 0.20.1 answered (confirmed on Bank of America, Citigroup, JPMorgan Chase, and Wells Fargo); the hint names `LongTermDebt`, and passing it as a raw `concept` reads that tag in one call. A filer whose `LongTermDebtNoncurrent` series stopped years ago now gets that older series with the related-tag caveat, and values move for filers that reported the two tags with different figures. `secedgar_compare_companies` fails `no_comparable_data` when no company tags the noncurrent concept, its hint naming the related tag to retry as a raw concept, and `secedgar_fetch_frames` with `debt` reads the `LongTermDebtNoncurrent` frame.
20
+ - **`secedgar_get_insider_transactions` skips Form 4s the company filed as another issuer's owner before reading them** ([#265](https://github.com/cyanheads/secedgar-mcp-server/issues/265)), using the feed's `fileNumber`. The scan cap and canvas floor count the company's own Form 4s; `filings_scanned` and `filings_other_issuer` count the skipped rows.
21
+ - **The `secedgar_company_analysis` prompt tells a 20-F or 40-F filer's analysis to pass `taxonomy: "ifrs-full"`** and to compare IFRS and us-gaap peers in separate calls ([#271](https://github.com/cyanheads/secedgar-mcp-server/issues/271)).
22
+ - **`skills/secedgar-guide` 1.1 → 1.2.**
23
+
24
+ ## Fixed
25
+
26
+ - **The companyfacts mirror ingest keeps filers whose `cik` is a digit string** ([#263](https://github.com/cyanheads/secedgar-mcp-server/issues/263)). Closed-period `secedgar_fetch_frames` answers omitted them; the next `mirror:refresh` adds them with no migration, and an entry naming no filer is counted in the completion log.
27
+ - **`secedgar_get_insider_transactions` rows add `reporting_person_cik` and `joint_filers`** ([#264](https://github.com/cyanheads/secedgar-mcp-server/issues/264)). A joint Form 4 stays one row per transaction under its first owner, and the other owners no longer vanish.
28
+ - **`secedgar_get_insider_transactions` rows add `form`, `amends_filing_date`, and `amended_by`** ([#267](https://github.com/cyanheads/secedgar-mcp-server/issues/267)). A row a Form 4/A in the scan restates carries `amended_by`, so net activity adds `WHERE amended_by IS NULL`; the notice names each pair and each case it left unmarked.
29
+ - **`secedgar_get_financials`, `secedgar_get_snapshot`, and `secedgar_compare_companies` caveat an annual report SEC's XBRL data lacks under `ifrs-full`** ([#269](https://github.com/cyanheads/secedgar-mcp-server/issues/269)), and `secedgar_get_financials` measures staleness against the filer's newest reported period where it fires.
30
+ - **Impossible dates, a `filed_after` later than `filed_before`, and a malformed `quarter` fail before any request** ([#272](https://github.com/cyanheads/secedgar-mcp-server/issues/272)): `invalid_arguments` naming the field, and `invalid_quarter` from `secedgar_get_institutional_holdings`. Every advertised `inputSchema` is unchanged.
31
+ - **`secedgar_get_filing` decodes a text response in the charset it declares** ([#273](https://github.com/cyanheads/secedgar-mcp-server/issues/273)), so Form 144's ISO-8859-1 rendering no longer reads back U+FFFD.
32
+ - **`secedgar_get_material_events` counts a foreign private issuer's 6-K filings in its no-8-K notice** and no longer advises widening a range the scan already covered ([#274](https://github.com/cyanheads/secedgar-mcp-server/issues/274)).
33
+ - **`secedgar_get_filing` `section` lands on the section rather than a merger proxy summary's page-reference line** ([#275](https://github.com/cyanheads/secedgar-mcp-server/issues/275)).
34
+ - **`withLimitClamps` uses `safeExtend`**, so a deployment with `EDGAR_CLAMP_OVERSIZED_LIMITS=false` keeps refined inputs instead of throwing at startup.
35
+ - **`secedgar_find_holders` answers an empty result for a `quarter` in years 0000–0008**, where 0.20.1 sent EDGAR full-text search an unpadded year and failed `efts_degraded_response`.
@@ -0,0 +1,29 @@
1
+ ---
2
+ summary: "get_financials returns year-to-date facts with period_type ytd, insider rows carry the Rule 10b5-1 flag and footnotes, get_beneficial_owners takes a filed_after / filed_before window, and a search_filings forms list naming a base form and another form's amendment returns rows."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.21.1 — 2026-12-05
8
+
9
+ ## Added
10
+
11
+ - **`secedgar_get_financials` takes `period_type: "ytd"`** ([#284](https://github.com/cyanheads/secedgar-mcp-server/issues/284)). It returns year-to-date values, the 10-Q, 10-QT, and 6-K durations longer than a quarter, keyed by `start` / `end`, so Q2 and Q3 cash-flow quarters derive by subtraction. A quarterly series with only Q1 in recent years names `ytd` in a caveat.
12
+ - **`secedgar_get_insider_transactions` rows carry `rule10b5_1` and `footnotes`** ([#285](https://github.com/cyanheads/secedgar-mcp-server/issues/285)). `rule10b5_1` is the filing's `aff10b5One` box; `footnotes` lists `{id, field}` references, and `footnote_texts` gives each cited footnote's text once per filing.
13
+ - **`secedgar_get_beneficial_owners` takes `filed_after`, `filed_before`, and `offset`** ([#279](https://github.com/cyanheads/secedgar-mcp-server/issues/279)). A window reaches schedules past the newest ones; a truncated result names the `filed_before` and `offset` that continue it.
14
+ - **`secedgar_get_filing` checks later filings of a registration statement read from outside the feed window** ([#282](https://github.com/cyanheads/secedgar-mcp-server/issues/282)), by the filer's file number from the filing header.
15
+
16
+ ## Changed
17
+
18
+ - **Best-effort side reads yield their pacer slot to primary reads** ([#283](https://github.com/cyanheads/secedgar-mcp-server/issues/283)). The IFRS annual-report check and `secedgar_get_financials`' related-tag read wait until no primary read is queued and leave unsent after a bounded wait, so under load the answer can omit their caveat.
19
+ - **`skills/secedgar-guide` 1.2 → 1.3.**
20
+
21
+ ## Fixed
22
+
23
+ - **`secedgar_search_filings` returns rows for a `forms` list naming a base form and another form's amendment** ([#286](https://github.com/cyanheads/secedgar-mcp-server/issues/286)), such as `["10-K", "8-K/A"]`. A listed `X/A` whose base is listed is dropped, so `["10-K", "10-K/A"]` keeps the base form, and a list still mixing base and `/A` forms runs as two full-text searches, merged.
24
+ - **Filing-header parsing stays linear in the header's length.**
25
+
26
+ ## Dependencies
27
+
28
+ - `domutils` ^4.0.2 → ^4.1.2
29
+ - `@biomejs/biome` ^2.6.9 → ^2.6.10
@@ -23,8 +23,8 @@ export const companyAnalysisPrompt = prompt('secedgar_company_analysis', {
23
23
  const wantsBlockholders = /blockholder|activist|beneficial|13[\s-]?[dg]|stake|ownership/.test(focus);
24
24
  const steps = [
25
25
  '**Company Identification** — Use `secedgar_company_search` to resolve the company and review recent filings.',
26
- '**Financial Trends** — Use `secedgar_get_snapshot` for the latest value of every supported concept in one call, then `secedgar_get_financials` for the 3-5 year trend of the lines that matter most (for example revenue, net_income, eps_diluted, debt, operating_cash_flow).',
27
- '**Recent Filings Review** — Use `secedgar_get_filing` to read the most recent 10-K or 10-Q for qualitative insights (risk factors, MD&A, business overview).',
26
+ '**Financial Trends** — Use `secedgar_get_snapshot` for the latest value of every supported concept in one call, then `secedgar_get_financials` for the 3-5 year trend of the lines that matter most (for example revenue, net_income, eps_diluted, debt, operating_cash_flow). For a 20-F or 40-F filer that reports under IFRS, pass `taxonomy: "ifrs-full"` to both.',
27
+ '**Recent Filings Review** — Use `secedgar_get_filing` to read the most recent 10-K or 10-Q, or a foreign private issuer’s 20-F or 40-F annual report and recent 6-Ks, for qualitative insights (risk factors, MD&A, business overview).',
28
28
  '**Material Events** — Use `secedgar_get_material_events` to surface recent 8-K filings with their item codes decoded, narrowing to the events that matter (`items: ["1.01"]` for material agreements, `["2.02"]` for results, `["5.02"]` for officer changes, `["4.02"]` for non-reliance).',
29
29
  ];
30
30
  if (wantsInsider) {
@@ -36,7 +36,7 @@ export const companyAnalysisPrompt = prompt('secedgar_company_analysis', {
36
36
  if (wantsBlockholders) {
37
37
  steps.push("**Blockholders** — Use `secedgar_get_beneficial_owners` for the 5%-and-over stakes, reading each reporting person separately (percent of class is per person, so joint filers do not sum). A 13D carries the holder's stated purpose of the transaction; a 13G is the passive form and has none. Structured coverage starts 2024-12-18 — the response counts the earlier text filings, which `secedgar_search_filings` finds and `secedgar_get_filing` reads.");
38
38
  }
39
- steps.push('**Industry Context** — Choose a few comparable companies and use `secedgar_compare_companies` with this company and those peers as `companies` (2-10 in all) and the key metrics as `concepts` (up to 8), aligned on fiscal years (or calendar quarters). To see where one metric ranks across every reporting company in a single period, use `secedgar_fetch_frames`.');
39
+ steps.push('**Industry Context** — Choose a few comparable companies and use `secedgar_compare_companies` with this company and those peers as `companies` (2-10 in all) and the key metrics as `concepts` (up to 8), aligned on fiscal years (or calendar quarters). `taxonomy` applies to every company in one call, so compare IFRS and us-gaap peers in separate calls. To see where one metric ranks across every reporting company in a single period, use `secedgar_fetch_frames`.');
40
40
  const findings = [
41
41
  '- **Company Overview** — entity details, industry, fiscal year',
42
42
  '- **Financial Summary** — key metrics table with trends',
@@ -1 +1 @@
1
- {"version":3,"file":"company-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/company-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,2BAA2B,EAAE;IACvE,WAAW,EAAE,mKAAmK;IAEhL,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QACtF,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,8HAA8H,CAC/H;KACJ,CAAC;IAEF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,oFAAoF;QACpF,qFAAqF;QACrF,sFAAsF;QACtF,kEAAkE;QAClE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACrD,MAAM,YAAY,GAAG,0CAA0C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,kBAAkB,GAAG,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3E,MAAM,iBAAiB,GAAG,8DAA8D,CAAC,IAAI,CAC3F,KAAK,CACN,CAAC;QAEF,MAAM,KAAK,GAAa;YACtB,8GAA8G;YAC9G,gRAAgR;YAChR,8JAA8J;YAC9J,6RAA6R;SAC9R,CAAC;QACF,IAAI,YAAY,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CACR,oVAAoV,CACrV,CAAC;QACJ,CAAC;QACD,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CACR,kTAAkT,CACnT,CAAC;QACJ,CAAC;QACD,IAAI,iBAAiB,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CACR,+bAA+b,CAChc,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CACR,yWAAyW,CAC1W,CAAC;QAEF,MAAM,QAAQ,GAAa;YACzB,gEAAgE;YAChE,yDAAyD;YACzD,yDAAyD;YACzD,kEAAkE;SACnE,CAAC;QACF,IAAI,YAAY,IAAI,kBAAkB,IAAI,iBAAiB,EAAE,CAAC;YAC5D,QAAQ,CAAC,IAAI,CACX,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAClF,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAElF,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,iCAAiC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;wBACpH,EAAE;wBACF,kCAAkC;wBAClC,EAAE;wBACF,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC9C,EAAE;wBACF,sBAAsB;wBACtB,GAAG,QAAQ;qBACZ,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"company-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/company-analysis.prompt.ts"],"names":[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AM,QAAQ,GAAa;YACzB,gEAAgE;YAChE,yDAAyD;YACzD,yDAAyD;YACzD,kEAAkE;SACnE,CAAC;QACF,IAAI,YAAY,IAAI,kBAAkB,IAAI,iBAAiB,EAAE,CAAC;YAC5D,QAAQ,CAAC,IAAI,CACX,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAClF,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAElF,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,iCAAiC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;wBACpH,EAAE;wBACF,kCAAkC;wBAClC,EAAE;wBACF,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC9C,EAAE;wBACF,sBAAsB;wBACtB,GAAG,QAAQ;qBACZ,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @fileoverview The submissions-feed reads behind the #269 caveat: each filer's
3
+ * newest XBRL annual report, read best-effort beside a tool call's own XBRL reads
4
+ * under `taxonomy: "ifrs-full"`, so `get_snapshot`, `compare_companies`, and
5
+ * `get_financials` can say when SEC's XBRL data holds none of that report's
6
+ * statement facts. A tool-layer module: `concept-series` cannot import the service.
7
+ * @module mcp-server/tools/annual-report-reads
8
+ */
9
+ import type { Context } from '@cyanheads/mcp-ts-core';
10
+ import { type AnnualReport } from '../../services/edgar/concept-series.js';
11
+ import type { CompanyFactsResponse, ConceptTaxonomy } from '../../services/edgar/types.js';
12
+ /**
13
+ * How long the reads may run once the call's own reads have settled, beyond the
14
+ * pacer spacing each read can still wait behind: room for answered requests, so a
15
+ * slow or silent SEC adds at most this much to a call that is otherwise done.
16
+ */
17
+ export declare const ANNUAL_REPORT_GRACE_MS = 3000;
18
+ /**
19
+ * Best-effort reads of filers' newest XBRL annual reports (#269), one submissions
20
+ * feed per filer, only under `ifrs-full` — where SEC's XBRL data lacks IFRS annual
21
+ * reports filed from late March 2026 — and never in strict mirror mode, which sends
22
+ * nothing to SEC for these tools. Build it right after starting the call's own
23
+ * reads; with the local mirror on they start once those settle instead, since a
24
+ * point read for a filer the store holds reads the same feed into the service's
25
+ * cache first. Each request is a side read (#283): it waits behind the call's own
26
+ * reads and every other primary read queued in the pacer, so under contention it can
27
+ * wait out the deadline unsent and the call answers without the caveat, logging the
28
+ * same warning as a failed read. Each gets one attempt under a scope of its own — the
29
+ * caller's signal beside a deadline armed when the call's own reads settle — so a
30
+ * failure, a 404, or a stall only leaves a filer without a report, while the
31
+ * caller's cancel still fails the call.
32
+ */
33
+ export declare class AnnualReportReads {
34
+ #private;
35
+ constructor(ciks: readonly string[], taxonomy: ConceptTaxonomy, ctx: Context);
36
+ /**
37
+ * Awaits `own`, the call's own reads, then gives these reads until the deadline:
38
+ * {@link ANNUAL_REPORT_GRACE_MS} plus the pacer spacing of each one, which may
39
+ * still be queued behind them. Returns `own`'s value beside the report of each
40
+ * filer whose read answered in time. When `own` rejects, these reads end at once
41
+ * and its reason is thrown once they have settled, so nothing is left running.
42
+ */
43
+ settle<T>(own: Promise<T>): Promise<[T, ReadonlyMap<string, AnnualReport>]>;
44
+ /**
45
+ * One filer's companyfacts, read under the same scope and deadline after
46
+ * {@link settle} — `get_financials`, whose own reads are companyconcept reads;
47
+ * `undefined` when the read fails, finds nothing, or the deadline has passed.
48
+ * The deadline takes one more pacer gap, since this read queues behind the
49
+ * feed read as each feed read queues behind the one before it.
50
+ */
51
+ companyFacts(cik: string): Promise<CompanyFactsResponse | undefined>;
52
+ }
53
+ //# sourceMappingURL=annual-report-reads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annual-report-reads.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/annual-report-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,oCAAoC,CAAC;AAG/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,OAAQ,CAAC;AAO5C;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;;IAY5B,YAAY,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAU3E;IAED;;;;;;OAMG;IACG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAmBhF;IAED;;;;;;OAMG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAMzE;CA8CF"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @fileoverview The submissions-feed reads behind the #269 caveat: each filer's
3
+ * newest XBRL annual report, read best-effort beside a tool call's own XBRL reads
4
+ * under `taxonomy: "ifrs-full"`, so `get_snapshot`, `compare_companies`, and
5
+ * `get_financials` can say when SEC's XBRL data holds none of that report's
6
+ * statement facts. A tool-layer module: `concept-series` cannot import the service.
7
+ * @module mcp-server/tools/annual-report-reads
8
+ */
9
+ import { getServerConfig } from '../../config/server-config.js';
10
+ import { CallScope } from '../../services/edgar/call-scope.js';
11
+ import { newestXbrlAnnualReport } from '../../services/edgar/concept-series.js';
12
+ import { getEdgarApiService } from '../../services/edgar/edgar-api-service.js';
13
+ import { getEdgarMirror } from '../../services/edgar/mirror/index.js';
14
+ /**
15
+ * How long the reads may run once the call's own reads have settled, beyond the
16
+ * pacer spacing each read can still wait behind: room for answered requests, so a
17
+ * slow or silent SEC adds at most this much to a call that is otherwise done.
18
+ */
19
+ export const ANNUAL_REPORT_GRACE_MS = 3_000;
20
+ /** The spacing the service's pacer keeps between request starts. */
21
+ function pacerGapMs() {
22
+ return Math.ceil(1000 / getServerConfig().rateLimitRps);
23
+ }
24
+ /**
25
+ * Best-effort reads of filers' newest XBRL annual reports (#269), one submissions
26
+ * feed per filer, only under `ifrs-full` — where SEC's XBRL data lacks IFRS annual
27
+ * reports filed from late March 2026 — and never in strict mirror mode, which sends
28
+ * nothing to SEC for these tools. Build it right after starting the call's own
29
+ * reads; with the local mirror on they start once those settle instead, since a
30
+ * point read for a filer the store holds reads the same feed into the service's
31
+ * cache first. Each request is a side read (#283): it waits behind the call's own
32
+ * reads and every other primary read queued in the pacer, so under contention it can
33
+ * wait out the deadline unsent and the call answers without the caveat, logging the
34
+ * same warning as a failed read. Each gets one attempt under a scope of its own — the
35
+ * caller's signal beside a deadline armed when the call's own reads settle — so a
36
+ * failure, a 404, or a stall only leaves a filer without a report, while the
37
+ * caller's cancel still fails the call.
38
+ */
39
+ export class AnnualReportReads {
40
+ #ctx;
41
+ /** The filers to read, empty when the call reads none. */
42
+ #ciks;
43
+ #deadline = new AbortController();
44
+ #scope;
45
+ #reads;
46
+ /** Epoch ms the deadline fires at; 0 until the call's own reads settle. */
47
+ #deadlineAt = 0;
48
+ /** Set when the call's own reads failed and these were ended unwanted, which logs nothing. */
49
+ #abandoned = false;
50
+ constructor(ciks, taxonomy, ctx) {
51
+ this.#ctx = ctx;
52
+ const mirror = getEdgarMirror();
53
+ const read = taxonomy === 'ifrs-full' && !(mirror && !getServerConfig().mirrorFallbackLive);
54
+ this.#ciks = read ? ciks : [];
55
+ this.#scope = new CallScope(AbortSignal.any([ctx.signal, this.#deadline.signal]), {
56
+ singleAttempt: true,
57
+ sideRead: true,
58
+ });
59
+ if (!mirror)
60
+ this.#start();
61
+ }
62
+ /**
63
+ * Awaits `own`, the call's own reads, then gives these reads until the deadline:
64
+ * {@link ANNUAL_REPORT_GRACE_MS} plus the pacer spacing of each one, which may
65
+ * still be queued behind them. Returns `own`'s value beside the report of each
66
+ * filer whose read answered in time. When `own` rejects, these reads end at once
67
+ * and its reason is thrown once they have settled, so nothing is left running.
68
+ */
69
+ async settle(own) {
70
+ const [ownRead] = await Promise.allSettled([own]);
71
+ if (ownRead.status === 'rejected') {
72
+ this.#abandoned = true;
73
+ this.#deadline.abort(new DOMException('The call’s own reads failed', 'AbortError'));
74
+ await Promise.allSettled(this.#reads ?? []);
75
+ throw ownRead.reason;
76
+ }
77
+ const reports = new Map();
78
+ if (this.#ciks.length === 0)
79
+ return [ownRead.value, reports];
80
+ const reads = this.#start();
81
+ this.#deadlineAt = Date.now() + ANNUAL_REPORT_GRACE_MS + reads.length * pacerGapMs();
82
+ const settled = (await this.#beforeDeadline(() => Promise.allSettled(reads))) ?? [];
83
+ this.#ctx.signal.throwIfAborted();
84
+ for (const [index, read] of settled.entries()) {
85
+ const cik = this.#ciks[index];
86
+ if (cik && read.status === 'fulfilled' && read.value)
87
+ reports.set(cik, read.value);
88
+ }
89
+ return [ownRead.value, reports];
90
+ }
91
+ /**
92
+ * One filer's companyfacts, read under the same scope and deadline after
93
+ * {@link settle} — `get_financials`, whose own reads are companyconcept reads;
94
+ * `undefined` when the read fails, finds nothing, or the deadline has passed.
95
+ * The deadline takes one more pacer gap, since this read queues behind the
96
+ * feed read as each feed read queues behind the one before it.
97
+ */
98
+ async companyFacts(cik) {
99
+ if (this.#deadlineAt > Date.now())
100
+ this.#deadlineAt += pacerGapMs();
101
+ const read = await this.#beforeDeadline(() => this.#absorb(getEdgarApiService().tryGetCompanyFacts(cik, this.#scope), cik, 'companyfacts'));
102
+ return read ?? undefined;
103
+ }
104
+ /** Starts each filer's feed read once, returning the reads. */
105
+ #start() {
106
+ this.#reads ??= this.#ciks.map((cik) => this.#absorb(getEdgarApiService()
107
+ .getSubmissions(cik, this.#scope)
108
+ .then((submissions) => newestXbrlAnnualReport(submissions.filings.recent)), cik, 'submissions'));
109
+ return this.#reads;
110
+ }
111
+ /** Runs `work` with the deadline armed for what is left of it; nothing starts once it has passed. */
112
+ async #beforeDeadline(work) {
113
+ const leftMs = this.#deadlineAt - Date.now();
114
+ if (leftMs <= 0)
115
+ return;
116
+ const timer = setTimeout(() => {
117
+ this.#deadline.abort(new DOMException('Annual-report read deadline passed', 'TimeoutError'));
118
+ }, leftMs);
119
+ try {
120
+ return await work();
121
+ }
122
+ finally {
123
+ clearTimeout(timer);
124
+ }
125
+ }
126
+ /** `read`'s value, or `undefined` on any failure but the caller's cancel, which rethrows. */
127
+ async #absorb(read, cik, endpoint) {
128
+ try {
129
+ return await read;
130
+ }
131
+ catch (error) {
132
+ if (this.#ctx.signal.aborted)
133
+ throw error;
134
+ if (!this.#abandoned) {
135
+ this.#ctx.log.warning('annual-report read failed', {
136
+ cik,
137
+ endpoint,
138
+ error: error instanceof Error ? error.message : String(error),
139
+ });
140
+ }
141
+ return;
142
+ }
143
+ }
144
+ }
145
+ //# sourceMappingURL=annual-report-reads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annual-report-reads.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/annual-report-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAqB,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,kCA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AC,CAAC;QACX,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,EAAE,CAAC;QACtB,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,6FAA6F;IAC7F,KAAK,CAAC,OAAO,CAAI,IAAgB,EAAE,GAAW,EAAE,QAAgB;QAC9D,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;gBAAE,MAAM,KAAK,CAAC;YAC1C,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBACrB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,2BAA2B,EAAE;oBACjD,GAAG;oBACH,QAAQ;oBACR,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC9D,CAAC,CAAC;YACL,CAAC;YACD,OAAO;QACT,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Filer-written text as Markdown blockquote lines.
3
+ * @module mcp-server/tools/blockquote
4
+ */
5
+ /**
6
+ * Filer-written text as the lines of a Markdown blockquote that a CommonMark parse reads back
7
+ * as `text` (CR and CRLF as LF): escaped, then every line of the escaped value prefixed `> `
8
+ * under `indent`. The escape writes each line break as a hard break, so the quote stays one
9
+ * paragraph. The caller follows the quote with a blank line before anything else it writes,
10
+ * or the next line would continue the quote.
11
+ */
12
+ export declare function blockquote(text: string, indent?: string): string[];
13
+ //# sourceMappingURL=blockquote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/blockquote.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,EAAE,CAI9D"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview Filer-written text as Markdown blockquote lines.
3
+ * @module mcp-server/tools/blockquote
4
+ */
5
+ import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
6
+ /**
7
+ * Filer-written text as the lines of a Markdown blockquote that a CommonMark parse reads back
8
+ * as `text` (CR and CRLF as LF): escaped, then every line of the escaped value prefixed `> `
9
+ * under `indent`. The escape writes each line break as a hard break, so the quote stays one
10
+ * paragraph. The caller follows the quote with a blank line before anything else it writes,
11
+ * or the next line would continue the quote.
12
+ */
13
+ export function blockquote(text, indent = '') {
14
+ return escapeMarkdownInline(text)
15
+ .split('\n')
16
+ .map((line) => `${indent}> ${line}`);
17
+ }
18
+ //# sourceMappingURL=blockquote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockquote.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/blockquote.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,MAAM,GAAG,EAAE;IAClD,OAAO,oBAAoB,CAAC,IAAI,CAAC;SAC9B,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @fileoverview Calendar quarters as the two 13F tools read them (#272): a `YYYY-QN`
3
+ * quarter, its quarter-end date (a 13F-HR's period of report), and the end of the quarter
4
+ * after it, which closes that report's filing window. `get_institutional_holdings` parses
5
+ * a caller's quarter here; `find_holders`, whose schema already holds its quarter to
6
+ * `YYYY-QN`, reads the dates.
7
+ * @module mcp-server/tools/calendar-quarter
8
+ */
9
+ /** Calendar quarter ends (MM-DD), Q1 through Q4. */
10
+ export declare const QUARTER_ENDS: readonly string[];
11
+ /** The dates bounding one calendar quarter's 13F reports. */
12
+ export interface CalendarQuarter {
13
+ /** Quarter-end date, YYYY-MM-DD: the period of report a 13F-HR for the quarter carries. */
14
+ end: string;
15
+ /** End of the following quarter, YYYY-MM-DD: the close of the quarter's filing window. */
16
+ nextEnd: string;
17
+ }
18
+ /** The quarter `quarter` names (`2025-Q4`, `2025-q4`), or undefined for any other string. */
19
+ export declare function parseQuarter(quarter: string): CalendarQuarter | undefined;
20
+ /** The `YYYY-QN` quarter a quarter-end date closes, `parseQuarter`'s inverse; undefined for any other date. */
21
+ export declare function quarterOf(periodEnd: string): string | undefined;
22
+ //# sourceMappingURL=calendar-quarter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-quarter.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/calendar-quarter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAyC,CAAC;AAKpF,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,2FAA2F;IAC3F,GAAG,EAAE,MAAM,CAAC;IACZ,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAYzE;AAED,+GAA+G;AAC/G,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK/D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview Calendar quarters as the two 13F tools read them (#272): a `YYYY-QN`
3
+ * quarter, its quarter-end date (a 13F-HR's period of report), and the end of the quarter
4
+ * after it, which closes that report's filing window. `get_institutional_holdings` parses
5
+ * a caller's quarter here; `find_holders`, whose schema already holds its quarter to
6
+ * `YYYY-QN`, reads the dates.
7
+ * @module mcp-server/tools/calendar-quarter
8
+ */
9
+ /** Calendar quarter ends (MM-DD), Q1 through Q4. */
10
+ export const QUARTER_ENDS = ['03-31', '06-30', '09-30', '12-31'];
11
+ /** `YYYY-QN` with N 1–4, the letter in either case. */
12
+ const QUARTER_PATTERN = /^(\d{4})-Q([1-4])$/i;
13
+ /** The quarter `quarter` names (`2025-Q4`, `2025-q4`), or undefined for any other string. */
14
+ export function parseQuarter(quarter) {
15
+ const match = QUARTER_PATTERN.exec(quarter);
16
+ if (!match)
17
+ return;
18
+ const [, year, n] = match;
19
+ const index = Number(n) - 1;
20
+ return {
21
+ end: `${year}-${QUARTER_ENDS[index]}`,
22
+ nextEnd: index === 3
23
+ ? `${String(Number(year) + 1).padStart(4, '0')}-${QUARTER_ENDS[0]}`
24
+ : `${year}-${QUARTER_ENDS[index + 1]}`,
25
+ };
26
+ }
27
+ /** The `YYYY-QN` quarter a quarter-end date closes, `parseQuarter`'s inverse; undefined for any other date. */
28
+ export function quarterOf(periodEnd) {
29
+ const index = QUARTER_ENDS.indexOf(periodEnd.slice(5));
30
+ return /^\d{4}-\d{2}-\d{2}$/.test(periodEnd) && index >= 0
31
+ ? `${periodEnd.slice(0, 4)}-Q${index + 1}`
32
+ : undefined;
33
+ }
34
+ //# sourceMappingURL=calendar-quarter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-quarter.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/calendar-quarter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEpF,uDAAuD;AACvD,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAU9C,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO;QACL,GAAG,EAAE,GAAG,IAAI,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;QACrC,OAAO,EACL,KAAK,KAAK,CAAC;YACT,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE;YACnE,CAAC,CAAC,GAAG,IAAI,IAAI,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE;KAC3C,CAAC;AACJ,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,SAAS,CAAC,SAAiB;IACzC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,OAAO,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC;QACxD,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,GAAG,CAAC,EAAE;QAC1C,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"company-search.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/company-search.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAK3E,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAC;AAyN3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAygB5B,CAAC;AAEH,+FAA+F;AAC/F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEjE"}
1
+ {"version":3,"file":"company-search.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/company-search.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAM3E,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAC;AAyN3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4f5B,CAAC;AAEH,+FAA+F;AAC/F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEjE"}