@cyanheads/secedgar-mcp-server 0.15.14 → 0.15.15

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 (42) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/README.md +6 -3
  4. package/changelog/0.15.x/0.15.15.md +24 -0
  5. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts.map +1 -1
  6. package/dist/mcp-server/tools/definitions/find-holders.tool.js +29 -19
  7. package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
  8. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts +13 -3
  9. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts.map +1 -1
  10. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +85 -30
  11. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +5 -7
  14. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +3 -5
  17. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +19 -0
  19. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +142 -25
  21. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/index.d.ts +570 -540
  23. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/fixed-point.d.ts +7 -0
  25. package/dist/mcp-server/tools/fixed-point.d.ts.map +1 -0
  26. package/dist/mcp-server/tools/fixed-point.js +28 -0
  27. package/dist/mcp-server/tools/fixed-point.js.map +1 -0
  28. package/dist/services/edgar/concept-series.d.ts.map +1 -1
  29. package/dist/services/edgar/concept-series.js +5 -1
  30. package/dist/services/edgar/concept-series.js.map +1 -1
  31. package/dist/services/edgar/nport-parser.js +1 -1
  32. package/dist/services/edgar/nport-parser.js.map +1 -1
  33. package/dist/services/edgar/ownership-parser.d.ts +2 -0
  34. package/dist/services/edgar/ownership-parser.d.ts.map +1 -1
  35. package/dist/services/edgar/ownership-parser.js +4 -0
  36. package/dist/services/edgar/ownership-parser.js.map +1 -1
  37. package/dist/services/edgar/same-cik.d.ts +7 -0
  38. package/dist/services/edgar/same-cik.d.ts.map +1 -0
  39. package/dist/services/edgar/same-cik.js +9 -0
  40. package/dist/services/edgar/same-cik.js.map +1 -0
  41. package/package.json +3 -3
  42. package/server.json +3 -3
package/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** secedgar-mcp-server
4
- **Version:** 0.15.14
4
+ **Version:** 0.15.15
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.3.1
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** secedgar-mcp-server
4
- **Version:** 0.15.14
4
+ **Version:** 0.15.15
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.3.1
package/README.md CHANGED
@@ -122,7 +122,7 @@ SEC EDGAR filings, financials, and ownership data. Look up companies by ticker,
122
122
 
123
123
  - `company` is the issuer; `transaction_type` `purchase` (code P), `sale` (code S), or `all` (default); `limit` 1–100 (default 20); does not cover Forms 3 or 5
124
124
  - 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; `history_scanned_through` names the oldest filing parsed
125
- - 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` flags filings beyond those parsed, and `filings_other_issuer` counts Form 4s the company filed as a reporting owner of another issuer, which add no rows
125
+ - 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` flags filings beyond those parsed, and `filings_other_issuer` counts Form 4s the company filed as a reporting owner of another issuer, which add no rows. Price text preserves the numeric digits in fixed-point notation, with at least two decimal places.
126
126
 
127
127
  ---
128
128
 
@@ -130,6 +130,7 @@ SEC EDGAR filings, financials, and ownership data. Look up companies by ticker,
130
130
 
131
131
  - `company` is the 13F filer (a CIK is most reliable), not a portfolio company, which is `secedgar_find_holders`' job; `quarter` as `YYYY-QN`, defaulting to the newest filing; `limit` 1–500 (default 20) with `offset` / `next_offset`; `consolidate` (default true) merges sub-lines into positions sorted by value
132
132
  - Older quarters are found in the archive (up to 10 pages); a quarter covered only by a 13F-NT notice fails as `no_filings_found` naming the notice's accession number and period
133
+ - Holdings and dataframe rows come from the original report. `amendments` discloses same-period accessions, filing dates and cover-page types (`UNAVAILABLE` with a reason when unreadable); read them with `secedgar_get_filing`. `amendment_search_complete=false` warns that bounded or unavailable archive discovery may have missed amendments
133
134
  - Holdings carry issuer, CUSIP, `market_value_usd` in whole USD, shares or principal, and `put_call`; `total_holdings_in_filing` counts raw rows and `total_positions` distinct positions; a shared legal name fails as `ambiguous_entity`
134
135
 
135
136
  ---
@@ -138,21 +139,23 @@ SEC EDGAR filings, financials, and ownership data. Look up companies by ticker,
138
139
 
139
140
  - `issuer` as a ticker, CIK, or name, plus an optional 9-character `cusip`, the precise match key (a name phrase-match both over- and under-matches); `quarter` as `YYYY-QN`, defaulting to the newest quarter past its 45-day filing deadline; `limit` 1–100 (default 20) from up to 500 fetched filings
