@cyanheads/secedgar-mcp-server 0.19.1 → 0.20.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.
- package/AGENTS.md +26 -26
- package/CLAUDE.md +26 -26
- package/README.md +26 -14
- package/changelog/0.20.x/0.20.0.md +42 -0
- package/changelog/0.20.x/0.20.1.md +39 -0
- package/changelog/template.md +10 -8
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/company-search.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/company-search.tool.js +18 -4
- package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/compare-companies.tool.js +35 -21
- package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/dataframe-query.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/dataframe-query.tool.js +66 -29
- package/dist/mcp-server/tools/definitions/dataframe-query.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.js +5 -3
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-holders.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +14 -2
- package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-filing.tool.js +220 -86
- package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-financials.tool.js +83 -19
- package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts +18 -2
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +299 -104
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +66 -14
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-material-events.tool.js +15 -3
- package/dist/mcp-server/tools/definitions/get-material-events.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +24 -22
- package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +20 -3
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-concepts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-concepts.tool.js +16 -11
- package/dist/mcp-server/tools/definitions/search-concepts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-filings.tool.js +88 -40
- package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
- package/dist/services/canvas-bridge/canvas-bridge.d.ts +18 -21
- package/dist/services/canvas-bridge/canvas-bridge.d.ts.map +1 -1
- package/dist/services/canvas-bridge/canvas-bridge.js +62 -44
- package/dist/services/canvas-bridge/canvas-bridge.js.map +1 -1
- package/dist/services/edgar/call-scope.d.ts +13 -1
- package/dist/services/edgar/call-scope.d.ts.map +1 -1
- package/dist/services/edgar/call-scope.js +4 -1
- package/dist/services/edgar/call-scope.js.map +1 -1
- package/dist/services/edgar/concept-map.d.ts.map +1 -1
- package/dist/services/edgar/concept-map.js +18 -2
- package/dist/services/edgar/concept-map.js.map +1 -1
- package/dist/services/edgar/concept-series.d.ts +32 -1
- package/dist/services/edgar/concept-series.d.ts.map +1 -1
- package/dist/services/edgar/concept-series.js +72 -1
- package/dist/services/edgar/concept-series.js.map +1 -1
- package/dist/services/edgar/edgar-api-service.d.ts +2 -12
- package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
- package/dist/services/edgar/edgar-api-service.js +20 -57
- package/dist/services/edgar/edgar-api-service.js.map +1 -1
- package/dist/services/edgar/filing-to-text.d.ts +20 -8
- package/dist/services/edgar/filing-to-text.d.ts.map +1 -1
- package/dist/services/edgar/filing-to-text.js +583 -51
- package/dist/services/edgar/filing-to-text.js.map +1 -1
- package/dist/services/edgar/fiscal-periods.d.ts +2 -0
- package/dist/services/edgar/fiscal-periods.d.ts.map +1 -1
- package/dist/services/edgar/fiscal-periods.js +1 -1
- package/dist/services/edgar/fiscal-periods.js.map +1 -1
- package/dist/services/edgar/mirror/edgar-mirror.d.ts +11 -1
- package/dist/services/edgar/mirror/edgar-mirror.d.ts.map +1 -1
- package/dist/services/edgar/mirror/edgar-mirror.js +28 -10
- package/dist/services/edgar/mirror/edgar-mirror.js.map +1 -1
- package/dist/services/edgar/mirror/tickers-sync.d.ts +20 -10
- package/dist/services/edgar/mirror/tickers-sync.d.ts.map +1 -1
- package/dist/services/edgar/mirror/tickers-sync.js +108 -48
- package/dist/services/edgar/mirror/tickers-sync.js.map +1 -1
- package/dist/services/edgar/mirror/types.d.ts +12 -1
- package/dist/services/edgar/mirror/types.d.ts.map +1 -1
- package/dist/services/edgar/mirror/types.js +31 -1
- package/dist/services/edgar/mirror/types.js.map +1 -1
- package/dist/services/edgar/submissions-archive.d.ts +15 -3
- package/dist/services/edgar/submissions-archive.d.ts.map +1 -1
- package/dist/services/edgar/submissions-archive.js +22 -4
- package/dist/services/edgar/submissions-archive.js.map +1 -1
- package/dist/services/edgar/types.d.ts +9 -6
- package/dist/services/edgar/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/server.json +3 -3
- package/skills/secedgar-guide/SKILL.md +17 -3
- package/dist/services/canvas-bridge/sql-gate-extras.d.ts +0 -14
- package/dist/services/canvas-bridge/sql-gate-extras.d.ts.map +0 -1
- package/dist/services/canvas-bridge/sql-gate-extras.js +0 -16
- package/dist/services/canvas-bridge/sql-gate-extras.js.map +0 -1
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Ingester for the ticker/CIK layer. Downloads SEC's
|
|
3
3
|
* `company_tickers.json` (operating companies) and `company_tickers_mf.json`
|
|
4
|
-
* (ETFs and mutual funds), merges them, and yields one page
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* (ETFs and mutual funds), merges them, and yields one page that makes the
|
|
5
|
+
* store list what the files list: their rows upserted, and every stored symbol
|
|
6
|
+
* the page does not write deleted in the same transaction (#247). A symbol that
|
|
7
|
+
* left the files then reads as it does live, as a former ticker from the
|
|
8
|
+
* committed asset or no match. Fund rows are deleted only when the fund file
|
|
9
|
+
* loaded; a company_tickers.json listing no ticker fails the sync, and so does
|
|
10
|
+
* a refresh that would delete more than a quarter of either kind's stored rows,
|
|
11
|
+
* leaving the store as it was; `init` applies such a drop.
|
|
7
12
|
* @module services/edgar/mirror/tickers-sync
|
|
8
13
|
*/
|
|
9
14
|
import { serviceUnavailable } from '@cyanheads/mcp-ts-core/errors';
|
|
10
|
-
import { lastModifiedToIso, MF_TICKERS_URL, TICKERS_URL } from './types.js';
|
|
15
|
+
import { lastModifiedToIso, MF_TICKERS_URL, parseTickerFile, TICKERS_URL, } from './types.js';
|
|
16
|
+
/**
|
|
17
|
+
* The most of either kind's stored rows one refresh may delete. A month's churn in
|
|
18
|
+
* SEC's ticker file stays far below it, so a file dropping more is likelier truncated
|
|
19
|
+
* or stale than current; `init` applies such a drop.
|
|
20
|
+
*/
|
|
21
|
+
const MAX_REFRESH_DELETION_SHARE = 0.25;
|
|
11
22
|
/**
|
|
12
23
|
* Build the ticker-layer ingester. The returned generator downloads both
|
|
13
24
|
* company_tickers.json (operating companies) and company_tickers_mf.json
|
|
14
|
-
* (ETFs and mutual funds), merges them into a single page, and yields it
|
|
15
|
-
*
|
|
25
|
+
* (ETFs and mutual funds), merges them into a single page, and yields it with
|
|
26
|
+
* the stored symbols the page does not write as its tombstones. The files are
|
|
27
|
+
* small, so every sync re-downloads them whole.
|
|
16
28
|
*
|
|
17
29
|
* Mirror schema carries only {ticker, cik, name} — no series/class columns.
|
|
18
30
|
* Fund entries are ingested with an empty name (the name field is absent from
|
|
19
|
-
* company_tickers_mf.json), which is how the ticker index
|
|
20
|
-
* operating companies. They resolve by ticker to their
|
|
21
|
-
* and classId come only from the live fund file,
|
|
22
|
-
* when `EDGAR_MIRROR_FALLBACK_LIVE` merges it in.
|
|
31
|
+
* company_tickers_mf.json), which is how the ticker index and the deletion
|
|
32
|
+
* bound tell them from operating companies. They resolve by ticker to their
|
|
33
|
+
* registrant CIK; seriesId and classId come only from the live fund file,
|
|
34
|
+
* which supersedes these rows when `EDGAR_MIRROR_FALLBACK_LIVE` merges it in.
|
|
23
35
|
*/
|
|
24
36
|
export function makeTickersSync(opts) {
|
|
25
37
|
return async function* tickersSync(ctx) {
|
|
@@ -29,52 +41,100 @@ export function makeTickersSync(opts) {
|
|
|
29
41
|
if (!response.ok) {
|
|
30
42
|
throw serviceUnavailable(`SEC company_tickers.json download failed (HTTP ${response.status})`, { url: TICKERS_URL, status: response.status });
|
|
31
43
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!entry?.ticker)
|
|
36
|
-
continue;
|
|
37
|
-
records.push({
|
|
38
|
-
ticker: entry.ticker.toUpperCase(),
|
|
39
|
-
cik: String(entry.cik_str).padStart(10, '0'),
|
|
40
|
-
name: entry.title ?? '',
|
|
41
|
-
});
|
|
44
|
+
const equity = parseTickerFile(await response.json());
|
|
45
|
+
if (!equity) {
|
|
46
|
+
throw serviceUnavailable('SEC company_tickers.json listed no ticker, so the ticker sync wrote nothing and the stored rows stand. Sync again once SEC serves the whole file.', { url: TICKERS_URL });
|
|
42
47
|
}
|
|
48
|
+
const records = equity.map((row) => ({
|
|
49
|
+
ticker: row.ticker.toUpperCase(),
|
|
50
|
+
cik: row.cik,
|
|
51
|
+
name: row.name,
|
|
52
|
+
}));
|
|
43
53
|
// Operating-company tickers take precedence on a cross-file symbol collision (e.g. SPCX),
|
|
44
54
|
// so a fund symbol is skipped when it duplicates an equity ticker already ingested above.
|
|
45
55
|
const equityTickers = new Set(records.map((r) => r.ticker));
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (Array.isArray(mfRaw?.fields) && Array.isArray(mfRaw?.data)) {
|
|
52
|
-
const symbolIdx = mfRaw.fields.indexOf('symbol');
|
|
53
|
-
const cikIdx = mfRaw.fields.indexOf('cik');
|
|
54
|
-
if (symbolIdx >= 0 && cikIdx >= 0) {
|
|
55
|
-
for (const row of mfRaw.data) {
|
|
56
|
-
const symbol = row[symbolIdx];
|
|
57
|
-
if (!symbol)
|
|
58
|
-
continue;
|
|
59
|
-
const ticker = String(symbol).toUpperCase();
|
|
60
|
-
if (equityTickers.has(ticker))
|
|
61
|
-
continue;
|
|
62
|
-
records.push({
|
|
63
|
-
ticker,
|
|
64
|
-
cik: String(row[cikIdx]).padStart(10, '0'),
|
|
65
|
-
name: '',
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
56
|
+
const funds = await fetchFundRows(headers, ctx.signal);
|
|
57
|
+
if (funds) {
|
|
58
|
+
for (const row of funds)
|
|
59
|
+
if (!equityTickers.has(row.ticker))
|
|
60
|
+
records.push(row);
|
|
71
61
|
}
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
else {
|
|
63
|
+
opts.log?.warning?.('company_tickers_mf.json did not load, so this ticker sync keeps every stored fund symbol as it was.', { url: MF_TICKERS_URL });
|
|
74
64
|
}
|
|
65
|
+
const tombstones = droppedSymbols(await opts.storedRows(), new Set(records.map((r) => r.ticker)), ctx.mode, funds !== undefined);
|
|
75
66
|
// Checkpoint must be lexicographically monotonic — store ISO 8601, not the raw HTTP-date.
|
|
76
67
|
const checkpoint = lastModifiedToIso(response.headers.get('last-modified'));
|
|
77
|
-
yield { records, checkpoint };
|
|
68
|
+
yield { records, tombstones, checkpoint };
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* company_tickers_mf.json as fund rows (an empty name, the schema's fund marker), or
|
|
73
|
+
* `undefined` when it fails to load or lacks the `cik` and `symbol` columns. Its failure
|
|
74
|
+
* never fails the sync — operating-company rows sync without it — but the caller's
|
|
75
|
+
* cancel rethrows.
|
|
76
|
+
*/
|
|
77
|
+
async function fetchFundRows(headers, signal) {
|
|
78
|
+
try {
|
|
79
|
+
const response = await fetch(MF_TICKERS_URL, { headers, signal });
|
|
80
|
+
if (!response.ok)
|
|
81
|
+
return;
|
|
82
|
+
const raw = (await response.json());
|
|
83
|
+
if (!Array.isArray(raw?.fields) || !Array.isArray(raw?.data))
|
|
84
|
+
return;
|
|
85
|
+
const symbolIdx = raw.fields.indexOf('symbol');
|
|
86
|
+
const cikIdx = raw.fields.indexOf('cik');
|
|
87
|
+
if (symbolIdx < 0 || cikIdx < 0)
|
|
88
|
+
return;
|
|
89
|
+
const rows = [];
|
|
90
|
+
for (const row of raw.data) {
|
|
91
|
+
const symbol = row[symbolIdx];
|
|
92
|
+
if (!symbol)
|
|
93
|
+
continue;
|
|
94
|
+
rows.push({
|
|
95
|
+
ticker: String(symbol).toUpperCase(),
|
|
96
|
+
cik: String(row[cikIdx]).padStart(10, '0'),
|
|
97
|
+
name: '',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return rows;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
signal.throwIfAborted();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The stored symbols the page does not write, which it deletes. A symbol that moved
|
|
109
|
+
* from one file to the other is written, so never deleted, and a fund row is deleted
|
|
110
|
+
* only when the fund file loaded. A refresh that would delete more than
|
|
111
|
+
* {@link MAX_REFRESH_DELETION_SHARE} of either kind's stored rows throws instead,
|
|
112
|
+
* before the page is yielded, so it writes nothing; an `init` deletes them.
|
|
113
|
+
*/
|
|
114
|
+
function droppedSymbols(stored, written, mode, fundsLoaded) {
|
|
115
|
+
const kinds = {
|
|
116
|
+
equity: { file: 'company_tickers.json', url: TICKERS_URL, stored: 0, dropped: [] },
|
|
117
|
+
fund: {
|
|
118
|
+
file: 'company_tickers_mf.json',
|
|
119
|
+
url: MF_TICKERS_URL,
|
|
120
|
+
stored: 0,
|
|
121
|
+
dropped: [],
|
|
122
|
+
},
|
|
78
123
|
};
|
|
124
|
+
for (const row of stored) {
|
|
125
|
+
const kind = row.name ? kinds.equity : kinds.fund;
|
|
126
|
+
kind.stored += 1;
|
|
127
|
+
if (written.has(row.ticker) || (kind === kinds.fund && !fundsLoaded))
|
|
128
|
+
continue;
|
|
129
|
+
kind.dropped.push(row.ticker);
|
|
130
|
+
}
|
|
131
|
+
if (mode === 'refresh') {
|
|
132
|
+
for (const { dropped, file, stored: count, url } of Object.values(kinds)) {
|
|
133
|
+
if (dropped.length <= count * MAX_REFRESH_DELETION_SHARE)
|
|
134
|
+
continue;
|
|
135
|
+
throw serviceUnavailable(`The ticker refresh would delete ${dropped.length} of the ${count} stored ${file} symbols, more than a quarter, so it wrote nothing and the stored rows stand. A drop that large is likelier a truncated or stale file than SEC's current one; if SEC's file did drop them, \`bun run mirror:init\` applies the drop, re-ingesting companyfacts.zip as well.`, { url });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return [...kinds.equity.dropped, ...kinds.fund.dropped];
|
|
79
139
|
}
|
|
80
140
|
//# sourceMappingURL=tickers-sync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tickers-sync.js","sourceRoot":"","sources":["../../../../src/services/edgar/mirror/tickers-sync.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tickers-sync.js","sourceRoot":"","sources":["../../../../src/services/edgar/mirror/tickers-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AASnE,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,WAAW,GAEZ,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAQxC;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,IAK/B;IACC,OAAO,KAAK,SAAS,CAAC,CAAC,WAAW,CAAC,GAAgB;QACjD,MAAM,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;QAE7E,kCAAkC;QAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3E,IAAI,CAAC,QA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KAAK,SAAS,EAAE,CAAC;QACvB,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACzE,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,GAAG,0BAA0B;gBAAE,SAAS;YACnE,MAAM,kBAAkB,CACtB,mCAAmC,OAAO,CAAC,MAAM,WAAW,KAAK,WAAW,IAAI,6QAA6Q,EAC7V,EAAE,GAAG,EAAE,CACR,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Constants and row shapes for the EDGAR local mirror — the two
|
|
3
3
|
* bounded SEC reference layers (ticker/CIK resolution and XBRL company-facts)
|
|
4
|
-
* mirrored into embedded SQLite via the framework `MirrorService
|
|
4
|
+
* mirrored into embedded SQLite via the framework `MirrorService` — and the
|
|
5
|
+
* company_tickers.json parser the live ticker index and the mirror's ticker
|
|
6
|
+
* sync share.
|
|
5
7
|
* @module services/edgar/mirror/types
|
|
6
8
|
*/
|
|
7
9
|
/** SEC ticker→CIK directory (direct-download JSON, about 800 KB: 796,507 bytes on 2026-11-08). */
|
|
@@ -35,6 +37,15 @@ export interface TickerRow {
|
|
|
35
37
|
/** Uppercased ticker symbol — primary key (e.g. "AAPL", "BRK-A"). */
|
|
36
38
|
ticker: string;
|
|
37
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse company_tickers.json — `{ cik_str, ticker, title }` entries keyed by index — into
|
|
42
|
+
* rows with a zero-padded CIK, skipping any entry without that shape. The ticker stays as
|
|
43
|
+
* written: the live index keys it uppercased and the mirror stores it so. `undefined` when
|
|
44
|
+
* no entry has the shape: the live index fails such a 200 like any unreadable answer
|
|
45
|
+
* (#234), and the mirror's ticker sync refuses it rather than read it as every symbol
|
|
46
|
+
* dropped (#247).
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseTickerFile(raw: unknown): TickerRow[] | undefined;
|
|
38
49
|
/**
|
|
39
50
|
* One row of the `company_concepts` table — a single (cik, taxonomy, tag) concept
|
|
40
51
|
* from a company's `companyfacts` entry. The full `units` map is stored verbatim
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/edgar/mirror/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/edgar/mirror/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,kGAAkG;AAClG,eAAO,MAAM,WAAW,mDAAmD,CAAC;AAE5E,8CAA8C;AAC9C,eAAO,MAAM,cAAc,sDAAsD,CAAC;AAElF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,yEACsC,CAAC;AAEzE,8CAA8C;AAC9C,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,qFAAqF;AACrF,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD,0EAA0E;AAC1E,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAM7E;AAED,4GAA4G;AAC5G,MAAM,WAAW,SAAS;IACxB,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,SAAS,CAcrE;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Constants and row shapes for the EDGAR local mirror — the two
|
|
3
3
|
* bounded SEC reference layers (ticker/CIK resolution and XBRL company-facts)
|
|
4
|
-
* mirrored into embedded SQLite via the framework `MirrorService
|
|
4
|
+
* mirrored into embedded SQLite via the framework `MirrorService` — and the
|
|
5
|
+
* company_tickers.json parser the live ticker index and the mirror's ticker
|
|
6
|
+
* sync share.
|
|
5
7
|
* @module services/edgar/mirror/types
|
|
6
8
|
*/
|
|
9
|
+
import { isRecord } from '@cyanheads/mcp-ts-core/utils';
|
|
7
10
|
/** SEC ticker→CIK directory (direct-download JSON, about 800 KB: 796,507 bytes on 2026-11-08). */
|
|
8
11
|
export const TICKERS_URL = 'https://www.sec.gov/files/company_tickers.json';
|
|
9
12
|
/** SEC mutual-fund / ETF ticker directory. */
|
|
@@ -29,4 +32,31 @@ export function lastModifiedToIso(httpDate) {
|
|
|
29
32
|
}
|
|
30
33
|
return new Date().toISOString();
|
|
31
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Parse company_tickers.json — `{ cik_str, ticker, title }` entries keyed by index — into
|
|
37
|
+
* rows with a zero-padded CIK, skipping any entry without that shape. The ticker stays as
|
|
38
|
+
* written: the live index keys it uppercased and the mirror stores it so. `undefined` when
|
|
39
|
+
* no entry has the shape: the live index fails such a 200 like any unreadable answer
|
|
40
|
+
* (#234), and the mirror's ticker sync refuses it rather than read it as every symbol
|
|
41
|
+
* dropped (#247).
|
|
42
|
+
*/
|
|
43
|
+
export function parseTickerFile(raw) {
|
|
44
|
+
if (!isRecord(raw))
|
|
45
|
+
return;
|
|
46
|
+
const rows = [];
|
|
47
|
+
for (const entry of Object.values(raw)) {
|
|
48
|
+
if (!isRecord(entry) || typeof entry.title !== 'string')
|
|
49
|
+
continue;
|
|
50
|
+
if (typeof entry.ticker !== 'string' || !entry.ticker)
|
|
51
|
+
continue;
|
|
52
|
+
if (typeof entry.cik_str !== 'number' && typeof entry.cik_str !== 'string')
|
|
53
|
+
continue;
|
|
54
|
+
rows.push({
|
|
55
|
+
cik: String(entry.cik_str).padStart(10, '0'),
|
|
56
|
+
name: entry.title,
|
|
57
|
+
ticker: entry.ticker,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return rows.length > 0 ? rows : undefined;
|
|
61
|
+
}
|
|
32
62
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/edgar/mirror/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/edgar/mirror/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,kGAAkG;AAClG,MAAM,CAAC,MAAM,WAAW,GAAG,gDAAgD,CAAC;AAE5E,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,mDAAmD,CAAC;AAElF,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAChC,sEAAsE,CAAC;AAEzE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;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,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* window, which SEC sizes at one year or 1,000 filings, whichever holds more. Every
|
|
5
5
|
* tool that reaches past `recent` walks through here, so they share one page cap, one
|
|
6
6
|
* rule for when `recent` already covers the range, and one way of reporting how far
|
|
7
|
-
* the scan reached
|
|
7
|
+
* the scan reached, whether pages it selected went unread, and whether the filer has
|
|
8
|
+
* older pages it never read.
|
|
8
9
|
* @module services/edgar/submissions-archive
|
|
9
10
|
*/
|
|
10
11
|
import type { CallScope } from './call-scope.js';
|
|
@@ -60,12 +61,15 @@ export declare function selectArchivePages(files: readonly ArchivePageEntry[], o
|
|
|
60
61
|
* filing dated on or after that day.
|
|
61
62
|
*
|
|
62
63
|
* Iterate it with `for await`; breaking out after any page ends the walk there.
|
|
63
|
-
* Afterwards `scannedThrough` and `
|
|
64
|
-
* is read under the calling tool's `scope`, so a cancel ends the
|
|
64
|
+
* Afterwards `scannedThrough`, `truncated`, and `olderPagesUnread` describe what was
|
|
65
|
+
* read. Every page is read under the calling tool's `scope`, so a cancel ends the
|
|
66
|
+
* walk (#179).
|
|
65
67
|
*/
|
|
66
68
|
export declare class SubmissionsArchiveWalk implements AsyncIterable<ArchivePageRead> {
|
|
67
69
|
private readonly source;
|
|
68
70
|
private readonly scope;
|
|
71
|
+
/** The whole manifest, selected or not — `olderPagesUnread` reads past the selection. */
|
|
72
|
+
private readonly files;
|
|
69
73
|
private readonly pages;
|
|
70
74
|
private read;
|
|
71
75
|
private oldestRead;
|
|
@@ -76,6 +80,14 @@ export declare class SubmissionsArchiveWalk implements AsyncIterable<ArchivePage
|
|
|
76
80
|
get scannedThrough(): string | undefined;
|
|
77
81
|
/** True while selected pages remain unread — the cap ended the walk, or the caller stopped it early. */
|
|
78
82
|
get truncated(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* True when the manifest lists a page that starts before every page read (an earlier
|
|
85
|
+
* `filingFrom` than `scannedThrough`), or any page at all before the first read, since
|
|
86
|
+
* every archive page predates `recent`. Unlike `truncated` it counts pages the date
|
|
87
|
+
* bounds never selected, and ignores unread pages newer than the scan reached; false
|
|
88
|
+
* means the scan reached the filer's oldest filing (#248).
|
|
89
|
+
*/
|
|
90
|
+
get olderPagesUnread(): boolean;
|
|
79
91
|
[Symbol.asyncIterator](): AsyncGenerator<ArchivePageRead>;
|
|
80
92
|
}
|
|
81
93
|
//# sourceMappingURL=submissions-archive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissions-archive.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/submissions-archive.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"submissions-archive.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/submissions-archive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1E;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;;;OAKG;IACH,KAAK,EAAE,cAAc,GAAG,cAAc,CAAC;CACxC;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,gBAAgB,CAAC;CACxB;AASD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAClC,OAAO,EAAE,kBAAkB,GAC1B,gBAAgB,EAAE,CAUpB;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,sBAAuB,YAAW,aAAa,CAAC,eAAe,CAAC;IAQzE,OAAO,CAAC,QAAQ,CAAC,MAAM;IAGvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAVxB,yFAAyF;IACzF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IACpD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,UAAU,CAAqB;IAEvC,YACmB,MAAM,EAAE,iBAAiB,EAC1C,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,kBAAkB,EACV,KAAK,EAAE,SAAS,EAQlC;IAED,yBAAyB;IACzB,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,+GAA+G;IAC/G,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED,wGAAwG;IACxG,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;;;OAMG;IACH,IAAI,gBAAgB,IAAI,OAAO,CAK9B;IAEM,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,eAAe,CAAC,CAS/D;CACF"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* window, which SEC sizes at one year or 1,000 filings, whichever holds more. Every
|
|
5
5
|
* tool that reaches past `recent` walks through here, so they share one page cap, one
|
|
6
6
|
* rule for when `recent` already covers the range, and one way of reporting how far
|
|
7
|
-
* the scan reached
|
|
7
|
+
* the scan reached, whether pages it selected went unread, and whether the filer has
|
|
8
|
+
* older pages it never read.
|
|
8
9
|
* @module services/edgar/submissions-archive
|
|
9
10
|
*/
|
|
10
11
|
/**
|
|
@@ -47,21 +48,25 @@ export function selectArchivePages(files, options) {
|
|
|
47
48
|
* filing dated on or after that day.
|
|
48
49
|
*
|
|
49
50
|
* Iterate it with `for await`; breaking out after any page ends the walk there.
|
|
50
|
-
* Afterwards `scannedThrough` and `
|
|
51
|
-
* is read under the calling tool's `scope`, so a cancel ends the
|
|
51
|
+
* Afterwards `scannedThrough`, `truncated`, and `olderPagesUnread` describe what was
|
|
52
|
+
* read. Every page is read under the calling tool's `scope`, so a cancel ends the
|
|
53
|
+
* walk (#179).
|
|
52
54
|
*/
|
|
53
55
|
export class SubmissionsArchiveWalk {
|
|
54
56
|
source;
|
|
55
57
|
scope;
|
|
58
|
+
/** The whole manifest, selected or not — `olderPagesUnread` reads past the selection. */
|
|
59
|
+
files;
|
|
56
60
|
pages;
|
|
57
61
|
read = 0;
|
|
58
62
|
oldestRead;
|
|
59
63
|
constructor(source, submissions, options, scope) {
|
|
60
64
|
this.source = source;
|
|
61
65
|
this.scope = scope;
|
|
66
|
+
this.files = submissions.filings.files;
|
|
62
67
|
const recentOldest = submissions.filings.recent.filingDate.at(-1);
|
|
63
68
|
const coveredByRecent = Boolean(options.filedAfter && recentOldest && options.filedAfter >= recentOldest);
|
|
64
|
-
this.pages = coveredByRecent ? [] : selectArchivePages(
|
|
69
|
+
this.pages = coveredByRecent ? [] : selectArchivePages(this.files, options);
|
|
65
70
|
}
|
|
66
71
|
/** Pages read so far. */
|
|
67
72
|
get pagesRead() {
|
|
@@ -75,6 +80,19 @@ export class SubmissionsArchiveWalk {
|
|
|
75
80
|
get truncated() {
|
|
76
81
|
return this.read < this.pages.length;
|
|
77
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* True when the manifest lists a page that starts before every page read (an earlier
|
|
85
|
+
* `filingFrom` than `scannedThrough`), or any page at all before the first read, since
|
|
86
|
+
* every archive page predates `recent`. Unlike `truncated` it counts pages the date
|
|
87
|
+
* bounds never selected, and ignores unread pages newer than the scan reached; false
|
|
88
|
+
* means the scan reached the filer's oldest filing (#248).
|
|
89
|
+
*/
|
|
90
|
+
get olderPagesUnread() {
|
|
91
|
+
const through = this.oldestRead;
|
|
92
|
+
return through === undefined
|
|
93
|
+
? this.files.length > 0
|
|
94
|
+
: this.files.some((page) => page.filingFrom < through);
|
|
95
|
+
}
|
|
78
96
|
async *[Symbol.asyncIterator]() {
|
|
79
97
|
const limit = Math.min(this.pages.length, ARCHIVE_PAGE_SCAN_CAP);
|
|
80
98
|
while (this.read < limit) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissions-archive.js","sourceRoot":"","sources":["../../../src/services/edgar/submissions-archive.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"submissions-archive.js","sourceRoot":"","sources":["../../../src/services/edgar/submissions-archive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AA+BxC,iDAAiD;AACjD,SAAS,SAAS,CAAC,IAAY,EAAE,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC;IAC5C,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAkC,EAClC,OAA2B;IAE3B,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU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C,IAAI,EAAE,CAAC;YACZ,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;gBAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;YAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -312,12 +312,15 @@ export interface ConceptMapping {
|
|
|
312
312
|
ifrsTags?: string[];
|
|
313
313
|
label: string;
|
|
314
314
|
/**
|
|
315
|
-
* Alternate-semantics
|
|
316
|
-
* line for this metric
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
315
|
+
* Alternate-semantics us-gaap tags a meaningful share of filers use as their
|
|
316
|
+
* primary line for this metric. NOT pure synonyms of `tags` (those differ
|
|
317
|
+
* historically but mean the same thing) — these carry a different definition
|
|
318
|
+
* (e.g. cash incl. restricted cash, equity incl. noncontrolling interest), so they
|
|
319
|
+
* are deliberately kept OUT of `tags` to avoid conflating them into
|
|
320
|
+
* `secedgar_get_financials`' first-non-null fallback chain. Never read in the
|
|
321
|
+
* concept's place: `secedgar_fetch_frames` and `secedgar_search_concepts` list
|
|
322
|
+
* them, and `get_financials`, `get_snapshot`, and `compare_companies` name one in
|
|
323
|
+
* a caveat when the filer reports it past where the concept's own tags stop (#258).
|
|
321
324
|
*/
|
|
322
325
|
relatedTags?: RelatedTag[];
|
|
323
326
|
tags: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,4HAA4H;IAC5H,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAA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AAE,UAAU,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/secedgar-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "Query SEC EDGAR filings, XBRL financials, and company data via MCP. STDIO or Streamable HTTP.",
|
|
5
5
|
"mcpName": "io.github.cyanheads/secedgar-mcp-server",
|
|
6
6
|
"type": "module",
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
"access": "public"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@cyanheads/mcp-ts-core": "^0.13.
|
|
102
|
-
"@duckdb/node-api": "^2.0.
|
|
103
|
-
"better-sqlite3": "^13.
|
|
101
|
+
"@cyanheads/mcp-ts-core": "^0.13.26",
|
|
102
|
+
"@duckdb/node-api": "^2.0.1-r.1",
|
|
103
|
+
"better-sqlite3": "^13.2.0",
|
|
104
104
|
"domhandler": "^6.0.1",
|
|
105
105
|
"domutils": "^4.0.2",
|
|
106
106
|
"fflate": "^0.8.3",
|
|
@@ -111,16 +111,16 @@
|
|
|
111
111
|
"zod": "^4.6.7"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
|
-
"@biomejs/biome": "^2.6.
|
|
114
|
+
"@biomejs/biome": "^2.6.9",
|
|
115
115
|
"@socketsecurity/bun-security-scanner": "^1.1.3",
|
|
116
116
|
"@types/html-to-text": "^9.0.4",
|
|
117
|
-
"@types/node": "^26.6.
|
|
117
|
+
"@types/node": "^26.6.11",
|
|
118
118
|
"depcheck": "^1.4.7",
|
|
119
|
-
"ignore": "^7.0.
|
|
119
|
+
"ignore": "^7.0.17",
|
|
120
120
|
"markdown-it": "^15.0.3",
|
|
121
|
-
"tsc-alias": "^1.9.
|
|
121
|
+
"tsc-alias": "^1.9.12",
|
|
122
122
|
"typescript": "^7.0.2",
|
|
123
|
-
"vitest": "^5.1.
|
|
123
|
+
"vitest": "^5.1.2"
|
|
124
124
|
},
|
|
125
125
|
"trustedDependencies": ["@socketsecurity/bun-security-scanner", "better-sqlite3"]
|
|
126
126
|
}
|
package/server.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/cyanheads/secedgar-mcp-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.20.1",
|
|
10
10
|
"remotes": [
|
|
11
11
|
{
|
|
12
12
|
"type": "streamable-http",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
20
20
|
"identifier": "@cyanheads/secedgar-mcp-server",
|
|
21
21
|
"runtimeHint": "npx",
|
|
22
|
-
"version": "0.
|
|
22
|
+
"version": "0.20.1",
|
|
23
23
|
"environmentVariables": [
|
|
24
24
|
{
|
|
25
25
|
"name": "EDGAR_USER_AGENT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
52
52
|
"identifier": "@cyanheads/secedgar-mcp-server",
|
|
53
53
|
"runtimeHint": "npx",
|
|
54
|
-
"version": "0.
|
|
54
|
+
"version": "0.20.1",
|
|
55
55
|
"environmentVariables": [
|
|
56
56
|
{
|
|
57
57
|
"name": "EDGAR_USER_AGENT",
|
|
@@ -4,7 +4,7 @@ description: Route SEC EDGAR research across the secedgar_* tools — which owne
|
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.1"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## Scope
|
|
@@ -36,11 +36,12 @@ Not here: market prices, quotes, or returns (the only prices are the per-share p
|
|
|
36
36
|
- **A secedgar_fetch_frames `no_data` covers one tag.** A friendly name maps to several tags and one call reads the first; revenue's current tag has no annual frame before CY2014. Query each tag the error lists in `unqueried_tags` before calling a period empty.
|
|
37
37
|
- **Structured coverage has start dates.** Form 4 XML starts in mid-2003. SCHEDULE 13D/13G XML starts 2024-12-18; earlier stakes are legacy `SC 13D` / `SC 13G` text filings, so a forms filter spanning that date must list both spellings.
|
|
38
38
|
- **Ownership filings lag their period.** A 13F-HR is due 45 days after its quarter ends, so a quarter still inside that window holds only the managers that filed early. An NPORT-P publishes about two months after its period. Managers under $100M in 13(f) securities file no 13F, and a 13F-NT means another manager reported the holdings.
|
|
39
|
+
- **Without a quarter, secedgar_get_institutional_holdings reads only the recent submissions window**: the filer's last year or 1,000 filings, whichever holds more. Name the quarter for a manager whose latest 13F-HR is older.
|
|
39
40
|
- **Fiscal Q4 is not a quarterly fact.** A quarterly series skips the calendar quarter a filer's fiscal Q4 spans. Derive that quarter as the annual total minus the three reported quarters, as the caveat says, instead of reporting it missing.
|
|
40
41
|
|
|
41
42
|
### Before stating a number
|
|
42
43
|
|
|
43
|
-
- **Label each value by its period end, never by `fiscal_year`.** On secedgar_get_financials rows, `fiscal_year` and `fiscal_period` (`source_filing_fy` / `source_filing_fp` in the dataframe) belong to the filing that reported the value, and a restated comparative carries the later filing's year. Key time on `end` (`period_end` in the dataframe).
|
|
44
|
+
- **Label each value by its period end, never by `fiscal_year`.** On secedgar_get_financials rows, `fiscal_year` and `fiscal_period` (`source_filing_fy` / `source_filing_fp` in the dataframe) belong to the filing that reported the value, and a restated comparative carries the later filing's year. Key time on `end` (`period_end` in the dataframe). That dataframe also names `company` as `entity_name` and `start` as `period_start`.
|
|
44
45
|
- **A `CY` key is SEC's calendar frame, not a fiscal-year label.** One column of secedgar_compare_companies holds fiscal years that end on different dates. Name each company's fiscal year from the cell's `period_end`.
|
|
45
46
|
- **Derived metrics are not concepts.** Free cash flow is `operating_cash_flow` − `capex`, EBITDA is `operating_income` + `depreciation_amortization`, and working capital is `current_assets` − `current_liabilities`. `debt` is long-term debt only, and no concept gives total debt.
|
|
46
47
|
- **Search totals are lower bounds** unless `total_is_exact` is true. Full-text search stops at 10,000 hits, so count a large set by splitting the date range.
|
|
@@ -55,6 +56,7 @@ Not here: market prices, quotes, or returns (the only prices are the per-share p
|
|
|
55
56
|
| Question | Tool, and its input | Notes |
|
|
56
57
|
|:---------|:--------------------|:------|
|
|
57
58
|
| What did officers, directors, or 10% owners trade? | secedgar_get_insider_transactions, the issuer | Form 4 and 4-A. Forms 3 and 5 only through secedgar_search_filings plus secedgar_get_filing |
|
|
59
|
+
| What did one person or fund trade as an insider, across companies? | secedgar_get_insider_transactions with `role` `reporting_owner`, the filer's CIK | A person resolves only by CIK. Each row names its issuer; the default role reads a company's own insiders |
|
|
58
60
|
| Who holds 5% or more, and with what intent? | secedgar_get_beneficial_owners, the issuer | A 13D states a purpose; a 13G is passive and has none. Percent of class is per reporting person and never sums across a joint filing |
|
|
59
61
|
| Which institutional managers hold it? | secedgar_find_holders, the issuer and its CUSIP | Unranked; open a position with secedgar_get_institutional_holdings and the filer CIK for size |
|
|
60
62
|
| What does one manager hold? | secedgar_get_institutional_holdings, the manager | Never the issuer: an operating company files no 13F |
|
|
@@ -63,6 +65,18 @@ Not here: market prices, quotes, or returns (the only prices are the per-share p
|
|
|
63
65
|
|
|
64
66
|
**Getting a CUSIP.** secedgar_find_holders is precise only with a CUSIP, and a name search both over- and under-matches. Read one off any position that already holds the security: secedgar_get_institutional_holdings for a broad manager such as VANGUARD GROUP INC (CIK `0000102909`; when its latest quarter is a 13F-NT, an earlier quarter still lists the positions), then a query on its dataframe filtering `issuer_name`; or secedgar_get_fund_holdings for a broad index fund such as VOO when the company is in the S&P 500. A multi-class issuer has one CUSIP per class, so run secedgar_find_holders once per class.
|
|
65
67
|
|
|
68
|
+
### Matching and paging rules
|
|
69
|
+
|
|
70
|
+
**Company names and tickers.** secedgar_company_search, and a `ticker:` term in secedgar_search_filings, read a multi-class ticker in either form (`BRK-B`, `BRK.B`) and an uppercase ticker as market-data feeds write it: venue-coded (`UEC.N`), a preferred class run together (`CFGPH`), or a class root (`GLOP`). A former ticker resolves to the company that last held it (`AMRK` finds Gold.com). A ticker is the fastest lookup. A name matches current and former names, an exact match ahead of one the query only starts or appears in, and never from inside a word (`SY Bancorp` does not find Embassy Bancorp). Exact and starts-with matches ignore commas, periods, apostrophes, extra spaces, and the spaces between single initials (`U.S. Bancorp` finds US BANCORP; `JM Smucker` finds J M SMUCKER Co). The corporate suffix (Inc, Corp, Co, Ltd, PLC, LLC, LP, N.V., S.A., AG, SE) can be left off (`Rio Tinto` lists both the Ltd and the PLC) or spelled out (`Corporation` finds `Corp`), but Corp, Inc, Co, and Ltd stay distinct, since separate registrants can differ only by which one they use. When nothing else matches, the words may come in another order (`Charles Schwab` finds SCHWAB CHARLES CORP).
|
|
71
|
+
|
|
72
|
+
**Where secedgar_get_filing's `section` lands.** The first match wins, in this order: a heading equal to the value, or whose title after its Item or Part marker equals it; the first Item or Part heading containing it; a document line equal to it (a subheading the outline omits), unless the line labels a table row or heads a table's columns; the first other heading containing it; a table-row label equal to it; a document line starting with it, or a table row with a cell that opens on it and a figure (`Net income $57.0B`); a table's column-header row whose first cell equals it (`Proposal→Voting options→Vote requirement`). In a proxy statement (DEF 14A and its variants), whose ITEM headings are ballot proposals, the first heading of any kind containing the value comes before both document-line steps. Within each heading step a body heading beats a table-of-contents row, which lands only when nothing else at that step matches, and a row that links to its section lands on that section; an Item or Part table-of-contents row that only contains the value, and whose title opens on it, gives way to the document line equal to or starting with the value (a cross-reference index row to the section it indexes), under the notice `No detected heading outside the table of contents matches section '<value>', so this page starts at the first document line that does.`; table-of-contents rows and wrapped cross-references are never line landings. A leading 20-F sub-item label (`3D.`, `B.`) on a heading or line is ignored, so `risk factors` reaches `3D. RISK FACTORS`; the value itself is matched as given. A value ending in a number matches only that number, the number alone first: `item 9` reaches Item 9 — a table-of-contents row for it included — ahead of Items 9A–9C, `item 1` reaches Item 1 and then Item 1A, never Items 10–16, and `part i` never reaches Part II. The steps comparing a whole heading or line also ignore the punctuation between an Item or Part marker and its title (`Item 1A Risk Factors` reaches `Item 1A. – Risk Factors`), so a heading copied from the outline resolves with or without the filing's non-breaking spaces and curly quotes.
|
|
73
|
+
|
|
74
|
+
**secedgar_get_filing's `find`.** The page opens at the first occurrence at or after offset: at its line's start when that is at most 200 characters earlier, else at the first word starting within those 200. The match is a plain substring, so a phrase broken across a line still matches; there are no patterns or whole-word matches. The default 50,000-character page typically holds a 10-K's business overview, risk factors, and MD&A.
|
|
75
|
+
|
|
76
|
+
**Paging and sorting secedgar_search_filings.** Under sort=relevance on a 2001-onward search, EDGAR indexes each document of a filing separately and pages by document, so a page lists the filings among its `limit` documents, possibly fewer than `limit`, and a filing whose matching documents straddle a page edge recurs on the next page; stepping by `next_offset` never skips one. Everywhere else the offset indexes the filings this call assembled: one 100-document full-text window for date sorts and ticker:/cik: scope, the whole match set on a pre-2001 archive path, or both on a range crossing 2001-01-01. Date sorts reorder only that window, so for the newest filings of a broad search add ticker:/cik: scope or narrow the query; relevance weights term-match strength over recency. Query terms are ANDed unless joined by OR. The pre-2001 local scan honors the same phrase, OR, exclusion, and wildcard syntax as full-text search.
|
|
77
|
+
|
|
78
|
+
**Concepts in secedgar_compare_companies.** Spellings of one concept count once toward the 8-concept cap, and an unrecognized name does not count.
|
|
79
|
+
|
|
66
80
|
### Dataframes
|
|
67
81
|
|
|
68
|
-
Data tools stage their full result as a `df_<id>` table, named by the response's `dataset` handle, on one canvas that every secedgar_* call shares. Call secedgar_dataframe_describe with the `dataset` name the producing tool returned to get the table's column names before writing SQL, then secedgar_dataframe_query with one read-only SELECT. Describe without a name lists the active tables, except over HTTP with auth none, where every caller shares one canvas and that listing is refused. Tables from different tools join where they share a key: 13F positions, NPORT-P positions, and blockholder rows on `cusip`; insider and blockholder rows on `issuer_cik`. Insider rows carry no `cusip` and 13F rows no `issuer_cik`. A table expires a fixed time after it is staged (a day by default), and queries do not extend it; `missing_table` means the source tool
|
|
82
|
+
Data tools stage their full result as a `df_<id>` table, named by the response's `dataset` handle, on one canvas that every secedgar_* call shares. Call secedgar_dataframe_describe with the `dataset` name the producing tool returned to get the table's column names before writing SQL, then secedgar_dataframe_query with one read-only SELECT. Describe without a name lists the active tables, except over HTTP with auth none, where every caller shares one canvas and that listing is refused. Tables from different tools join where they share a key: 13F positions, NPORT-P positions, and blockholder rows on `cusip`; insider and blockholder rows on `issuer_cik`. Insider rows carry no `cusip` and 13F rows no `issuer_cik`. Under `role` `reporting_owner`, an insider row's `issuer_cik` is its own filing's issuer, so that join reads across companies. A table expires a fixed time after it is staged (a day by default), and queries do not extend it; `missing_table` means the name is wrong or the table expired: check it against the `dataset` name, and run the source tool again for an expired one. A deployment without a canvas, such as the MCPB bundle, returns results inline only.
|