@cyanheads/secedgar-mcp-server 0.18.0 → 0.18.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 (51) hide show
  1. package/AGENTS.md +4 -4
  2. package/CLAUDE.md +4 -4
  3. package/README.md +3 -3
  4. package/changelog/0.18.x/0.18.1.md +38 -0
  5. package/dist/mcp-server/tools/ambiguous-matches.d.ts +54 -15
  6. package/dist/mcp-server/tools/ambiguous-matches.d.ts.map +1 -1
  7. package/dist/mcp-server/tools/ambiguous-matches.js +19 -10
  8. package/dist/mcp-server/tools/ambiguous-matches.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts +8 -8
  10. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -1
  11. package/dist/mcp-server/tools/definitions/company-search.tool.js +7 -11
  12. package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +9 -7
  15. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/find-holders.tool.js +3 -2
  18. package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +3 -2
  21. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/get-filing.tool.js +11 -5
  24. package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-financials.tool.js +2 -2
  26. package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +3 -2
  29. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +2 -2
  31. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
  32. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
  33. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +18 -12
  34. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
  35. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts +8 -8
  36. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts.map +1 -1
  37. package/dist/mcp-server/tools/definitions/get-material-events.tool.js +7 -10
  38. package/dist/mcp-server/tools/definitions/get-material-events.tool.js.map +1 -1
  39. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +2 -2
  40. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -1
  41. package/dist/mcp-server/tools/definitions/index.d.ts +179 -179
  42. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
  44. package/dist/mcp-server/tools/definitions/search-filings.tool.js +4 -3
  45. package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
  46. package/dist/services/edgar/edgar-api-service.d.ts +20 -2
  47. package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
  48. package/dist/services/edgar/edgar-api-service.js +12 -6
  49. package/dist/services/edgar/edgar-api-service.js.map +1 -1
  50. package/package.json +2 -2
  51. 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.18.0
4
+ **Version:** 0.18.1
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
@@ -87,7 +87,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
87
87
  - **User-Agent required:** `"AppName contact@email.com"` on every SEC request or IP gets blocked
88
88
  - **CIK zero-padding:** the `data.sec.gov` APIs (submissions, companyfacts, companyconcept) require the 10-digit zero-padded CIK (`String(cik).padStart(10, '0')`). Archive paths under `www.sec.gov/Archives/edgar/data/` take it unpadded — SEC answers the padded path with a 301, and `fetch` follows it inside the same pacer slot, so every archive read would cost two requests. `filingArchiveUrl` (exported from `edgar-api-service.ts`) strips the zeros for all seven archive reads and for `get_filing`'s `filing_url` (#156)