140
141
  - Rows carry `filer_cik`, `accession_number`, and `form`, while `search_mode` (`cusip` / `name`), `total_filings`, `fetched`, and `holders_in_quarter` size the result; the list is unranked, so pass a `filer_cik` to `secedgar_get_institutional_holdings` to read the position
142
+ - When matching documents exceed the fetch budget, the notice gives an exact `secedgar_search_filings` continuation with the query, dates and document offset. Filter `results.period_ending` to the quarter end, then deduplicate across the sample's `filer_cik` and search results' `cik`, keeping the latest `filing_date`. Advance by 100 documents per full page; EDGAR's paging ceiling is 10,000 documents, and lower-bound totals may hide more beyond it
141
143
 
142
144
  ---
143
145
 
144
146
  ### `secedgar_get_beneficial_owners` <sub>tool</sub>
145
147
 
146
- - `issuer` is the company being held; `form_kind` `all` (default), `13D`, or `13G`; `include_amendments` (default true); `limit` 1–20 filings (default 10), each a separate document fetch
148
+ - `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). The newest-first scan examines at most 50 documents, excluding schedules naming another issuer; exclusions and failed documents do not consume `limit`
147
149
  - 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
148
150
  - 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
151
+ - `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
149
152
 
150
153
  ---
151
154
 
152
155
  ### `secedgar_get_fund_holdings` <sub>tool</sub>
153
156
 
154
157
  - `fund` as a ticker (`VOO`), series ID (`S000002839`), or CIK; a multi-series trust fails as `series_required` with the series listed, so pass `series_id`; `report_date` picks a period from `available_report_periods`; `limit` 1–100 (default 20) with `offset` / `next_offset`
155
- - Positions come largest first by `percent_of_net_assets`, with name, CUSIP / ISIN / LEI, `balance` and `units`, `value_usd`, and asset and issuer category, alongside fund net assets, total assets, and total liabilities
158
+ - Positions come largest first by `percent_of_net_assets`, with name, CUSIP / ISIN / LEI, `balance` and `units`, `value_usd`, and asset and issuer category, alongside fund net assets, total assets, and total liabilities. Position `currency` is its denomination; valuations stay in USD. Percentage text preserves the numeric digits in fixed-point notation.
156
159
  - Holdings are as of `report_period_date`, roughly two months before `filing_date`; `publication_lag_days` states the gap
157
160
 
158
161
  ---
@@ -0,0 +1,24 @@
1
+ ---
2
+ summary: Correct ownership attribution and holdings disclosure, preserve numeric text and fund denominations, and provide holder-search continuation guidance.
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.15.15 — 2026-10-24
8
+
9
+ ## Changed
10
+
11
+ - **`secedgar_get_institutional_holdings`** discloses same-period amendments by accession, filing date and cover-page type, including unavailable headers and incomplete discovery; holdings and dataframe rows remain from the original report. ([#190](https://github.com/cyanheads/secedgar-mcp-server/issues/190))
12
+ - **`secedgar_find_holders`** supplies an exact `secedgar_search_filings` continuation beyond its document sample, with quarter filtering, CIK deduplication and EDGAR's 10,000-document paging ceiling. ([#193](https://github.com/cyanheads/secedgar-mcp-server/issues/193))
13
+
14
+ ## Fixed
15
+
16
+ - **`secedgar_get_beneficial_owners`** excludes schedules naming another issuer and scans until the matching-result limit or 50 examined documents; counters distinguish parsed matches, other-issuer exclusions, failures and unexamined schedules. ([#189](https://github.com/cyanheads/secedgar-mcp-server/issues/189))
17
+ - **`secedgar_get_beneficial_owners`** reports failed accessions and stable reasons, retaining successes with `partial=true`; truncation identifies unexamined schedules separately from document failures. ([#195](https://github.com/cyanheads/secedgar-mcp-server/issues/195))
18
+ - **`secedgar_get_fund_holdings`** reads `currencyConditional@curCd` and labels position denomination separately from its USD valuation. ([#191](https://github.com/cyanheads/secedgar-mcp-server/issues/191))
19
+ - **Numeric text** preserves parsed Number digits in fixed-point fund percentages and insider prices, with at least two decimal places for prices. ([#196](https://github.com/cyanheads/secedgar-mcp-server/issues/196))
20
+
21
+ ## Dependencies
22
+
23
+ - `@duckdb/node-api` ^1.5.6-r.1 → ^1.5.6-r.2.
24
+ - `@biomejs/biome` ^2.5.15 → ^2.6.2; retain lexical year-end comparison and reduce mirror fixture ZIP compression work.
@@ -1 +1 @@
1
- {"version":3,"file":"find-holders.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-holders.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwFjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+Z1B,CAAC"}
1
+ {"version":3,"file":"find-holders.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-holders.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwFjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0a1B,CAAC"}
@@ -16,7 +16,7 @@ import { cleanDisplayName, getEdgarApiService } from '../../../services/edgar/ed
16
16
  */
17
17
  const EFTS_PAGE_SIZE = 100;
18
18
  /**
19
- * Pages fetched in one call — 500 filer rows. Measured against the Q1 2026
19
+ * Pages fetched in one call — 500 matching documents. Measured against the Q1 2026
20
20
  * filing window (2026-04-01 → 2026-06-30): Apple (CUSIP 037833100) draws 6,652
21
21
  * 13F-HR filings, so the budget returns a 500-row sample with the exact total
22
22
  * still reported and `dataset.truncated` set; Liberty Live Holdings (530909100)
@@ -161,7 +161,7 @@ export const findHoldersTool = tool('secedgar_find_holders', {
161
161
  filed_to: z.string().describe('End of the filing window searched (YYYY-MM-DD).'),
162
162
  total_filings: z
163
163
  .number()
164
- .describe('13F-HR filings matching the search key in the window, per the index; slightly over-counts holders (amendments of older quarters, managers amending this one), which holders_in_quarter corrects.'),
164
+ .describe('Matching documents in the filing window, including amendments; holders_in_quarter deduplicates managers and filters period.'),
165
165
  total_is_exact: z
166
166
  .boolean()
167
167
  .describe('False when total_filings is a lower bound (the index capped the count).'),
@@ -170,7 +170,7 @@ export const findHoldersTool = tool('secedgar_find_holders', {
170
170
  .describe('Filings retrieved, at most 500; equals total_filings when the window fit.'),
171
171
  holders_in_quarter: z
172
172
  .number()
173
- .describe('Distinct managers reporting this quarter among fetched filings: the set limit pages and the dataframe holds. Other-quarter amendments drop; a manager that amended counts once, at its latest filing.'),
173
+ .describe('Distinct in-quarter managers in the fetched sample and dataframe; latest filing per CIK wins, other periods excluded.'),
174
174
  holders: z
175
175
  .array(z
176
176
  .object({
@@ -200,10 +200,10 @@ export const findHoldersTool = tool('secedgar_find_holders', {
200
200
  expires_at: z.string().describe('ISO 8601 expiry timestamp.'),
201
201
  truncated: z
202
202
  .boolean()
203
- .describe('True when total_filings exceeds fetched, so more filers exist.'),
203
+ .describe('True when the fetched sample may omit matching documents.'),
204
204
  })
205
205
  .optional()
206
- .describe('Dataframe of every fetched filer row, keyed by issuer and quarter for cross-issuer joins. Absent when the result fits inline, canvas is unavailable, or staging failed.'),
206
+ .describe('Fetched managers keyed by issuer and quarter for joins. Absent if inline fits, canvas is unavailable or staging fails.'),
207
207
  }),
208
208
  enrichment: {
209
209
  ordering: z
@@ -212,7 +212,7 @@ export const findHoldersTool = tool('secedgar_find_holders', {
212
212
  notice: z
213
213
  .string()
214
214
  .optional()
215
- .describe('Guidance when the search returned no filers — names the likely cause.'),
215
+ .describe('Continuation, search coverage, empty results, and dataframe guidance.'),
216
216
  truncated: z.boolean().optional().describe('True when the inline holders list was capped.'),
217
217
  shown: z.number().optional().describe('Number of filers shown inline.'),
218
218
  cap: z.number().optional().describe('The limit cap applied.'),
@@ -301,7 +301,7 @@ export const findHoldersTool = tool('secedgar_find_holders', {
301
301
  break;
302
302
  }
303
303
  const rows = [...byFiler.values()];
304
- const truncated = hitsFetched < total;
304
+ const truncated = hitsFetched < total || !totalIsExact;
305
305
  let dataset;
306
306
  const bridge = getCanvasBridge();
307
307
  if (bridge && rows.length > input.limit) {
@@ -338,12 +338,13 @@ export const findHoldersTool = tool('secedgar_find_holders', {
338
338
  * aggregate over that sample, which is worth saying before someone counts it.
339
339
  */
340
340
  const sampleNote = truncated
341
- ? ` The fetch budget stopped at ${hitsFetched} of ${total} matching filings, and the index served them in that same relevance order, so this is a sample of the holders rather than the first ones by any measure.`
341
+ ? ` The fetch budget stopped at ${hitsFetched} of ${totalIsExact ? '' : 'at least '}${total} matching documents, and the index served them in that same relevance order, so this is a sample of the holders rather than the first ones by any measure.`
342
342
  : '';
343
343
  ctx.enrich({
344
344
  ordering: `Filers are listed in EDGAR search-relevance order, which reflects text match strength only — it is not a ranking by shares held or market value.${sampleNote} Read a manager's actual position with secedgar_get_institutional_holdings using its filer_cik and quarter "${quarter}".`,
345
345
  });
346
346
  const searchedTerm = searchMode === 'cusip' ? `CUSIP ${searchKey}` : `the phrase ${searchKey}`;
347
+ const notices = [];
347
348
  if (total === 0) {
348
349
  const deadline = addDays(quarterEnd, FILING_DEADLINE_DAYS);
349
350
  const cause = deadline > new Date().toISOString().slice(0, 10)
@@ -351,22 +352,31 @@ export const findHoldersTool = tool('secedgar_find_holders', {
351
352
  : searchMode === 'cusip'
352
353
  ? 'Verify the CUSIP identifies a 13(f)-reportable security and covers the intended share class, or drop cusip to phrase-match the issuer name instead.'
353
354
  : 'The issuer name is phrase-matched against filing text and managers may write it differently — pass cusip for an exact match, read one off any secedgar_get_institutional_holdings result.';
354
- ctx.enrich.notice(`No 13F-HR filings matched ${searchedTerm} filed ${filedFrom} to ${filedTo}. ${cause}`);
355
+ notices.push(`No 13F-HR filings matched ${searchedTerm} filed ${filedFrom} to ${filedTo}. ${cause}`);
355
356
  }
356
357
  else if (rows.length === 0) {
357
- ctx.enrich.notice(`${total} 13F-HR filings matched ${searchedTerm} in the ${filedFrom} to ${filedTo} window, but none of the ${hitsFetched} fetched report ${quarter} (period ending ${quarterEnd}) — they are amendments restating other quarters. Search the quarter those amendments cover, or a later one.`);
358
+ notices.push(`${total} 13F-HR filings matched ${searchedTerm} in the ${filedFrom} to ${filedTo} window, but none of the ${hitsFetched} fetched report ${quarter} (period ending ${quarterEnd}) — they are amendments restating other quarters. Search the quarter those amendments cover, or a later one.`);
358
359
  }
359
360
  else if (rows.length > input.limit) {
360
- ctx.enrich.truncated({
361
- shown: input.limit,
362
- cap: input.limit,
363
- guidance: dataset
364
- ? truncated
365
- ? `${total} filings matched in the window; the fetch budget of ${FETCH_PAGE_BUDGET * EFTS_PAGE_SIZE} retrieved ${hitsFetched}, resolving to ${rows.length} managers reporting ${quarter}. ${dataframeGuidance(dataset)}`
366
- : dataframeGuidance(dataset)
367
- : 'Raise limit to see more inline, or narrow to a single share class with cusip.',
368
- });
361
+ const guidance = dataset
362
+ ? truncated
363
+ ? `${total} filings matched in the window; the fetch budget of ${FETCH_PAGE_BUDGET * EFTS_PAGE_SIZE} retrieved ${hitsFetched}, resolving to ${rows.length} managers reporting ${quarter}. ${dataframeGuidance(dataset)}`
364
+ : dataframeGuidance(dataset)
365
+ : 'Raise limit to see more inline, or narrow to a single share class with cusip.';
366
+ notices.push(guidance);
367
+ }
368
+ if (truncated) {
369
+ const reachable = Math.min(total, 10_000);
370
+ const recipe = hitsFetched < reachable
371
+ ? ` Continue with secedgar_search_filings ${JSON.stringify({ query: searchKey, forms: ['13F-HR'], filed_after: filedFrom, filed_before: filedTo, sort: 'relevance', offset: hitsFetched, limit: Math.min(EFTS_PAGE_SIZE, 10_000 - hitsFetched) })}. Offset counts documents; a filing may recur across pages. Advance offset by 100 documents per full page, stopping before offset + limit exceeds 10000. forms=["13F-HR"] includes amendments. Filter results by period_ending="${quarterEnd}"; deduplicate across the original sample and subsequent pages by CIK (sample.filer_cik, results.cik), keeping the latest filing_date.`
372
+ : '';
373
+ notices.push(`${totalIsExact ? `${total} matching documents` : `At least ${total} matching documents (lower bound)`}; ${reachable} reported documents are reachable within EDGAR's 10000-document paging ceiling.${!totalIsExact || total > 10_000 ? ' Documents beyond that window are unreachable by paging.' : ''}${recipe}`);
374
+ }
375
+ if (rows.length > input.limit) {
376
+ ctx.enrich.truncated({ shown: input.limit, cap: input.limit, guidance: notices.join(' ') });
369
377
  }
378
+ else if (notices.length > 0)
379
+ ctx.enrich.notice(notices.join(' '));
370
380
  ctx.log.info('Holder search completed', {
371
381
  issuer: input.issuer,
372
382
  searchMode,
@@ -1 +1 @@
1
- {"version":3,"file":"find-holders.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-holders.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG7F;;;GAGG;AACH,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B;;;;;;;;;GASG;AACH,MAAM,iBAAiB,GAAG,CAAC,CA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AAI,CACR,cAAc,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,SAAS,kBAAkB,MAAM,CAAC,OAAO,CAAC,UAAU,IAAI,aAAa,yCAAyC,CACpK,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"find-holders.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-holders.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG7F;;;GAGG;AACH,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B;;;;;;;;;GASG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,yDAAyD;AACzD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAYzE,6DAA6D;AAC7D,SAAS,OAAO,CAAC,IAAY,EAAE,IAAY;IACzC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC;IACxC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IACpC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC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AC,mBAAmB,GAAG,CACtF,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CACR,cAAc,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,UAAU,EAAE,EACxD,GAAG,MAAM,CAAC,aAAa,2BAA2B,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,MAAM,MAAM,CAAC,OAAO,aAAa,MAAM,CAAC,kBAAkB,uBAAuB,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,QAAQ,CACzO,CAAC;QAEF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CACR,KAAK,CAAC,CAAC,UAAU,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,gBAAgB,GAAG,CAC1G,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS;gBAC5C,CAAC,CAAC,0DAA0D;gBAC5D,CAAC,CAAC,EAAE,CAAC;YACP,KAAK,CAAC,IAAI,CACR,cAAc,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,SAAS,kBAAkB,MAAM,CAAC,OAAO,CAAC,UAAU,IAAI,aAAa,yCAAyC,CACpK,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -4,9 +4,8 @@
4
4
  * ownership triangle alongside secedgar_get_insider_transactions (Form 4 officers and
5
5
  * directors) and secedgar_get_institutional_holdings (13F portfolios): this tool covers the
6
6
  * 5%-and-over stakes, activist and passive. Discovery runs off the issuer's own submissions
7
- * feed — SEC cross-lists a 13D/G under every CIK party to it, so the issuer's history
8
- * already carries the filings made about it and the archive document is reachable on the
9
- * issuer's own path.
7
+ * feed — SEC cross-lists a 13D/G under every CIK party to it. Each document's issuer CIK
8
+ * must therefore match before its ownership is attributed to the requested company.
10
9
  * @module mcp-server/tools/definitions/get-beneficial-owners
11
10
  */
12
11
  import { z } from '@cyanheads/mcp-ts-core';
@@ -31,6 +30,17 @@ export declare const getBeneficialOwnersTool: import("@cyanheads/mcp-ts-core").T
31
30
  }>;
32
31
  total_structured_filings: z.ZodNumber;
33
32
  filings_parsed: z.ZodNumber;
33
+ filings_examined: z.ZodNumber;
34
+ filings_excluded_other_issuer: z.ZodNumber;
35
+ filings_not_examined: z.ZodNumber;
36
+ filings_failed: z.ZodArray<z.ZodObject<{
37
+ accession_number: z.ZodString;
38
+ reason: z.ZodEnum<{
39
+ document_not_found: "document_not_found";
40
+ unparseable: "unparseable";
41
+ }>;
42
+ }, z.core.$strip>>;
43
+ partial: z.ZodBoolean;
34
44
  structured_coverage_from: z.ZodString;
35
45
  legacy_filings_before_coverage: z.ZodNumber;
36
46
  filings: z.ZodArray<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"get-beneficial-owners.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-beneficial-owners.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsDjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwhBlC,CAAC"}
1
+ {"version":3,"file":"get-beneficial-owners.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-beneficial-owners.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA6DjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAylBlC,CAAC"}
@@ -4,9 +4,8 @@
4
4
  * ownership triangle alongside secedgar_get_insider_transactions (Form 4 officers and
5
5
  * directors) and secedgar_get_institutional_holdings (13F portfolios): this tool covers the
6
6
  * 5%-and-over stakes, activist and passive. Discovery runs off the issuer's own submissions
7
- * feed — SEC cross-lists a 13D/G under every CIK party to it, so the issuer's history
8
- * already carries the filings made about it and the archive document is reachable on the
9
- * issuer's own path.
7
+ * feed — SEC cross-lists a 13D/G under every CIK party to it. Each document's issuer CIK
8
+ * must therefore match before its ownership is attributed to the requested company.
10
9
  * @module mcp-server/tools/definitions/get-beneficial-owners
11
10
  */
12
11
  import { tool, z } from '@cyanheads/mcp-ts-core';
@@ -15,6 +14,7 @@ import { dataframeGuidance, getCanvasBridge, toDatasetField, } from '../../../se
15
14
  import { formNameToSchedule, parseBeneficialOwnershipXml, } from '../../../services/edgar/beneficial-ownership-parser.js';
16
15
  import { CallScope } from '../../../services/edgar/call-scope.js';
17
16
  import { getEdgarApiService, rawDocumentName } from '../../../services/edgar/edgar-api-service.js';
17
+ import { sameCik } from '../../../services/edgar/same-cik.js';
18
18
  /**
19
19
  * First filing date on which every beneficial-ownership filing arrived in the structured
20
20
  * format. The legacy `SC 13D` / `SC 13G` names stop dead here: EDGAR full-text search counts
@@ -22,6 +22,10 @@ import { getEdgarApiService, rawDocumentName } from '../../../services/edgar/edg
22
22
  * same day. Filings before it are text or HTML documents with no XML to parse.
23
23
  */
24
24
  const STRUCTURED_FROM = '2024-12-18';
25
+ /** Maximum schedule documents examined in one newest-first scan. */
26
+ const FILING_SCAN_CAP = 50;
27
+ /** Maximum matching filings a caller can request. */
28
+ const FILING_RESULT_CAP = 20;
25
29
  /** Legacy form names that carry the same disclosure with no parseable XML. */
26
30
  const LEGACY_FORMS = ['SC 13D', 'SC 13D/A', 'SC 13G', 'SC 13G/A'];
27
31
  /**
@@ -100,9 +104,9 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
100
104
  .number()
101
105
  .int()
102
106
  .min(1)
103
- .max(20)
107
+ .max(FILING_RESULT_CAP)
104
108
  .default(10)
105
- .describe('Number of filings to fetch and parse, newest first. Each filing is a separate document fetch, so this is the cost of the call as well as its depth. Default 10; a widely-held company can have dozens of blockholder filings a year.'),
109
+ .describe('Number of successfully parsed filings naming the requested issuer to return, newest first. Other-issuer schedules and failed documents do not consume this limit; at most 50 documents are examined. Default 10.'),
106
110
  }),
107
111
  // The company-identifier keys other tools take. `issuer` is this tool's only company
108
112
  // input, so each maps one-to-one (#152).
@@ -116,10 +120,28 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
116
120
  .describe('The schedule filter applied — the requested value, or the default "all".'),
117
121
  total_structured_filings: z
118
122
  .number()
119
- .describe('Structured 13D/13G filings matching form_kind in the recent submissions window, before limit.'),
120
- filings_parsed: z
123
+ .describe('Indexed 13D/13G schedules matching form/amendment filters in the recent submissions window.'),
124
+ filings_parsed: z.number().describe('Matching parsed filings, capped by limit.'),
125
+ filings_examined: z.number().describe('Matches + exclusions + failures; at most 50 documents.'),
126
+ filings_excluded_other_issuer: z
121
127
  .number()
122
- .describe('Filings fetched and parsed: total_structured_filings capped by limit.'),
128
+ .describe('Schedules naming another issuer; no rows returned.'),
129
+ filings_not_examined: z
130
+ .number()
131
+ .describe('Indexed schedules beyond the result limit or 50-document ceiling.'),
132
+ filings_failed: z
133
+ .array(z
134
+ .object({
135
+ accession_number: z.string().describe('Accession to inspect with secedgar_get_filing.'),
136
+ reason: z
137
+ .enum(['document_not_found', 'unparseable'])
138
+ .describe('Document returned 404, or could not be parsed with a usable issuer CIK.'),
139
+ })
140
+ .describe('One failed document.'))
141
+ .describe('Failures in scan order; successes retained.'),
142
+ partial: z
143
+ .boolean()
144
+ .describe('True when filings_failed is nonempty, independently of truncation.'),
123
145
  structured_coverage_from: z
124
146
  .string()
125
147
  .describe('First date SEC required this XML format (YYYY-MM-DD); earlier blockholder filings cannot be parsed here.'),
@@ -222,7 +244,7 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
222
244
  expires_at: z.string().describe('ISO 8601 expiry timestamp.'),
223
245
  truncated: z
224
246
  .boolean()
225
- .describe('True when more structured filings exist than limit fetched.'),
247
+ .describe('True when indexed schedules remain unexamined after the result limit or scan ceiling.'),
226
248
  })
227
249
  .optional()
228
250
  .describe('Dataframe with one row per reporting person across parsed filings; joins insider and 13F dataframes on issuer_cik. Absent when canvas is unavailable or nothing parsed.'),
@@ -231,10 +253,13 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
231
253
  notice: z
232
254
  .string()
233
255
  .optional()
234
- .describe('Guidance when no filings matched, naming the coverage boundary and the fallback.'),
235
- truncated: z.boolean().optional().describe('True when filings were capped by limit.'),
256
+ .describe('Exclusions, document recovery, scan bounds, and dataframe guidance.'),
257
+ truncated: z
258
+ .boolean()
259
+ .optional()
260
+ .describe('True when schedules remain unexamined after the result limit or 50-document ceiling.'),
236
261
  shown: z.number().optional().describe('Number of filings returned.'),
237
- cap: z.number().optional().describe('The limit cap applied.'),
262
+ cap: z.number().optional().describe('Result limit or document ceiling that stopped scanning.'),
238
263
  },
239
264
  async handler(input, ctx) {
240
265
  const api = getEdgarApiService();
@@ -271,7 +296,7 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
271
296
  if (!input.include_amendments && form.endsWith('/A'))
272
297
  continue;
273
298
  totalMatching++;
274
- if (selected.length < input.limit) {
299
+ if (selected.length < FILING_SCAN_CAP) {
275
300
  selected.push({
276
301
  form,
277
302
  schedule,
@@ -292,20 +317,32 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
292
317
  legacy_filings_before_coverage: legacyCount,
293
318
  });
294
319
  }
295
- // Fetch and parse each selected filing. A document that 404s or does not parse as a
296
- // schedule is dropped rather than failing the call — one malformed filing must not
297
- // hide every other blockholder in the list.
320
+ // Each examined document has exactly one outcome: matching, other issuer, or failed.
321
+ // Failures and exclusions do not spend the caller's matching-filing limit.
322
+ let examined = 0;
323
+ let otherIssuer = 0;
324
+ const failed = [];
298
325
  const filings = [];
299
326
  for (const ref of selected) {
327
+ if (filings.length >= input.limit)
328
+ break;
329
+ ctx.signal.throwIfAborted();
300
330
  const xml = await api.tryGetFilingDocument(match.cik, ref.accessionNumber, ref.document, scope);
331
+ examined++;
301
332
  const parsed = xml ? parseBeneficialOwnershipXml(xml) : undefined;
302
- if (!parsed) {
303
- ctx.log.debug('Skipping unparseable beneficial-ownership filing', {
304
- accessionNumber: ref.accessionNumber,
305
- document: ref.document,
333
+ if (!parsed?.issuer_cik ||
334
+ !/^\d+$/.test(parsed.issuer_cik) ||
335
+ !/[1-9]/.test(parsed.issuer_cik)) {
336
+ failed.push({
337
+ accession_number: ref.accessionNumber,
338
+ reason: xml === null ? 'document_not_found' : 'unparseable',
306
339
  });
307
340
  continue;
308
341
  }
342
+ if (!sameCik(parsed.issuer_cik, match.cik)) {
343
+ otherIssuer++;
344
+ continue;
345
+ }
309
346
  const purpose = clip(parsed.purpose_of_transaction, PURPOSE_MAX_CHARS);
310
347
  filings.push({
311
348
  form: ref.form,
@@ -335,7 +372,8 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
335
372
  })),
336
373
  });
337
374
  }
338
- const truncated = totalMatching > filings.length;
375
+ const notExamined = totalMatching - examined;
376
+ const truncated = notExamined > 0;
339
377
  // One row per reporting person — the grain the ownership question is asked at, and the
340
378
  // grain that joins to the insider and 13F dataframes on issuer_cik.
341
379
  let dataset;
@@ -379,19 +417,27 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
379
417
  if (registered)
380
418
  dataset = { ...toDatasetField(registered), truncated };
381
419
  }
382
- if (filings.length === 0) {
383
- ctx.enrich.notice(`${totalMatching} structured filings are indexed for ${submissions.name}, but none of the ${selected.length} fetched parsed as a SCHEDULE 13D or 13G document. Read one directly with secedgar_get_filing on an accession number from secedgar_search_filings.`);
420
+ const guidance = [];
421
+ if (otherIssuer > 0)
422
+ guidance.push(`${otherIssuer} examined filings name another issuer and contribute no ownership rows.`);
423
+ if (failed.length > 0)
424
+ guidance.push(`${failed.length} documents failed; this is a partial result. Inspect the accessions in filings_failed with secedgar_get_filing; document_not_found means SEC returned 404, and unparseable means no schedule with a usable issuer CIK could be read.`);
425
+ if (truncated) {
426
+ guidance.push(examined === FILING_SCAN_CAP
427
+ ? `${notExamined} indexed schedules remain unexamined after the 50-document scan ceiling. Narrow with form_kind or include_amendments=false; raising limit does not extend this ceiling.`
428
+ : `${notExamined} indexed schedules remain unexamined after the ${input.limit}-filing result limit. ${input.limit < FILING_RESULT_CAP ? 'Raise limit to reach further back, or narrow with form_kind or include_amendments=false.' : 'Narrow with form_kind or include_amendments=false.'}`);
384
429
  }
385
- else if (truncated) {
430
+ if (dataset)
431
+ guidance.push(dataframeGuidance(dataset));
432
+ if (truncated) {
386
433
  ctx.enrich.truncated({
387
434
  shown: filings.length,
388
- cap: input.limit,
389
- guidance: `${totalMatching} structured blockholder filings are indexed for this issuer. Raise limit to reach further back, or narrow with form_kind or include_amendments=false.` +
390
- (dataset ? ` ${dataframeGuidance(dataset)}` : ''),
435
+ cap: examined === FILING_SCAN_CAP ? FILING_SCAN_CAP : input.limit,
436
+ guidance: guidance.join(' '),
391
437
  });
392
438
  }
393
- else if (dataset) {
394
- ctx.enrich.notice(dataframeGuidance(dataset));
439
+ else if (guidance.length > 0) {
440
+ ctx.enrich.notice(guidance.join(' '));
395
441
  }
396
442
  ctx.log.info('Beneficial owners retrieved', {
397
443
  cik: match.cik,
@@ -408,6 +454,11 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
408
454
  form_kind: input.form_kind,
409
455
  total_structured_filings: totalMatching,
410
456
  filings_parsed: filings.length,
457
+ filings_examined: examined,
458
+ filings_excluded_other_issuer: otherIssuer,
459
+ filings_not_examined: notExamined,
460
+ filings_failed: failed,
461
+ partial: failed.length > 0,
411
462
  structured_coverage_from: STRUCTURED_FROM,
412
463
  legacy_filings_before_coverage: legacyCount,
413
464
  filings,
@@ -418,8 +469,12 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
418
469
  const lines = [
419
470
  `**5%+ beneficial owners of ${result.issuer_name}** (CIK ${result.issuer_cik}) — input "${result.issuer}"`,
420
471
  `Schedule filter: ${result.form_kind} | ${result.filings_parsed} of ${result.total_structured_filings} structured filings parsed`,
472
+ `${result.filings_examined} examined | ${result.filings_excluded_other_issuer} excluded for another issuer | ${result.filings_failed.length} failed | ${result.filings_not_examined} not examined | partial: ${result.partial}`,
421
473
  `Structured coverage starts ${result.structured_coverage_from}; ${result.legacy_filings_before_coverage} legacy SC 13D/SC 13G filings sit before it in the submissions window (read those with secedgar_get_filing).`,
422
474
  ];
475
+ for (const failure of result.filings_failed) {
476
+ lines.push(`Failed document: ${failure.accession_number} — ${failure.reason}`);
477
+ }
423
478
  for (const f of result.filings) {
424
479
  lines.push('');
425
480
  const amendment = f.is_amendment
@@ -466,7 +521,7 @@ export const getBeneficialOwnersTool = tool('secedgar_get_beneficial_owners', {
466
521
  }
467
522
  if (result.dataset) {
468
523
  const note = result.dataset.truncated
469
- ? ' (truncated — more structured filings exist beyond limit)'
524
+ ? ' (truncated — indexed schedules remain unexamined)'
470
525
  : '';
471
526
  lines.push(`\nDataset: ${result.dataset.name} (${result.dataset.row_count} reporting-person rows, expires ${result.dataset.expires_at})${note} — query with secedgar_dataframe_query.`);
472
527
  }