89
89
  - **ETF/mutual-fund tickers:** `loadTickerCache` fetches `company_tickers_mf.json` alongside `company_tickers.json` and merges fund symbols (VOO, SCHD, JEPI…) into `byTicker`. Fund CIKs are registrant trusts (1:many with series), so fund rows go into `byTicker` only — never `byCik`, whichever source they come from. Resolved fund matches carry `seriesId`/`classId` from the live MF file, the only source of either. On a mirror-served ticker base the live MF fetch is merged in when `EDGAR_MIRROR_FALLBACK_LIVE` is on, so fund tickers resolve even if the mirror predates MF ingestion (#43); strict mirror-only (`FALLBACK_LIVE=false`) uses the mirror's own MF rows (ticker→CIK, no series/class). The mirror stores a fund symbol with an empty name — its schema has no series column — and `mirrorIndexRow` reads that empty name as the fund marker; a symbol claims `byTicker` in the order equity → live fund → mirror fund, so a live entry supersedes the mirror's bare row and keeps its series (#135). **The live fund slice has its own failure window:** a failed MF load (any HTTP failure, a malformed body, the block gate's refusal) is not cached for the ticker-cache TTL — `loadMfTickers` returns no rows and a `retryAt` `FUND_SLICE_RETRY_MS` (60 s) out, or the error's `retryAfter` when longer, so nothing is retried while the gate is closed. The first resolution after it refetches the file once, single-flight, onto the cached base (`reloadFundSlice`), which keeps its own load time: the equity index is not refetched and its TTL does not move. A per-resolution retry was rejected — against a persistent 5xx it adds three requests and ~3 s of backoff to every lookup (#119). Each failed load logs one warning through the framework's global `logger` (no request context to attach to) carrying `endpoint: 'company_tickers_mf'` (never the URL — framework log guidance keeps URLs out of log fields), the HTTP status or `malformed_body`, and the retry delay (#43).
90
- - **Name and ticker resolution:** `resolveCik` walks numeric CIK → the `/^[A-Z]{1,5}$/` ticker fast path → the name passes (exact → exact once folded → exact once initials join → prefix → substring over `allEntries`) → a catch-all `byTicker` lookup for symbols whose shape skipped the fast path. Four normalizations hang off that chain. The name passes' **exact** tiers also compare suffix-normalized forms (`normalizeCompanySuffix`): the terminal whitespace-delimited token only, a trailing `.`/`,` stripped as part of recognizing it, expanded to one of four canonical long forms — `corp`→`corporation`, `inc`→`incorporated`, `co`→`company`, `ltd`→`limited`. **The four buckets are never merged.** The registry carries distinct registrants differing only in which suffix they use (`TORO CO` 0000737758 vs `TORO CORP.` 0001941131, and the same shape on Blue Owl and Fluent), so a single "has a corporate suffix" marker would compare two companies equal. Only the terminal token is rewritten — the same words sit mid-name in titles ending in a different suffix (`American Water Works Company, Inc.`) — and a terminal token that merely contains one (`Ltd./ADR`) is not a suffix. Punctuation elsewhere in a name is the fold's (below). `llc`/`plc` and the `lp`/limited-partnership family get no bucket and must never fold into the `ltd` bucket (#107); they drop for a bare query (below) but never normalize into one of the four. The name passes **resolve within the best tier a current name reaches**: several CIKs there are the ambiguity, listed without the tiers below, so `Itron` resolves to ITRON, INC. instead of listing SOLITRON and POSITRON beside it. The exact tier also matches a registry name minus its terminal suffix and a comma before it (`stripCompanySuffix` over `DROPPABLE_SUFFIXES`: the four buckets plus `plc`, `llc`, `lp`, `nv`, `sa`, `ag`, and `se`, with or without periods), so `Apple` names `Apple Inc.` exactly. The wider set is deliberate: with the four buckets alone, `Rio Tinto` silently picked RIO TINTO LTD over RIO TINTO PLC; now both drop to an exact hit and tie. Only the registry side is stripped, so `Toro Co` never meets `TORO CORP.` and `Rio Tinto plc` never meets RIO TINTO LTD, and two suffix variants of one base name (`Blue Owl Capital`) tie. Current names (registry rows, which carry a ticker) choose the tier. A former name joins at that tier or better but never outranks one — otherwise `Travelers` resolves to Citigroup through its former name `travelers inc` — and decides alone only when no current name matches (`Facebook Inc`). Against the 2026-10-02 registry plus the former-names asset, 930 of 34,865 name queries move from ambiguous to resolved and no resolved CIK changes (#155). The **punctuation fold** (`foldNamePunctuation`, #210) deletes `,` `.` `'` `’` from the query and from every current and former name, then collapses each whitespace run to one space (#219), so `QXO Inc` meets `QXO, Inc.`, `Fluent Inc` meets `Fluent, Inc.`, `Jeffs Brands` the former name `jeffs' brands ltd`, and `Forgent Networks Inc` the former name `forgent networks inc`; a period is deleted, never spaced, so `U.S. Bancorp` meets `US BANCORP \DE\`. It is comparison-only — returned names and `suggestCompanies` never see it — and a helper of its own: `normalizeCompanySuffix` and `stripCompanySuffix` read the as-written strings, and the folded tiers run them again on the folded forms. Without the fold a weaker tier answered a punctuation-free spelling with another registrant (`BlackRock Inc` reached BLACKROCK INCOME TRUST, INC. by prefix, `Block Inc` H&R BLOCK INC by substring). Against the 2026-11-03 registry plus the former-names asset, no title queried as listed changes its answer and no title or former name changes CIK; six former names typed as listed move to `multiple_matches` with the current registrant first, since a current title now matches them too (`energizer holdings inc` lists ENERGIZER HOLDINGS, INC. ahead of the former holder). The **initials join** (`joinSpacedInitials`, #219) turns each run of two or more one-letter words in a folded form into one word (`j m smucker co` → `jm smucker co`), so `JM Smucker` and `J.M. Smucker` meet `J M SMUCKER Co` and `WP Carey` meets `W. P. Carey Inc.`; it is comparison-only like the fold, and its tier runs the suffix helpers again on the joined forms. **No hit starts or ends inside a word** (#218): a prefix must end at a word boundary of the joined name and a substring must start at one in the name as written — a boundary is regex `\b`, a letter or digit on exactly one side — so `SY Bancorp, Inc.` no longer names Embassy Bancorp through `embassy`, `helix acquisition corp ii` no longer lists the later `Helix Acquisition Corp. III`, and `ticker:MRO` (a delisted symbol) no longer scopes to PermRock Royalty Trust. Tier order: exact as written, exact once folded, exact once initials join, prefix of the joined form, substring as written. Each tier ranks above the looser one after it, so a title typed as listed never ties a former name equal to it only once folded (`McGraw Hill, Inc.` stays alone beside S&P Global's former `mcgraw hill inc`), and `US Gold` names U.S. GOLD CORP. alone instead of tying McEwen's former `u s gold corp`, equal only once joined. Substring stays as written, so a query ending mid-word still reaches a name containing it as written (`Berkshire Hath`) but never one containing it only once folded: `Helix Acquisition Corp. III` folds to a name holding `helix acquisition corp ii`. A query with no letter or digit (`.`, `'`) is `no_match` instead of folding to a string that starts every name. Against the 2026-11-03 registry plus the former-names asset (#218, #219), no title queried as listed changes its answer; of the former names typed as listed, nine move from `multiple_matches` to their own CIK (`ace ltd` no longer lists MDA Space Ltd. beside Chubb), `total` keeps its CIK in a different list, and `u s gold corp` moves to `multiple_matches` with U.S. GOLD CORP. first; 174 of the 178 joined or dotted spellings of the 63 names that space their initials resolve to their own CIK, against 15 before, the other four naming U.S. GOLD CORP.; and all 37 double-spaced former names resolve typed single-spaced, against 17 before. Only a query with no letter or digit loses its match, but a query cut short mid-word that the prefix tier answered alone can now list several companies (`baldw` lists Baldwin Insurance Group beside Matson, whose former name is `alexander & baldwin inc`). `\DE\`-style state tags, `&` `-` `/`, and a dotted word SEC splits in two (`AMAZON COM INC` for `Amazon.com`) stay out of scope. The **catch-all ticker lookup** retries a dotted symbol with `.`→`-` on a miss — brokers and market data write `BRK.B` where `company_tickers.json` lists `BRK-B`, and that file carries exactly one dotted ticker (a placeholder), so the substitution cannot land on the wrong registrant. The early gate stays untouched: it is a fast path, not the only ticker lookup, and `search_filings`' `ticker:` token inherits the fix through `resolveCik` with no change of its own (#110). **No consumer reads the first of several matches** (#223): `get_financials`, `get_snapshot`, `get_insider_transactions`, and `search_filings`' `ticker:` token throw `ambiguous_company` (`data.matches` of `cik`/`name`/`ticker`, at most 10, also listed in the message) before any SEC read; `company_search` and `get_material_events` throw `multiple_matches`, `find_holders` and `get_beneficial_owners` `ambiguous_issuer`, `get_institutional_holdings` `ambiguous_entity`, `get_fund_holdings` `ambiguous_fund`, and `compare_companies` reports a per-company `failed[]` reason `ambiguous`. `search_filings`' `cik:` token resolves a zero-padded CIK, which never matches several
90
+ - **Name and ticker resolution:** `resolveCik` walks numeric CIK → the `/^[A-Z]{1,5}$/` ticker fast path → the name passes (exact → exact once folded → exact once initials join → prefix → substring over `allEntries`) → a catch-all `byTicker` lookup for symbols whose shape skipped the fast path. Four normalizations hang off that chain. The name passes' **exact** tiers also compare suffix-normalized forms (`normalizeCompanySuffix`): the terminal whitespace-delimited token only, a trailing `.`/`,` stripped as part of recognizing it, expanded to one of four canonical long forms — `corp`→`corporation`, `inc`→`incorporated`, `co`→`company`, `ltd`→`limited`. **The four buckets are never merged.** The registry carries distinct registrants differing only in which suffix they use (`TORO CO` 0000737758 vs `TORO CORP.` 0001941131, and the same shape on Blue Owl and Fluent), so a single "has a corporate suffix" marker would compare two companies equal. Only the terminal token is rewritten — the same words sit mid-name in titles ending in a different suffix (`American Water Works Company, Inc.`) — and a terminal token that merely contains one (`Ltd./ADR`) is not a suffix. Punctuation elsewhere in a name is the fold's (below). `llc`/`plc` and the `lp`/limited-partnership family get no bucket and must never fold into the `ltd` bucket (#107); they drop for a bare query (below) but never normalize into one of the four. The name passes **resolve within the best tier a current name reaches**: several CIKs there are the ambiguity, listed without the tiers below, so `Itron` resolves to ITRON, INC. instead of listing SOLITRON and POSITRON beside it. The exact tier also matches a registry name minus its terminal suffix and a comma before it (`stripCompanySuffix` over `DROPPABLE_SUFFIXES`: the four buckets plus `plc`, `llc`, `lp`, `nv`, `sa`, `ag`, and `se`, with or without periods), so `Apple` names `Apple Inc.` exactly. The wider set is deliberate: with the four buckets alone, `Rio Tinto` silently picked RIO TINTO LTD over RIO TINTO PLC; now both drop to an exact hit and tie. Only the registry side is stripped, so `Toro Co` never meets `TORO CORP.` and `Rio Tinto plc` never meets RIO TINTO LTD, and two suffix variants of one base name (`Blue Owl Capital`) tie. Current names (registry rows, which carry a ticker) choose the tier. A former name joins at that tier or better but never outranks one — otherwise `Travelers` resolves to Citigroup through its former name `travelers inc` — and decides alone only when no current name matches (`Facebook Inc`). Against the 2026-10-02 registry plus the former-names asset, 930 of 34,865 name queries move from ambiguous to resolved and no resolved CIK changes (#155). The **punctuation fold** (`foldNamePunctuation`, #210) deletes `,` `.` `'` `’` from the query and from every current and former name, then collapses each whitespace run to one space (#219), so `QXO Inc` meets `QXO, Inc.`, `Fluent Inc` meets `Fluent, Inc.`, `Jeffs Brands` the former name `jeffs' brands ltd`, and `Forgent Networks Inc` the former name `forgent networks inc`; a period is deleted, never spaced, so `U.S. Bancorp` meets `US BANCORP \DE\`. It is comparison-only — returned names and `suggestCompanies` never see it — and a helper of its own: `normalizeCompanySuffix` and `stripCompanySuffix` read the as-written strings, and the folded tiers run them again on the folded forms. Without the fold a weaker tier answered a punctuation-free spelling with another registrant (`BlackRock Inc` reached BLACKROCK INCOME TRUST, INC. by prefix, `Block Inc` H&R BLOCK INC by substring). Against the 2026-11-03 registry plus the former-names asset, no title queried as listed changes its answer and no title or former name changes CIK; six former names typed as listed now match several companies, the current registrant listed first, since a current title now matches them too (`energizer holdings inc` lists ENERGIZER HOLDINGS, INC. ahead of the former holder). The **initials join** (`joinSpacedInitials`, #219) turns each run of two or more one-letter words in a folded form into one word (`j m smucker co` → `jm smucker co`), so `JM Smucker` and `J.M. Smucker` meet `J M SMUCKER Co` and `WP Carey` meets `W. P. Carey Inc.`; it is comparison-only like the fold, and its tier runs the suffix helpers again on the joined forms. **No hit starts or ends inside a word** (#218): a prefix must end at a word boundary of the joined name and a substring must start at one in the name as written — a boundary is regex `\b`, a letter or digit on exactly one side — so `SY Bancorp, Inc.` no longer names Embassy Bancorp through `embassy`, `helix acquisition corp ii` no longer lists the later `Helix Acquisition Corp. III`, and `ticker:MRO` (a delisted symbol) no longer scopes to PermRock Royalty Trust. Tier order: exact as written, exact once folded, exact once initials join, prefix of the joined form, substring as written. Each tier ranks above the looser one after it, so a title typed as listed never ties a former name equal to it only once folded (`McGraw Hill, Inc.` stays alone beside S&P Global's former `mcgraw hill inc`), and `US Gold` names U.S. GOLD CORP. alone instead of tying McEwen's former `u s gold corp`, equal only once joined. Substring stays as written, so a query ending mid-word still reaches a name containing it as written (`Berkshire Hath`) but never one containing it only once folded: `Helix Acquisition Corp. III` folds to a name holding `helix acquisition corp ii`. A query with no letter or digit (`.`, `'`) is `no_match` instead of folding to a string that starts every name. Against the 2026-11-03 registry plus the former-names asset (#218, #219), no title queried as listed changes its answer; of the former names typed as listed, nine that matched several companies now resolve to their own CIK (`ace ltd` no longer lists MDA Space Ltd. beside Chubb), `total` keeps its CIK in a different list, and `u s gold corp` now matches several, U.S. GOLD CORP. first; 174 of the 178 joined or dotted spellings of the 63 names that space their initials resolve to their own CIK, against 15 before, the other four naming U.S. GOLD CORP.; and all 37 double-spaced former names resolve typed single-spaced, against 17 before. Only a query with no letter or digit loses its match, but a query cut short mid-word that the prefix tier answered alone can now list several companies (`baldw` lists Baldwin Insurance Group beside Matson, whose former name is `alexander & baldwin inc`). `\DE\`-style state tags, `&` `-` `/`, and a dotted word SEC splits in two (`AMAZON COM INC` for `Amazon.com`) stay out of scope. The **catch-all ticker lookup** retries a dotted symbol with `.`→`-` on a miss — brokers and market data write `BRK.B` where `company_tickers.json` lists `BRK-B`, and that file carries exactly one dotted ticker (a placeholder), so the substitution cannot land on the wrong registrant. The early gate stays untouched: it is a fast path, not the only ticker lookup, and `search_filings`' `ticker:` token inherits the fix through `resolveCik` with no change of its own (#110). **No consumer reads the first of several matches** (#223): `company_search`, `get_material_events`, `get_financials`, `get_snapshot`, `get_insider_transactions`, and `search_filings`' `ticker:` token throw `ambiguous_company` (`ValidationError`, one reason and one wording across the six, #228; `data.matches` of `cik`/`name`/`ticker`, the first 10, also listed in the message, and `data.total_matches`, the full count) before any SEC read; `find_holders` and `get_beneficial_owners` `ambiguous_issuer`, `get_institutional_holdings` `ambiguous_entity`, `get_fund_holdings` `ambiguous_fund`, and `compare_companies` reports a per-company `failed[]` reason `ambiguous`. `search_filings`' `cik:` token resolves a zero-padded CIK, which never matches several. `resolveCik` returns every candidate of its best tier, uncut, and `ambiguousMatches` (`src/mcp-server/tools/ambiguous-matches.ts`) is the one cut every ambiguity error shares: the first 10 in resolution order, `data.total_matches` beside them, and, when the list is partial, a message ending `Showing 10 of 66 matches; for one not listed, retry with a fuller name, its ticker, or its CIK.` — `retry with its ticker or CIK.` for `search_filings`' `ticker:` token, which takes no spaces and so no fuller name. Its consumers are the six `ambiguous_company` tools, the four role-specific tools (each keeping its own reason, item wording, and hint), and `compare_companies`' ambiguous `failed_companies[].message`, which takes the list and the sentence and no field. `get_institutional_holdings`' fallback for a name the registry misses, EDGAR entity search (`resolveEntityByName`, `keysTyped=`), returns SEC's first 10 hits beside SEC's `hits.total`, which becomes `data.total_matches` — `of at least 10,000`, with `data.total_matches_is_lower_bound: true`, when its `relation` is `gte`, a floor (#230). When no `compare_companies` input resolves, `no_companies_resolved`'s message repeats each input's `failed_companies[].message`, so `content[]` names the same reasons and candidates as `data.failed_companies` (#231). The 5-candidate cut it replaces hid 61 of `American`'s 66 candidates, American Airlines among them, behind a list that read as complete (#229).
91
91
  - **Former-name resolution:** `src/services/edgar/data/former-names.json` is a committed asset (generated offline via `bun run gen:former-names`) containing `[lowercasedFormerName, zeroPaddedCIK]` tuples. `buildTickerCache` folds them into `allEntries` for name search and the trigram pass. Regenerate on demand after major M&A waves — former names are immutable, so the file rarely needs updating.
92
92
  - **Near-match suggestions:** `suggestCompanies(query, allEntries)` runs a Dice-coefficient trigram pass on the zero-hit search path, returning up to 3 candidates above a threshold. Each entry is scored on its **name and its ticker**, keeping the higher of the two — one ranked, deduped, top-N list rather than two disjoint ones, so a strong ticker match can outrank a weak name match and vice versa, and a ticker-shaped miss gets help instead of a bare `no_match` (#111). An entry missing either field is simply not scored on it: former-name entries carry a name and no ticker, and MF rows carry neither a name nor a place in `allEntries`, so fund tickers stay structurally unreachable here regardless of what the scorer does. Suggestions appear in the `no_match` error `data.suggestions` and in the error message. Never auto-resolves. Only the throw that attaches suggestions names the field in its hint (`company_search` passes its own `recovery.hint`: that sentence, then the contract text); the contract's `no_match` recovery never mentions it, since a zero-hit miss with no near match and the bare-CIK 404 carry no `suggestions` (#153).
93
93
  - **XBRL friendly names:** `concept-map.ts` maps `"revenue"` → real XBRL tags; handles historical tag changes (ASC 606), including both assessed-tax variants — a filer presenting revenue gross of excise/sales tax reports only `RevenueFromContractWithCustomerIncludingAssessedTax`, and without it the walk fell through to tags SEC retired in 2018 (#98). The Including variant sits BEHIND `Revenues`, not ahead of it — the two disagree for filers that tag gross sales and net-of-excise sales under separate elements, so promoting it over `Revenues` swaps the definition partway back through the history and prints a step change that is a tag switch, not a business fact; behind `Revenues` it only fills frames no current tag covers. The same precedent places successor tags: `capex` walks `PaymentsToAcquireProductiveAssets` behind the PP&E-only tag (it also counts software and intangibles) and `interest_expense` walks `InterestExpenseNonoperating` behind both older tags, so NVIDIA, Amazon, Visa, and Microsoft reach current values and no frame the older tags cover changes (#125); the banks' `InterestExpenseOperating` (JPMorgan, Bank of America, and Wells Fargo report interest expense only under it from 2024) goes behind that, since it matches `InterestExpense` for 33 of 37 CY2025Q2 filers reporting both but `InterestExpenseNonoperating` for 0 of 4 (#147). SEC serves both successors with no label, so the line falls back to the concept's label. A different-definition tag still goes in `relatedTags`, never `tags` — `ppe_net`'s finance-lease-inclusive total is the primary line for Alphabet, Meta, and Tesla (#36, #130). `ifrsTags` covers every concept with an IFRS element confirmed present in a live 20-F filer's companyfacts; `notes_payable` is deliberately unmapped (IFRS presents borrowings as one caption, with no notes/debt split) and `shares_outstanding` is `dei`. Never add an `ifrsTags` entry from the taxonomy alone — an element existing is not evidence filers tag it (#99). `ifrsTags` order is semantic the same way `tags` is: index 0 is the counterpart of the us-gaap index-0 tag, so the same concept answers the same question under either taxonomy (`accounts_receivable` leads with the trade-only caption, not the combined trade-and-other one; `share_repurchases` with the financing outflow, not the treasury-only line a share-cancelling filer tags zero). Verify a candidate order against filers that report BOTH tags — presence alone does not settle which one leads. One concept has no right order: IFRS filers split between the employee-scheme share-based-payment element and the IFRS 2.51(a) expense total, and the two invert between filers (SAP's total is its real line with the employee element a two-period fringe; Sanofi is the exact opposite), so `stock_based_compensation` carries `ifrsTagSelection: 'coverage'` and picks per filer by which tag covers more standard periods (#101). It is the only concept that does, and the flag is scoped to `ifrsTags` on purpose — its us-gaap pair IS a ladder, since `AllocatedShareBasedCompensationExpense` is the disaggregated line and out-covers the total for Alphabet, IBM, Tesla, and P&G.
@@ -246,7 +246,7 @@ src/
246
246
  canvas-bridge.ts # Framework DataCanvas adapter, df_<id> minting, per-table TTL
247
247
  sql-gate-extras.ts # Bridge-layer system-catalog deny on top of framework SQL gate
248
248
  mcp-server/
249
- tools/ambiguous-matches.ts # Candidate list (message text + `matches` data) for an ambiguous company resolution
249
+ tools/ambiguous-matches.ts # The one cut (10) of an ambiguous resolution's candidates: message list, `matches` + `total_matches` data, partial-list sentence (#229)
250
250
  tools/escape-inline.ts # escapeInline — escapeMarkdownInline in time linear in its input length (mcp-ts-core#809), for every unauthored string a format() renders
251
251
  tools/fixed-point.ts # Fixed-point rendering of parsed numbers without rounding their digits
252
252
  tools/format-usd.ts # USD amounts scaled by magnitude (T/B/M/K, sign before the $) and every-digit grouping for content[] (#222)
@@ -452,7 +452,7 @@ import { getEdgarApiService } from '@/services/edgar/edgar-api-service.js';
452
452
  - [ ] `ctx.log` for logging, `ctx.state` for storage
453
453
  - [ ] Handlers throw on failure — typed `errors[]` contract + `ctx.fail(reason, …)` when failure modes are known; factories or plain `Error` for ad-hoc throws. No try/catch.
454
454
  - [ ] Tool error contracts include `recovery` strings (≥5 words)
455
- - [ ] `format()` renders all data the LLM needs — Claude Code reads `structuredContent`, Claude Desktop reads `content[]`; both must carry the same data. Every string the server did not author (SEC text, caller input, SQL results) renders through `escapeInline` (`src/mcp-server/tools/escape-inline.ts`) — the framework's `escapeMarkdownInline`, kept linear in its input length until mcp-ts-core#809 lands — and JSON meant to be copied back into a call renders as a code span (`markdown().inlineCode`), so it reads back under CommonMark as the `structuredContent` value
455
+ - [ ] `format()` renders all data the LLM needs — Claude Code reads `structuredContent`, Claude Desktop reads `content[]`; both must carry the same data. Every string the server did not author (SEC text, caller input, SQL results) reads back under CommonMark as the `structuredContent` value: inline text renders through `escapeInline` (`src/mcp-server/tools/escape-inline.ts` — the framework's `escapeMarkdownInline`, kept linear in its input length until mcp-ts-core#809 lands), multi-line upstream document text (a filing body) as a fenced block sized past its longest backtick run (`markdown().codeBlock`), which keeps its line layout, and JSON meant to be copied back into a call as a code span (`markdown().inlineCode`)
456
456
  - [ ] EDGAR upstream sparsity: schemas reflect real nullability; `format()` preserves uncertainty (don't fabricate facts from missing XBRL fields); tests cover at least one sparse payload
457
457
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
458
458
  - [ ] Tests use `createMockContext({ errors: tool.errors })` from `@cyanheads/mcp-ts-core/testing` for tools with declared contracts
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** secedgar-mcp-server
4
- **Version:** 0.18.0
4
+ **Version:** 0.18.1
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
@@ -87,7 +87,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
87
87
  - **User-Agent required:** `"AppName contact@email.com"` on every SEC request or IP gets blocked
88
88
  - **CIK zero-padding:** the `data.sec.gov` APIs (submissions, companyfacts, companyconcept) require the 10-digit zero-padded CIK (`String(cik).padStart(10, '0')`). Archive paths under `www.sec.gov/Archives/edgar/data/` take it unpadded — SEC answers the padded path with a 301, and `fetch` follows it inside the same pacer slot, so every archive read would cost two requests. `filingArchiveUrl` (exported from `edgar-api-service.ts`) strips the zeros for all seven archive reads and for `get_filing`'s `filing_url` (#156)
89
89
  - **ETF/mutual-fund tickers:** `loadTickerCache` fetches `company_tickers_mf.json` alongside `company_tickers.json` and merges fund symbols (VOO, SCHD, JEPI…) into `byTicker`. Fund CIKs are registrant trusts (1:many with series), so fund rows go into `byTicker` only — never `byCik`, whichever source they come from. Resolved fund matches carry `seriesId`/`classId` from the live MF file, the only source of either. On a mirror-served ticker base the live MF fetch is merged in when `EDGAR_MIRROR_FALLBACK_LIVE` is on, so fund tickers resolve even if the mirror predates MF ingestion (#43); strict mirror-only (`FALLBACK_LIVE=false`) uses the mirror's own MF rows (ticker→CIK, no series/class). The mirror stores a fund symbol with an empty name — its schema has no series column — and `mirrorIndexRow` reads that empty name as the fund marker; a symbol claims `byTicker` in the order equity → live fund → mirror fund, so a live entry supersedes the mirror's bare row and keeps its series (#135). **The live fund slice has its own failure window:** a failed MF load (any HTTP failure, a malformed body, the block gate's refusal) is not cached for the ticker-cache TTL — `loadMfTickers` returns no rows and a `retryAt` `FUND_SLICE_RETRY_MS` (60 s) out, or the error's `retryAfter` when longer, so nothing is retried while the gate is closed. The first resolution after it refetches the file once, single-flight, onto the cached base (`reloadFundSlice`), which keeps its own load time: the equity index is not refetched and its TTL does not move. A per-resolution retry was rejected — against a persistent 5xx it adds three requests and ~3 s of backoff to every lookup (#119). Each failed load logs one warning through the framework's global `logger` (no request context to attach to) carrying `endpoint: 'company_tickers_mf'` (never the URL — framework log guidance keeps URLs out of log fields), the HTTP status or `malformed_body`, and the retry delay (#43).
90
- - **Name and ticker resolution:** `resolveCik` walks numeric CIK → the `/^[A-Z]{1,5}$/` ticker fast path → the name passes (exact → exact once folded → exact once initials join → prefix → substring over `allEntries`) → a catch-all `byTicker` lookup for symbols whose shape skipped the fast path. Four normalizations hang off that chain. The name passes' **exact** tiers also compare suffix-normalized forms (`normalizeCompanySuffix`): the terminal whitespace-delimited token only, a trailing `.`/`,` stripped as part of recognizing it, expanded to one of four canonical long forms — `corp`→`corporation`, `inc`→`incorporated`, `co`→`company`, `ltd`→`limited`. **The four buckets are never merged.** The registry carries distinct registrants differing only in which suffix they use (`TORO CO` 0000737758 vs `TORO CORP.` 0001941131, and the same shape on Blue Owl and Fluent), so a single "has a corporate suffix" marker would compare two companies equal. Only the terminal token is rewritten — the same words sit mid-name in titles ending in a different suffix (`American Water Works Company, Inc.`) — and a terminal token that merely contains one (`Ltd./ADR`) is not a suffix. Punctuation elsewhere in a name is the fold's (below). `llc`/`plc` and the `lp`/limited-partnership family get no bucket and must never fold into the `ltd` bucket (#107); they drop for a bare query (below) but never normalize into one of the four. The name passes **resolve within the best tier a current name reaches**: several CIKs there are the ambiguity, listed without the tiers below, so `Itron` resolves to ITRON, INC. instead of listing SOLITRON and POSITRON beside it. The exact tier also matches a registry name minus its terminal suffix and a comma before it (`stripCompanySuffix` over `DROPPABLE_SUFFIXES`: the four buckets plus `plc`, `llc`, `lp`, `nv`, `sa`, `ag`, and `se`, with or without periods), so `Apple` names `Apple Inc.` exactly. The wider set is deliberate: with the four buckets alone, `Rio Tinto` silently picked RIO TINTO LTD over RIO TINTO PLC; now both drop to an exact hit and tie. Only the registry side is stripped, so `Toro Co` never meets `TORO CORP.` and `Rio Tinto plc` never meets RIO TINTO LTD, and two suffix variants of one base name (`Blue Owl Capital`) tie. Current names (registry rows, which carry a ticker) choose the tier. A former name joins at that tier or better but never outranks one — otherwise `Travelers` resolves to Citigroup through its former name `travelers inc` — and decides alone only when no current name matches (`Facebook Inc`). Against the 2026-10-02 registry plus the former-names asset, 930 of 34,865 name queries move from ambiguous to resolved and no resolved CIK changes (#155). The **punctuation fold** (`foldNamePunctuation`, #210) deletes `,` `.` `'` `’` from the query and from every current and former name, then collapses each whitespace run to one space (#219), so `QXO Inc` meets `QXO, Inc.`, `Fluent Inc` meets `Fluent, Inc.`, `Jeffs Brands` the former name `jeffs' brands ltd`, and `Forgent Networks Inc` the former name `forgent networks inc`; a period is deleted, never spaced, so `U.S. Bancorp` meets `US BANCORP \DE\`. It is comparison-only — returned names and `suggestCompanies` never see it — and a helper of its own: `normalizeCompanySuffix` and `stripCompanySuffix` read the as-written strings, and the folded tiers run them again on the folded forms. Without the fold a weaker tier answered a punctuation-free spelling with another registrant (`BlackRock Inc` reached BLACKROCK INCOME TRUST, INC. by prefix, `Block Inc` H&R BLOCK INC by substring). Against the 2026-11-03 registry plus the former-names asset, no title queried as listed changes its answer and no title or former name changes CIK; six former names typed as listed move to `multiple_matches` with the current registrant first, since a current title now matches them too (`energizer holdings inc` lists ENERGIZER HOLDINGS, INC. ahead of the former holder). The **initials join** (`joinSpacedInitials`, #219) turns each run of two or more one-letter words in a folded form into one word (`j m smucker co` → `jm smucker co`), so `JM Smucker` and `J.M. Smucker` meet `J M SMUCKER Co` and `WP Carey` meets `W. P. Carey Inc.`; it is comparison-only like the fold, and its tier runs the suffix helpers again on the joined forms. **No hit starts or ends inside a word** (#218): a prefix must end at a word boundary of the joined name and a substring must start at one in the name as written — a boundary is regex `\b`, a letter or digit on exactly one side — so `SY Bancorp, Inc.` no longer names Embassy Bancorp through `embassy`, `helix acquisition corp ii` no longer lists the later `Helix Acquisition Corp. III`, and `ticker:MRO` (a delisted symbol) no longer scopes to PermRock Royalty Trust. Tier order: exact as written, exact once folded, exact once initials join, prefix of the joined form, substring as written. Each tier ranks above the looser one after it, so a title typed as listed never ties a former name equal to it only once folded (`McGraw Hill, Inc.` stays alone beside S&P Global's former `mcgraw hill inc`), and `US Gold` names U.S. GOLD CORP. alone instead of tying McEwen's former `u s gold corp`, equal only once joined. Substring stays as written, so a query ending mid-word still reaches a name containing it as written (`Berkshire Hath`) but never one containing it only once folded: `Helix Acquisition Corp. III` folds to a name holding `helix acquisition corp ii`. A query with no letter or digit (`.`, `'`) is `no_match` instead of folding to a string that starts every name. Against the 2026-11-03 registry plus the former-names asset (#218, #219), no title queried as listed changes its answer; of the former names typed as listed, nine move from `multiple_matches` to their own CIK (`ace ltd` no longer lists MDA Space Ltd. beside Chubb), `total` keeps its CIK in a different list, and `u s gold corp` moves to `multiple_matches` with U.S. GOLD CORP. first; 174 of the 178 joined or dotted spellings of the 63 names that space their initials resolve to their own CIK, against 15 before, the other four naming U.S. GOLD CORP.; and all 37 double-spaced former names resolve typed single-spaced, against 17 before. Only a query with no letter or digit loses its match, but a query cut short mid-word that the prefix tier answered alone can now list several companies (`baldw` lists Baldwin Insurance Group beside Matson, whose former name is `alexander & baldwin inc`). `\DE\`-style state tags, `&` `-` `/`, and a dotted word SEC splits in two (`AMAZON COM INC` for `Amazon.com`) stay out of scope. The **catch-all ticker lookup** retries a dotted symbol with `.`→`-` on a miss — brokers and market data write `BRK.B` where `company_tickers.json` lists `BRK-B`, and that file carries exactly one dotted ticker (a placeholder), so the substitution cannot land on the wrong registrant. The early gate stays untouched: it is a fast path, not the only ticker lookup, and `search_filings`' `ticker:` token inherits the fix through `resolveCik` with no change of its own (#110). **No consumer reads the first of several matches** (#223): `get_financials`, `get_snapshot`, `get_insider_transactions`, and `search_filings`' `ticker:` token throw `ambiguous_company` (`data.matches` of `cik`/`name`/`ticker`, at most 10, also listed in the message) before any SEC read; `company_search` and `get_material_events` throw `multiple_matches`, `find_holders` and `get_beneficial_owners` `ambiguous_issuer`, `get_institutional_holdings` `ambiguous_entity`, `get_fund_holdings` `ambiguous_fund`, and `compare_companies` reports a per-company `failed[]` reason `ambiguous`. `search_filings`' `cik:` token resolves a zero-padded CIK, which never matches several
90
+ - **Name and ticker resolution:** `resolveCik` walks numeric CIK → the `/^[A-Z]{1,5}$/` ticker fast path → the name passes (exact → exact once folded → exact once initials join → prefix → substring over `allEntries`) → a catch-all `byTicker` lookup for symbols whose shape skipped the fast path. Four normalizations hang off that chain. The name passes' **exact** tiers also compare suffix-normalized forms (`normalizeCompanySuffix`): the terminal whitespace-delimited token only, a trailing `.`/`,` stripped as part of recognizing it, expanded to one of four canonical long forms — `corp`→`corporation`, `inc`→`incorporated`, `co`→`company`, `ltd`→`limited`. **The four buckets are never merged.** The registry carries distinct registrants differing only in which suffix they use (`TORO CO` 0000737758 vs `TORO CORP.` 0001941131, and the same shape on Blue Owl and Fluent), so a single "has a corporate suffix" marker would compare two companies equal. Only the terminal token is rewritten — the same words sit mid-name in titles ending in a different suffix (`American Water Works Company, Inc.`) — and a terminal token that merely contains one (`Ltd./ADR`) is not a suffix. Punctuation elsewhere in a name is the fold's (below). `llc`/`plc` and the `lp`/limited-partnership family get no bucket and must never fold into the `ltd` bucket (#107); they drop for a bare query (below) but never normalize into one of the four. The name passes **resolve within the best tier a current name reaches**: several CIKs there are the ambiguity, listed without the tiers below, so `Itron` resolves to ITRON, INC. instead of listing SOLITRON and POSITRON beside it. The exact tier also matches a registry name minus its terminal suffix and a comma before it (`stripCompanySuffix` over `DROPPABLE_SUFFIXES`: the four buckets plus `plc`, `llc`, `lp`, `nv`, `sa`, `ag`, and `se`, with or without periods), so `Apple` names `Apple Inc.` exactly. The wider set is deliberate: with the four buckets alone, `Rio Tinto` silently picked RIO TINTO LTD over RIO TINTO PLC; now both drop to an exact hit and tie. Only the registry side is stripped, so `Toro Co` never meets `TORO CORP.` and `Rio Tinto plc` never meets RIO TINTO LTD, and two suffix variants of one base name (`Blue Owl Capital`) tie. Current names (registry rows, which carry a ticker) choose the tier. A former name joins at that tier or better but never outranks one — otherwise `Travelers` resolves to Citigroup through its former name `travelers inc` — and decides alone only when no current name matches (`Facebook Inc`). Against the 2026-10-02 registry plus the former-names asset, 930 of 34,865 name queries move from ambiguous to resolved and no resolved CIK changes (#155). The **punctuation fold** (`foldNamePunctuation`, #210) deletes `,` `.` `'` `’` from the query and from every current and former name, then collapses each whitespace run to one space (#219), so `QXO Inc` meets `QXO, Inc.`, `Fluent Inc` meets `Fluent, Inc.`, `Jeffs Brands` the former name `jeffs' brands ltd`, and `Forgent Networks Inc` the former name `forgent networks inc`; a period is deleted, never spaced, so `U.S. Bancorp` meets `US BANCORP \DE\`. It is comparison-only — returned names and `suggestCompanies` never see it — and a helper of its own: `normalizeCompanySuffix` and `stripCompanySuffix` read the as-written strings, and the folded tiers run them again on the folded forms. Without the fold a weaker tier answered a punctuation-free spelling with another registrant (`BlackRock Inc` reached BLACKROCK INCOME TRUST, INC. by prefix, `Block Inc` H&R BLOCK INC by substring). Against the 2026-11-03 registry plus the former-names asset, no title queried as listed changes its answer and no title or former name changes CIK; six former names typed as listed now match several companies, the current registrant listed first, since a current title now matches them too (`energizer holdings inc` lists ENERGIZER HOLDINGS, INC. ahead of the former holder). The **initials join** (`joinSpacedInitials`, #219) turns each run of two or more one-letter words in a folded form into one word (`j m smucker co` → `jm smucker co`), so `JM Smucker` and `J.M. Smucker` meet `J M SMUCKER Co` and `WP Carey` meets `W. P. Carey Inc.`; it is comparison-only like the fold, and its tier runs the suffix helpers again on the joined forms. **No hit starts or ends inside a word** (#218): a prefix must end at a word boundary of the joined name and a substring must start at one in the name as written — a boundary is regex `\b`, a letter or digit on exactly one side — so `SY Bancorp, Inc.` no longer names Embassy Bancorp through `embassy`, `helix acquisition corp ii` no longer lists the later `Helix Acquisition Corp. III`, and `ticker:MRO` (a delisted symbol) no longer scopes to PermRock Royalty Trust. Tier order: exact as written, exact once folded, exact once initials join, prefix of the joined form, substring as written. Each tier ranks above the looser one after it, so a title typed as listed never ties a former name equal to it only once folded (`McGraw Hill, Inc.` stays alone beside S&P Global's former `mcgraw hill inc`), and `US Gold` names U.S. GOLD CORP. alone instead of tying McEwen's former `u s gold corp`, equal only once joined. Substring stays as written, so a query ending mid-word still reaches a name containing it as written (`Berkshire Hath`) but never one containing it only once folded: `Helix Acquisition Corp. III` folds to a name holding `helix acquisition corp ii`. A query with no letter or digit (`.`, `'`) is `no_match` instead of folding to a string that starts every name. Against the 2026-11-03 registry plus the former-names asset (#218, #219), no title queried as listed changes its answer; of the former names typed as listed, nine that matched several companies now resolve to their own CIK (`ace ltd` no longer lists MDA Space Ltd. beside Chubb), `total` keeps its CIK in a different list, and `u s gold corp` now matches several, U.S. GOLD CORP. first; 174 of the 178 joined or dotted spellings of the 63 names that space their initials resolve to their own CIK, against 15 before, the other four naming U.S. GOLD CORP.; and all 37 double-spaced former names resolve typed single-spaced, against 17 before. Only a query with no letter or digit loses its match, but a query cut short mid-word that the prefix tier answered alone can now list several companies (`baldw` lists Baldwin Insurance Group beside Matson, whose former name is `alexander & baldwin inc`). `\DE\`-style state tags, `&` `-` `/`, and a dotted word SEC splits in two (`AMAZON COM INC` for `Amazon.com`) stay out of scope. The **catch-all ticker lookup** retries a dotted symbol with `.`→`-` on a miss — brokers and market data write `BRK.B` where `company_tickers.json` lists `BRK-B`, and that file carries exactly one dotted ticker (a placeholder), so the substitution cannot land on the wrong registrant. The early gate stays untouched: it is a fast path, not the only ticker lookup, and `search_filings`' `ticker:` token inherits the fix through `resolveCik` with no change of its own (#110). **No consumer reads the first of several matches** (#223): `company_search`, `get_material_events`, `get_financials`, `get_snapshot`, `get_insider_transactions`, and `search_filings`' `ticker:` token throw `ambiguous_company` (`ValidationError`, one reason and one wording across the six, #228; `data.matches` of `cik`/`name`/`ticker`, the first 10, also listed in the message, and `data.total_matches`, the full count) before any SEC read; `find_holders` and `get_beneficial_owners` `ambiguous_issuer`, `get_institutional_holdings` `ambiguous_entity`, `get_fund_holdings` `ambiguous_fund`, and `compare_companies` reports a per-company `failed[]` reason `ambiguous`. `search_filings`' `cik:` token resolves a zero-padded CIK, which never matches several. `resolveCik` returns every candidate of its best tier, uncut, and `ambiguousMatches` (`src/mcp-server/tools/ambiguous-matches.ts`) is the one cut every ambiguity error shares: the first 10 in resolution order, `data.total_matches` beside them, and, when the list is partial, a message ending `Showing 10 of 66 matches; for one not listed, retry with a fuller name, its ticker, or its CIK.` — `retry with its ticker or CIK.` for `search_filings`' `ticker:` token, which takes no spaces and so no fuller name. Its consumers are the six `ambiguous_company` tools, the four role-specific tools (each keeping its own reason, item wording, and hint), and `compare_companies`' ambiguous `failed_companies[].message`, which takes the list and the sentence and no field. `get_institutional_holdings`' fallback for a name the registry misses, EDGAR entity search (`resolveEntityByName`, `keysTyped=`), returns SEC's first 10 hits beside SEC's `hits.total`, which becomes `data.total_matches` — `of at least 10,000`, with `data.total_matches_is_lower_bound: true`, when its `relation` is `gte`, a floor (#230). When no `compare_companies` input resolves, `no_companies_resolved`'s message repeats each input's `failed_companies[].message`, so `content[]` names the same reasons and candidates as `data.failed_companies` (#231). The 5-candidate cut it replaces hid 61 of `American`'s 66 candidates, American Airlines among them, behind a list that read as complete (#229).
91
91
  - **Former-name resolution:** `src/services/edgar/data/former-names.json` is a committed asset (generated offline via `bun run gen:former-names`) containing `[lowercasedFormerName, zeroPaddedCIK]` tuples. `buildTickerCache` folds them into `allEntries` for name search and the trigram pass. Regenerate on demand after major M&A waves — former names are immutable, so the file rarely needs updating.
92
92
  - **Near-match suggestions:** `suggestCompanies(query, allEntries)` runs a Dice-coefficient trigram pass on the zero-hit search path, returning up to 3 candidates above a threshold. Each entry is scored on its **name and its ticker**, keeping the higher of the two — one ranked, deduped, top-N list rather than two disjoint ones, so a strong ticker match can outrank a weak name match and vice versa, and a ticker-shaped miss gets help instead of a bare `no_match` (#111). An entry missing either field is simply not scored on it: former-name entries carry a name and no ticker, and MF rows carry neither a name nor a place in `allEntries`, so fund tickers stay structurally unreachable here regardless of what the scorer does. Suggestions appear in the `no_match` error `data.suggestions` and in the error message. Never auto-resolves. Only the throw that attaches suggestions names the field in its hint (`company_search` passes its own `recovery.hint`: that sentence, then the contract text); the contract's `no_match` recovery never mentions it, since a zero-hit miss with no near match and the bare-CIK 404 carry no `suggestions` (#153).
93
93
  - **XBRL friendly names:** `concept-map.ts` maps `"revenue"` → real XBRL tags; handles historical tag changes (ASC 606), including both assessed-tax variants — a filer presenting revenue gross of excise/sales tax reports only `RevenueFromContractWithCustomerIncludingAssessedTax`, and without it the walk fell through to tags SEC retired in 2018 (#98). The Including variant sits BEHIND `Revenues`, not ahead of it — the two disagree for filers that tag gross sales and net-of-excise sales under separate elements, so promoting it over `Revenues` swaps the definition partway back through the history and prints a step change that is a tag switch, not a business fact; behind `Revenues` it only fills frames no current tag covers. The same precedent places successor tags: `capex` walks `PaymentsToAcquireProductiveAssets` behind the PP&E-only tag (it also counts software and intangibles) and `interest_expense` walks `InterestExpenseNonoperating` behind both older tags, so NVIDIA, Amazon, Visa, and Microsoft reach current values and no frame the older tags cover changes (#125); the banks' `InterestExpenseOperating` (JPMorgan, Bank of America, and Wells Fargo report interest expense only under it from 2024) goes behind that, since it matches `InterestExpense` for 33 of 37 CY2025Q2 filers reporting both but `InterestExpenseNonoperating` for 0 of 4 (#147). SEC serves both successors with no label, so the line falls back to the concept's label. A different-definition tag still goes in `relatedTags`, never `tags` — `ppe_net`'s finance-lease-inclusive total is the primary line for Alphabet, Meta, and Tesla (#36, #130). `ifrsTags` covers every concept with an IFRS element confirmed present in a live 20-F filer's companyfacts; `notes_payable` is deliberately unmapped (IFRS presents borrowings as one caption, with no notes/debt split) and `shares_outstanding` is `dei`. Never add an `ifrsTags` entry from the taxonomy alone — an element existing is not evidence filers tag it (#99). `ifrsTags` order is semantic the same way `tags` is: index 0 is the counterpart of the us-gaap index-0 tag, so the same concept answers the same question under either taxonomy (`accounts_receivable` leads with the trade-only caption, not the combined trade-and-other one; `share_repurchases` with the financing outflow, not the treasury-only line a share-cancelling filer tags zero). Verify a candidate order against filers that report BOTH tags — presence alone does not settle which one leads. One concept has no right order: IFRS filers split between the employee-scheme share-based-payment element and the IFRS 2.51(a) expense total, and the two invert between filers (SAP's total is its real line with the employee element a two-period fringe; Sanofi is the exact opposite), so `stock_based_compensation` carries `ifrsTagSelection: 'coverage'` and picks per filer by which tag covers more standard periods (#101). It is the only concept that does, and the flag is scoped to `ifrsTags` on purpose — its us-gaap pair IS a ladder, since `AllocatedShareBasedCompensationExpense` is the disaggregated line and out-covers the total for Alphabet, IBM, Tesla, and P&G.
@@ -246,7 +246,7 @@ src/
246
246
  canvas-bridge.ts # Framework DataCanvas adapter, df_<id> minting, per-table TTL
247
247
  sql-gate-extras.ts # Bridge-layer system-catalog deny on top of framework SQL gate
248
248
  mcp-server/
249
- tools/ambiguous-matches.ts # Candidate list (message text + `matches` data) for an ambiguous company resolution
249
+ tools/ambiguous-matches.ts # The one cut (10) of an ambiguous resolution's candidates: message list, `matches` + `total_matches` data, partial-list sentence (#229)
250
250
  tools/escape-inline.ts # escapeInline — escapeMarkdownInline in time linear in its input length (mcp-ts-core#809), for every unauthored string a format() renders
251
251
  tools/fixed-point.ts # Fixed-point rendering of parsed numbers without rounding their digits
252
252
  tools/format-usd.ts # USD amounts scaled by magnitude (T/B/M/K, sign before the $) and every-digit grouping for content[] (#222)
@@ -452,7 +452,7 @@ import { getEdgarApiService } from '@/services/edgar/edgar-api-service.js';
452
452
  - [ ] `ctx.log` for logging, `ctx.state` for storage
453
453
  - [ ] Handlers throw on failure — typed `errors[]` contract + `ctx.fail(reason, …)` when failure modes are known; factories or plain `Error` for ad-hoc throws. No try/catch.
454
454
  - [ ] Tool error contracts include `recovery` strings (≥5 words)
455
- - [ ] `format()` renders all data the LLM needs — Claude Code reads `structuredContent`, Claude Desktop reads `content[]`; both must carry the same data. Every string the server did not author (SEC text, caller input, SQL results) renders through `escapeInline` (`src/mcp-server/tools/escape-inline.ts`) — the framework's `escapeMarkdownInline`, kept linear in its input length until mcp-ts-core#809 lands — and JSON meant to be copied back into a call renders as a code span (`markdown().inlineCode`), so it reads back under CommonMark as the `structuredContent` value
455
+ - [ ] `format()` renders all data the LLM needs — Claude Code reads `structuredContent`, Claude Desktop reads `content[]`; both must carry the same data. Every string the server did not author (SEC text, caller input, SQL results) reads back under CommonMark as the `structuredContent` value: inline text renders through `escapeInline` (`src/mcp-server/tools/escape-inline.ts` — the framework's `escapeMarkdownInline`, kept linear in its input length until mcp-ts-core#809 lands), multi-line upstream document text (a filing body) as a fenced block sized past its longest backtick run (`markdown().codeBlock`), which keeps its line layout, and JSON meant to be copied back into a call as a code span (`markdown().inlineCode`)
456
456
  - [ ] EDGAR upstream sparsity: schemas reflect real nullability; `format()` preserves uncertainty (don't fabricate facts from missing XBRL fields); tests cover at least one sparse payload
457
457
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
458
458
  - [ ] Tests use `createMockContext({ errors: tool.errors })` from `@cyanheads/mcp-ts-core/testing` for tools with declared contracts
package/README.md CHANGED
@@ -81,7 +81,7 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
81
81
  ### `secedgar_company_search` <sub>tool</sub>
82
82
 
83
83
  - `query` takes a ticker (equities, ETFs, mutual funds), a current or former company name, or a CIK; `include_filings` (default on) adds up to `filing_limit` filings (default 10; a value up to 1,000 is served at the 50 inline cap), filtered by `forms`, `filed_after`, and `filed_before`
84
- - Returns SIC code, exchanges, fiscal year end, and state of incorporation, plus `series_id` / `class_id` for a fund ticker; fails as `no_match` (with near matches in `data.suggestions`) or `multiple_matches`
84
+ - Returns SIC code, exchanges, fiscal year end, and state of incorporation, plus `series_id` / `class_id` for a fund ticker; fails as `no_match` (with near matches in `data.suggestions`) or, for a name matching several companies, `ambiguous_company`, listing up to 10 by CIK, name, and ticker to retry with, plus the full count in `total_matches`
85
85
  - A date or form filter can reach into the archive (up to 10 pages); `history_scanned_through` reports how far it got
86
86
 
87
87
  ---
@@ -130,7 +130,7 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
130
130
 
131
131
  ### `secedgar_get_insider_transactions` <sub>tool</sub>
132
132
 
133
- - `company` is the issuer, as a ticker, CIK, or current or former name; a name matching several companies fails as `ambiguous_company`, listing each CIK, name, and ticker to retry with; `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
133
+ - `company` is the issuer, as a ticker, CIK, or current or former name; 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
134
134
  - 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
135
135
  - 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.
136
136
 
@@ -142,7 +142,7 @@ The skill ships in `skills/secedgar-guide/SKILL.md`. Plugin hosts load it from t
142
142
  - 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
143
143
  - Holdings, paging, consolidation, and the dataframe cover the quarter composed from the original 13F-HR and its same-period 13F-HR/A amendments, applied in `acceptanceDateTime` order: a `RESTATEMENT` replaces everything composed so far (earlier `NEW HOLDINGS` included); a `NEW HOLDINGS` amendment appends its rows, unless its table repeats every composed row (CUSIP, class, put/call, discretion, shares, share type), in which case it applies as a restatement. Values normalize by each accession's own filing date. Only tables from the last readable restatement on are read
144
144
  - `amendments` (newest filed first) discloses each accession, filing date, and cover-page type (`UNAVAILABLE` with a reason when unreadable), plus `applied_as`: `restatement`, `new_holdings`, `superseded`, or `not_applied` (type or table unreadable, named in the notice); inspect any with `secedgar_get_filing`. `composed_accessions` lists the filings the rows come from, in application order. `amendment_search_complete=false` warns that bounded or unavailable archive discovery may have missed amendments
145
- - Holdings carry issuer, CUSIP, `market_value_usd` in whole USD, shares or principal, `put_call`, and `source_accession_numbers` (a consolidated position lists each filing it came from; also a dataframe column); `total_holdings_in_filing` counts the original 13F-HR's raw rows, `total_holdings_composed` the composed raw rows, and `total_positions` distinct composed positions; `accession_number` and `filing_date` name the original 13F-HR; a shared legal name fails as `ambiguous_entity`
145
+ - Holdings carry issuer, CUSIP, `market_value_usd` in whole USD, shares or principal, `put_call`, and `source_accession_numbers` (a consolidated position lists each filing it came from; also a dataframe column); `total_holdings_in_filing` counts the original 13F-HR's raw rows, `total_holdings_composed` the composed raw rows, and `total_positions` distinct composed positions; `accession_number` and `filing_date` name the original 13F-HR; a shared legal name fails as `ambiguous_entity`, listing up to 10 by CIK and name plus the full count in `total_matches` (EDGAR's own count for a name found by entity search, a floor when `total_matches_is_lower_bound` is true)
146
146
 
147
147
  ---
148
148
 
@@ -0,0 +1,38 @@
1
+ ---
2
+ summary: "Ambiguity errors count every match behind the 10 they list, and secedgar_get_filing's body reads back from content[] exactly as structuredContent carries it."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.18.1 — 2026-11-03
8
+
9
+ ## Changed
10
+
11
+ - **`secedgar_company_search` and `secedgar_get_material_events` fail an ambiguous name as `ambiguous_company`** ([#228](https://github.com/cyanheads/secedgar-mcp-server/issues/228)), a `ValidationError` with the candidates in `data.matches`, as `secedgar_get_financials` does. It replaces `multiple_matches` (`NotFound`); callers branching on that reason switch. `secedgar_company_search` keeps `data.query`.
12
+
13
+ ## Fixed
14
+
15
+ - **`secedgar_get_filing` body in `content[]`** ([#226](https://github.com/cyanheads/secedgar-mcp-server/issues/226)) sits in a fenced block between the unchanged BEGIN/END sentinels, so a CommonMark parse no longer turns dash rules into breaks, `*` and `1.` lines into lists, or indented lines into code.
16
+ - **Ambiguity errors list 10 candidates and carry `data.total_matches`** ([#229](https://github.com/cyanheads/secedgar-mcp-server/issues/229)). `resolveCik` returned only the first 5 of a name's candidates ("American" has 66, American Airlines 9th), so the company meant could be missing from the list. A partial list ends `Showing 10 of 66 matches; …`; a list of 10 or fewer has no such sentence. `secedgar_search_filings`' `ticker:` token ends `retry with its ticker or CIK.`
17
+ - **`secedgar_get_institutional_holdings` entity-search ambiguity reports SEC's own count** ([#230](https://github.com/cyanheads/secedgar-mcp-server/issues/230)): `data.total_matches` and the `Showing 10 of 598 matches; …` sentence. When SEC reports its count as a floor (`relation: "gte"`, which it does at 10,000), the sentence reads `of at least 10,000` and `data.total_matches_is_lower_bound` is `true`.
18
+ - **`secedgar_compare_companies` `no_companies_resolved` message repeats each input's failure message** ([#231](https://github.com/cyanheads/secedgar-mcp-server/issues/231)), candidates included, so `content[]` names what `data.failed_companies` does.
19
+
20
+ ## Dependencies
21
+
22
+ - `vitest` ^5.0.5 → ^5.1.0 (dev)
23
+ - `hono` 4.13.13 → 4.13.16 (lockfile)
24
+ - `jose` 6.2.13 → 6.2.15 (lockfile)
25
+ - `@hono/node-server` 2.1.5 → 2.1.6 (lockfile)
26
+ - `fast-copy` 4.2.0 → 4.3.1 (lockfile)
27
+ - `thread-stream` 4.2.0 → 4.2.1 (lockfile)
28
+ - `semver` 7.8.5 → 7.8.6 (lockfile)
29
+ - `magic-string` 1.4.3 → 1.4.5 (lockfile)
30
+ - `postcss` 8.5.31 → 8.5.32 (lockfile)
31
+ - `tinybench` 6.2.2 → 6.2.3 (lockfile)
32
+ - `@types/estree` 1.0.9 → 1.0.10 (lockfile)
33
+ - `@babel/generator` 7.29.8 → 7.29.12 (lockfile)
34
+ - `@babel/parser` 7.29.11 → 7.29.12 (lockfile)
35
+ - `@babel/traverse` 7.29.10 → 7.29.12 (lockfile)
36
+ - `@oxc-project/types` 0.155.0 → 0.156.0 (lockfile)
37
+ - `@vitest/mocker`, `@vitest/spy` 5.0.5 → 5.1.0 (lockfile)
38
+ - `rolldown` and its 15 `@rolldown/binding-*` packages 1.2.15 → 1.2.16 (lockfile)
@@ -1,20 +1,59 @@
1
1
  /**
2
- * @fileoverview The candidates an ambiguous company resolution names, rendered for the error
3
- * message itself (clients that read only `content[]` otherwise get a "pick from the matches
4
- * list" instruction with no list to pick from, #90) and for the `matches` data field.
2
+ * @fileoverview The one cut every ambiguity error shows of the candidates a name resolves to,
3
+ * rendered for the error message itself (clients that read only `content[]` otherwise get a
4
+ * "pick from the matches list" instruction with no list to pick from, #90) and for the error
5
+ * data, with the full count and the sentence that says a list is partial (#229, #230).
5
6
  * @module mcp-server/tools/ambiguous-matches
6
7
  */
7
- import type { CikMatch } from '../../services/edgar/types.js';
8
- /**
9
- * The first {@link MAX_SHOWN} candidates of a multi-match `resolveCik` result: `list` reads
10
- * `<cik> <name> (<ticker>), …` for the message, `matches` carries the same rows as data.
11
- */
12
- export declare function ambiguousMatches(resolved: readonly CikMatch[]): {
8
+ /** One candidate an ambiguous resolution names. */
9
+ export interface AmbiguousCandidate {
10
+ cik: string;
11
+ name?: string | undefined;
12
+ ticker?: string | undefined;
13
+ }
14
+ /** How many candidates match in all, when an upstream reports more than it returns (#230). */
15
+ export interface MatchTotal {
16
+ count: number;
17
+ /** `count` is a floor the upstream reports (EDGAR full-text search's `relation: "gte"`). */
18
+ lowerBound?: boolean;
19
+ }
20
+ /** How a consumer's input shapes the cut's count and its partial-list sentence. */
21
+ export interface AmbiguousMatchesOptions {
22
+ /**
23
+ * The input is one token with no spaces (`search_filings`' `ticker:` value), which cannot
24
+ * carry a fuller name, so the sentence offers only a ticker or CIK.
25
+ */
26
+ singleToken?: boolean;
27
+ /**
28
+ * Defaults to every candidate passed, so a caller hands over the whole list, never a
29
+ * pre-cut one.
30
+ */
31
+ total?: MatchTotal | undefined;
32
+ }
33
+ /** An ambiguity error's candidate list, its parts exposed for a consumer that words its own. */
34
+ export interface AmbiguousMatches {
35
+ /** The error-data fields: `shown` as `cik`/`name`/`ticker` rows, and the full count. */
36
+ data: {
37
+ matches: Array<{
38
+ cik: string;
39
+ name: string | undefined;
40
+ ticker: string | undefined;
41
+ }>;
42
+ total_matches: number;
43
+ total_matches_is_lower_bound?: true;
44
+ };
45
+ /** `shown` as `<cik> <name> (<ticker>), …`, the default list for the message. */
13
46
  list: string;
14
- matches: {
15
- cik: string;
16
- name: string | undefined;
17
- ticker: string | undefined;
18
- }[];
19
- };
47
+ /**
48
+ * `''` for a complete list; otherwise the sentence that ends the message, leading space
49
+ * included: ` Showing 10 of 66 matches; for one not listed, retry with a fuller name, its
50
+ * ticker, or its CIK.` (`of at least 10,000` for a floor; `retry with its ticker or CIK.`
51
+ * for a single-token input).
52
+ */
53
+ showing: string;
54
+ /** The first {@link MAX_SHOWN} candidates, in the order given. */
55
+ shown: readonly AmbiguousCandidate[];
56
+ }
57
+ /** Cut `candidates` to {@link MAX_SHOWN} and describe the cut. */
58
+ export declare function ambiguousMatches(candidates: readonly AmbiguousCandidate[], { total, singleToken }?: AmbiguousMatchesOptions): AmbiguousMatches;
20
59
  //# sourceMappingURL=ambiguous-matches.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ambiguous-matches.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/ambiguous-matches.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAK1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE;IAG1D,IAAI;IAGJ,OAAO;;;;;EAEV"}
1
+ {"version":3,"file":"ambiguous-matches.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/ambiguous-matches.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,mDAAmD;AACnD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,8FAA8F;AAC9F,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,mFAAmF;AACnF,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAChC;AAED,gGAAgG;AAChG,MAAM,WAAW,gBAAgB;IAC/B,wFAAwF;IACxF,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC,CAAC;QACtF,aAAa,EAAE,MAAM,CAAC;QACtB,4BAA4B,CAAC,EAAE,IAAI,CAAC;KACrC,CAAC;IACF,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACtC;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,SAAS,kBAAkB,EAAE,EACzC,EAAE,KAAoC,EAAE,WAAmB,EAAE,GAAE,uBAA4B,GAC1F,gBAAgB,CAoBlB"}
@@ -1,22 +1,31 @@
1
1
  /**
2
- * @fileoverview The candidates an ambiguous company resolution names, rendered for the error
3
- * message itself (clients that read only `content[]` otherwise get a "pick from the matches
4
- * list" instruction with no list to pick from, #90) and for the `matches` data field.
2
+ * @fileoverview The one cut every ambiguity error shows of the candidates a name resolves to,
3
+ * rendered for the error message itself (clients that read only `content[]` otherwise get a
4
+ * "pick from the matches list" instruction with no list to pick from, #90) and for the error
5
+ * data, with the full count and the sentence that says a list is partial (#229, #230).
5
6
  * @module mcp-server/tools/ambiguous-matches
6
7
  */
7
8
  /** Candidates named per ambiguous resolution. */
8
9
  const MAX_SHOWN = 10;
9
- /**
10
- * The first {@link MAX_SHOWN} candidates of a multi-match `resolveCik` result: `list` reads
11
- * `<cik> <name> (<ticker>), …` for the message, `matches` carries the same rows as data.
12
- */
13
- export function ambiguousMatches(resolved) {
14
- const shown = resolved.slice(0, MAX_SHOWN);
10
+ /** Cut `candidates` to {@link MAX_SHOWN} and describe the cut. */
11
+ export function ambiguousMatches(candidates, { total = { count: candidates.length }, singleToken = false } = {}) {
12
+ const shown = candidates.slice(0, MAX_SHOWN);
13
+ const lowerBound = total.lowerBound === true;
14
+ const of = `${lowerBound ? 'at least ' : ''}${total.count.toLocaleString('en-US')}`;
15
+ const retry = singleToken ? 'its ticker or CIK' : 'a fuller name, its ticker, or its CIK';
15
16
  return {
17
+ shown,
16
18
  list: shown
17
19
  .map((m) => `${m.cik} ${m.name ?? 'Unknown'}${m.ticker ? ` (${m.ticker})` : ''}`)
18
20
  .join(', '),
19
- matches: shown.map((m) => ({ cik: m.cik, name: m.name, ticker: m.ticker })),
21
+ showing: shown.length < total.count || lowerBound
22
+ ? ` Showing ${shown.length} of ${of} matches; for one not listed, retry with ${retry}.`
23
+ : '',
24
+ data: {
25
+ matches: shown.map((m) => ({ cik: m.cik, name: m.name, ticker: m.ticker })),
26
+ total_matches: total.count,
27
+ ...(lowerBound ? { total_matches_is_lower_bound: true } : {}),
28
+ },
20
29
  };
21
30
  }
22
31
  //# sourceMappingURL=ambiguous-matches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ambiguous-matches.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/ambiguous-matches.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,iDAAiD;AACjD,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAA6B;IAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAC3C,OAAO;QACL,IAAI,EAAE,KAAK;aACR,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,IAAI,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aAChF,IAAI,CAAC,IAAI,CAAC;QACb,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC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CAAC,KAAK,IAAI,UAAU;YACtC,CAAC,CAAC,YAAY,KAAK,CAAC,MAAM,OAAO,EAAE,4CAA4C,KAAK,GAAG;YACvF,CAAC,CAAC,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YAC3E,aAAa,EAAE,KAAK,CAAC,KAAK;YAC1B,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,4BAA4B,EAAE,IAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvE;KACF,CAAC;AACJ,CAAC"}
@@ -46,10 +46,10 @@ export declare const companySearchTool: import("@cyanheads/mcp-ts-core").ToolDef
46
46
  readonly when: "No company matches the query";
47
47
  readonly recovery: "SEC's ticker index reflects the filer's own submissions record, which can differ from the exchange-listed symbol. ETFs and mutual funds resolve only by ticker (e.g. \"VOO\"); operating companies also resolve by full legal name or 10-digit CIK.";
48
48
  }, {
49
- readonly reason: "multiple_matches";
50
- readonly code: JsonRpcErrorCode.NotFound;
51
- readonly when: "Query is ambiguous and matches several companies";
52
- readonly recovery: "Specify a ticker symbol for an exact match instead of a name fragment.";
49
+ readonly reason: "ambiguous_company";
50
+ readonly code: JsonRpcErrorCode.ValidationError;
51
+ readonly when: "The company input resolves to multiple entities and the target is ambiguous";
52
+ readonly recovery: "Use a ticker symbol or 10-digit CIK from the matches list for an exact match.";
53
53
  }, {
54
54
  readonly reason: "rate_limited";
55
55
  readonly code: JsonRpcErrorCode.RateLimited;
@@ -111,10 +111,10 @@ export declare function createCompanySearchTool(options: LimitClampOptions): imp
111
111
  readonly when: "No company matches the query";
112
112
  readonly recovery: "SEC's ticker index reflects the filer's own submissions record, which can differ from the exchange-listed symbol. ETFs and mutual funds resolve only by ticker (e.g. \"VOO\"); operating companies also resolve by full legal name or 10-digit CIK.";
113
113
  }, {
114
- readonly reason: "multiple_matches";
115
- readonly code: JsonRpcErrorCode.NotFound;
116
- readonly when: "Query is ambiguous and matches several companies";
117
- readonly recovery: "Specify a ticker symbol for an exact match instead of a name fragment.";
114
+ readonly reason: "ambiguous_company";
115
+ readonly code: JsonRpcErrorCode.ValidationError;
116
+ readonly when: "The company input resolves to multiple entities and the target is ambiguous";
117
+ readonly recovery: "Use a ticker symbol or 10-digit CIK from the matches list for an exact match.";
118
118
  }, {
119
119
  readonly reason: "rate_limited";
120
120
  readonly code: JsonRpcErrorCode.RateLimited;
@@ -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;AAI3E,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAC;AAuF3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAie5B,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;AAK3E,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAC;AAuF3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAge5B,CAAC;AAEH,+FAA+F;AAC/F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEjE"}
@@ -6,6 +6,7 @@
6
6
  import { tool, z } from '@cyanheads/mcp-ts-core';
7
7
  import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
8
8
  import { markdown } from '@cyanheads/mcp-ts-core/utils';
9
+ import { ambiguousMatches } from '../ambiguous-matches.js';
9
10
  import { escapeInline } from '../escape-inline.js';
10
11
  import { normalizeFormFilter } from '../form-filter.js';
11
12
  import { limitClamp, withLimitClamps, } from '../limit-clamp.js';
@@ -95,10 +96,10 @@ export const companySearchTool = tool('secedgar_company_search', {
95
96
  recovery: 'SEC\'s ticker index reflects the filer\'s own submissions record, which can differ from the exchange-listed symbol. ETFs and mutual funds resolve only by ticker (e.g. "VOO"); operating companies also resolve by full legal name or 10-digit CIK.',
96
97
  },
97
98
  {
98
- reason: 'multiple_matches',
99
- code: JsonRpcErrorCode.NotFound,
100
- when: 'Query is ambiguous and matches several companies',
101
- recovery: 'Specify a ticker symbol for an exact match instead of a name fragment.',
99
+ reason: 'ambiguous_company',
100
+ code: JsonRpcErrorCode.ValidationError,
101
+ when: 'The company input resolves to multiple entities and the target is ambiguous',
102
+ recovery: 'Use a ticker symbol or 10-digit CIK from the matches list for an exact match.',
102
103
  },
103
104
  {
104
105
  reason: 'rate_limited',
@@ -258,13 +259,8 @@ export const companySearchTool = tool('secedgar_company_search', {
258
259
  : ctx.recoveryFor('no_match'));
259
260
  }
260
261
  if (resolved.length > 1) {
261
- const matches = resolved
262
- .map((m) => `${m.ticker ?? m.cik} (${m.name ?? 'Unknown'})`)
263
- .join(', ');
264
- throw ctx.fail('multiple_matches', `Multiple matches for '${input.query}': ${matches}.`, {
265
- query: input.query,
266
- matches: resolved.map((m) => ({ cik: m.cik, name: m.name, ticker: m.ticker })),
267
- });
262
+ const { list, showing, data } = ambiguousMatches(resolved);
263
+ throw ctx.fail('ambiguous_company', `'${input.query}' matches multiple companies: ${list}. Retry with one of these tickers or 10-digit CIKs.${showing}`, { query: input.query, ...data });
268
264
  }
269
265
  }
270
266
  const match = Array.isArray(resolved) ? resolved[0] : resolved;
@@ -1 +1 @@
1
- {"version":3,"file":"company-search.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/company-search.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAEL,UAAU,EACV,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAYjF,4FAA4F;AAC5F,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,SAAS,mBAAmB,CAAC,IAK5B;IACC,MAAM,IAAI,GAAG;QACX,KAAK,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE;QACxB,GAAG,CAAC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E,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC;AAEH,+FAA+F;AAC/F,MAAM,UAAU,uBAAuB,CAAC,OAA0B;IAChE,OAAO,eAAe,CAAC,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"company-search.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/company-search.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAEL,UAAU,EACV,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAYjF,4FAA4F;AAC5F,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,SAAS,mBAAmB,CAAC,IAK5B;IACC,MAAM,IAAI,GAAG;QACX,KAAK,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE;QACxB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,E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ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAC;AAgP3C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4xB/B,CAAC;AAEH,kGAAkG;AAClG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMpE"}
1
+ {"version":3,"file":"compare-companies.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-companies.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAC;AAgP3C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6xB/B,CAAC;AAEH,kGAAkG;AAClG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMpE"}