@cyanheads/secedgar-mcp-server 0.12.4 → 0.13.0

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 (68) hide show
  1. package/Dockerfile +1 -1
  2. package/LICENSE +1 -1
  3. package/README.md +41 -10
  4. package/dist/index.js +5 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/mcp-server/prompts/definitions/company-analysis.prompt.js +1 -1
  7. package/dist/mcp-server/prompts/definitions/company-analysis.prompt.js.map +1 -1
  8. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts +89 -0
  9. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -0
  10. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +442 -0
  11. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -0
  12. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts +7 -3
  13. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js +37 -29
  15. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +2 -2
  17. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-filing.tool.js +87 -11
  19. package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts +4 -3
  21. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-financials.tool.js +46 -58
  23. package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
  24. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +19 -2
  26. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +6 -3
  28. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +33 -5
  30. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts +81 -0
  32. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts.map +1 -0
  33. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +254 -0
  34. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -0
  35. package/dist/mcp-server/tools/definitions/search-concepts.tool.d.ts +8 -8
  36. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +7 -2
  37. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
  38. package/dist/mcp-server/tools/definitions/search-filings.tool.js +28 -2
  39. package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
  40. package/dist/services/canvas-bridge/canvas-bridge.d.ts.map +1 -1
  41. package/dist/services/canvas-bridge/canvas-bridge.js.map +1 -1
  42. package/dist/services/edgar/concept-map.d.ts +21 -1
  43. package/dist/services/edgar/concept-map.d.ts.map +1 -1
  44. package/dist/services/edgar/concept-map.js +16 -0
  45. package/dist/services/edgar/concept-map.js.map +1 -1
  46. package/dist/services/edgar/concept-series.d.ts +65 -0
  47. package/dist/services/edgar/concept-series.d.ts.map +1 -0
  48. package/dist/services/edgar/concept-series.js +91 -0
  49. package/dist/services/edgar/concept-series.js.map +1 -0
  50. package/dist/services/edgar/edgar-api-service.d.ts +8 -6
  51. package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
  52. package/dist/services/edgar/edgar-api-service.js +7 -3
  53. package/dist/services/edgar/edgar-api-service.js.map +1 -1
  54. package/dist/services/edgar/fiscal-periods.d.ts +37 -0
  55. package/dist/services/edgar/fiscal-periods.d.ts.map +1 -0
  56. package/dist/services/edgar/fiscal-periods.js +106 -0
  57. package/dist/services/edgar/fiscal-periods.js.map +1 -0
  58. package/dist/services/edgar/mirror/companyfacts-sync.d.ts +7 -10
  59. package/dist/services/edgar/mirror/companyfacts-sync.d.ts.map +1 -1
  60. package/dist/services/edgar/mirror/companyfacts-sync.js.map +1 -1
  61. package/dist/services/edgar/mirror/edgar-mirror.d.ts +10 -1
  62. package/dist/services/edgar/mirror/edgar-mirror.d.ts.map +1 -1
  63. package/dist/services/edgar/mirror/edgar-mirror.js +35 -1
  64. package/dist/services/edgar/mirror/edgar-mirror.js.map +1 -1
  65. package/dist/services/edgar/types.d.ts +20 -0
  66. package/dist/services/edgar/types.d.ts.map +1 -1
  67. package/package.json +9 -9
  68. package/server.json +3 -3
package/Dockerfile CHANGED
@@ -62,7 +62,7 @@ COPY --from=build /usr/src/app/node_modules ./node_modules
62
62
  ARG OTEL_ENABLED=true
63
63
  RUN --mount=type=cache,target=/root/.bun/install/cache \
64
64
  if [ "$OTEL_ENABLED" = "true" ]; then \
65
- bun add @hono/otel \
65
+ bun add --omit=dev --ignore-scripts @hono/otel \
66
66
  @opentelemetry/instrumentation-http \
67
67
  @opentelemetry/exporter-metrics-otlp-http \
68
68
  @opentelemetry/exporter-trace-otlp-http \
package/LICENSE CHANGED
@@ -175,7 +175,7 @@
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
177
 
178
- Copyright 2026 cyanheads
178
+ Copyright 2026 Casey Hand @cyanheads
179
179
 
180
180
  Licensed under the Apache License, Version 2.0 (the "License");
181
181
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <div align="center">
2
2
  <h1>@cyanheads/secedgar-mcp-server</h1>
3
3
  <p><b>Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.</b>
4
- <div>10 Tools (+1 opt-in) • 2 Resources • 1 Prompt</div>
4
+ <div>12 Tools (+1 opt-in) • 2 Resources • 1 Prompt</div>
5
5
  </p>
6
6
  </div>
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![npm](https://img.shields.io/npm/v/@cyanheads/secedgar-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/secedgar-mcp-server) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/secedgar-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![npm](https://img.shields.io/npm/v/@cyanheads/secedgar-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/secedgar-mcp-server) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/secedgar-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -29,7 +29,7 @@
29
29
 
30
30
  ## Tools
31
31
 
32
- Eight tools for querying SEC EDGAR data, plus three for SQL analytics over the DuckDB-backed canvas dataframes those tools materialize:
32
+ Ten tools for querying SEC EDGAR data, plus three for SQL analytics over the DuckDB-backed canvas dataframes those tools materialize:
33
33
 
34
34
  | Tool | Description |
35
35
  |:---|:---|
@@ -37,9 +37,11 @@ Eight tools for querying SEC EDGAR data, plus three for SQL analytics over the D
37
37
  | `secedgar_search_filings` | Search EDGAR filings since 1993 — full-text (2001+) plus archive-backed browse for pre-2001 ranges |
38
38
  | `secedgar_get_filing` | Fetch a specific filing's metadata and document content |
39
39
  | `secedgar_get_financials` | Get historical XBRL financial data for a company |
40
- | `secedgar_get_insider_transactions` | Form 3/4/5 insider transactions (buys, sells, grants, exercises) parsed from ownership XML |
40
+ | `secedgar_get_snapshot` | One-call financial profile — the latest value of every supported concept, grouped by statement |
41
+ | `secedgar_get_insider_transactions` | Form 4 / 4-A insider transactions (buys, sells, grants, exercises) parsed from ownership XML |
41
42
  | `secedgar_get_institutional_holdings` | 13F-HR quarterly institutional holdings parsed from the information table |
42
43
  | `secedgar_fetch_frames` | Fetch SEC XBRL frames for one concept × one period across all reporting companies |
44
+ | `secedgar_compare_companies` | Compare named companies across several concepts, aligned on calendar periods |
43
45
  | `secedgar_search_concepts` | Discover supported XBRL concept names or reverse-lookup a raw tag |
44
46
  | `secedgar_dataframe_describe` | List canvas dataframes with provenance, TTL, and schema |
45
47
  | `secedgar_dataframe_query` | Run a single-statement SELECT across dataframes |
@@ -96,13 +98,27 @@ Get historical XBRL financial data for a company with friendly concept name reso
96
98
  - Automatic deduplication to one value per standard calendar period
97
99
  - Filter by annual, quarterly, or all periods
98
100
  - Optional `limit` caps the inline series to the most-recent N periods; the full series stays queryable via the `df_<id>` dataframe
101
+ - Quarterly results carry a `caveats` entry when a calendar quarter is absent from the frame-tagged series — SEC reports fiscal Q4 as the 10-K residual, so the calendar quarter that fiscal Q4 spans has no discrete quarterly value (calendar-year filers included)
99
102
  - See `secedgar://concepts` resource for the full mapping
100
103
 
101
104
  ---
102
105
 
106
+ ### `secedgar_get_snapshot`
107
+
108
+ Build a company financial profile in one call instead of a run of `secedgar_get_financials` calls.
109
+
110
+ - Reads the filer's complete companyfacts payload once, then resolves every supported concept against it
111
+ - Same frame dedup and tag priority as `secedgar_get_financials`, so the two agree for any concept they both cover
112
+ - Duration concepts (income statement, cash flow, per-share) report their latest full year and latest single quarter; balance-sheet and entity-info concepts report their latest point-in-time value
113
+ - Concepts the filer does not report are listed under `gaps` with the XBRL tags that were tried — never zero-filled or interpolated
114
+ - IFRS filers resolve through the mapped IFRS tag variants via `taxonomy: "ifrs-full"`; each line reports the taxonomy its value came from
115
+ - Compact single-record profile — no dataframe; reach for `secedgar_get_financials` when you need a time series
116
+
117
+ ---
118
+
103
119
  ### `secedgar_get_insider_transactions`
104
120
 
105
- Surface Form 3/4/5 insider activity for a company by parsing ownership XML.
121
+ Surface Form 4 / 4-A insider activity for a company by parsing ownership XML. Form 3 initial statements and Form 5 annual statements are not covered — reach those with `secedgar_search_filings` (`forms: ["3", "5"]`) plus `secedgar_get_filing`.
106
122
 
107
123
  - Reporting person, relationship to issuer (director, officer + title, 10% owner), and transaction date
108
124
  - Transaction code mapped to a readable type (purchase, sale, gift, award, exercise, …); shares signed by acquired/disposed
@@ -121,7 +137,8 @@ Surface 13F-HR quarterly institutional holdings by parsing the information table
121
137
  - Sub-lines for the same security (one per manager/account) are consolidated into distinct positions sorted by value by default — pass `consolidate: false` for raw filing rows
122
138
  - Resolves the filing-manager name and reporting quarter from the cover page; target a specific quarter with `quarter` (e.g. `"2025-Q4"`)
123
139
  - `total_holdings_in_filing` counts raw info-table rows; `total_positions` counts distinct positions after consolidation (both before `limit`)
124
- - The full parsed holdings set is materialized as a `df_<id>` dataframe (the inline list is a preview capped at `limit`) — query it with `secedgar_dataframe_query` for full-filing aggregation or cross-quarter joins on `cusip` + `reporting_period`
140
+ - Page through a large information table with `offset` — the response echoes the effective `offset` and returns `next_offset` while rows remain, so every position stays reachable even when the canvas is disabled
141
+ - The full parsed holdings set is materialized as a `df_<id>` dataframe (the inline list is one page of `limit` rows) — query it with `secedgar_dataframe_query` for full-filing aggregation or cross-quarter joins on `cusip` + `reporting_period`
125
142
 
126
143
  ---
127
144
 
@@ -131,12 +148,26 @@ Fetch SEC XBRL frames for one concept × one period across all reporting compani
131
148
 
132
149
  - Same friendly concept names as `secedgar_get_financials`
133
150
  - Supports annual (`CY2023`), quarterly (`CY2024Q2`), and instant (`CY2023Q4I`) periods
134
- - Inline response returns the top N ranked companies (sort + limit), with ticker enrichment
151
+ - Inline response returns one page of the ranked companies (sort + limit), with ticker enrichment
152
+ - Walk further down the ranking with `offset` — the response echoes the effective `offset` and returns `next_offset` while companies remain, so ranks past the first page stay reachable even when the canvas is disabled
135
153
  - The full frames response (all reporters, typically 2k–10k rows) is materialized as a `df_<id>` dataframe — query it with `secedgar_dataframe_query`
136
154
  - `related_tags` flags alternate-definition tags some filers use as their primary line (e.g. `cash` → restricted-cash-inclusive total, `equity` → NCI-inclusive total), so a whole-universe screen on the base tag isn't silently under-inclusive — query those separately
137
155
 
138
156
  ---
139
157
 
158
+ ### `secedgar_compare_companies`
159
+
160
+ Compare 2-10 named companies across 1-8 concepts, aligned on calendar periods — the middle shape between `secedgar_get_financials` (one company over time) and `secedgar_fetch_frames` (one period across the market).
161
+
162
+ - One companyfacts read per company, resolved through the same frame dedup and tag priority as `secedgar_get_financials`
163
+ - Balance-sheet and entity-info concepts align on the calendar year or quarter their point-in-time snapshot falls in, so they sit in the same matrix as income-statement lines; each cell keeps its underlying XBRL frame
164
+ - `periods` bounds the inline matrix (1-12, default 4) and the window shrinks further when companies x concepts x periods is too large to return in one response; the full aligned series is always materialized as a `df_<id>` dataframe for growth rates and spreads via `secedgar_dataframe_query`
165
+ - A company that fails to resolve is reported in `failed_companies` with a machine-readable reason and the comparison proceeds with the rest
166
+ - A company that does not report a concept is reported in `gaps` with the tags that were tried — never interpolated
167
+ - `caveats` surface a filer missing a calendar quarter, period ends that differ inside one aligned period, and concepts whose unit differs across companies
168
+
169
+ ---
170
+
140
171
  ### `secedgar_search_concepts`
141
172
 
142
173
  Discover supported XBRL concept names before querying financials or cross-company comparisons.
@@ -151,7 +182,7 @@ Discover supported XBRL concept names before querying financials or cross-compan
151
182
 
152
183
  ### `secedgar_dataframe_describe` / `secedgar_dataframe_query` / `secedgar_dataframe_drop`
153
184
 
154
- In-conversation SQL analytics over the dataframes that `secedgar_fetch_frames`, `secedgar_search_filings`, `secedgar_get_financials`, `secedgar_get_insider_transactions`, and `secedgar_get_institutional_holdings` materialize on a shared DuckDB-backed canvas. Each data-returning call adds a `dataset` field with a `df_XXXXX_XXXXX` handle; pass that handle to `secedgar_dataframe_query` for joins, aggregates, window functions, percentiles — standard DuckDB SQL.
185
+ In-conversation SQL analytics over the dataframes that `secedgar_fetch_frames`, `secedgar_compare_companies`, `secedgar_search_filings`, `secedgar_get_financials`, `secedgar_get_insider_transactions`, and `secedgar_get_institutional_holdings` materialize on a shared DuckDB-backed canvas. Each data-returning call adds a `dataset` field with a `df_XXXXX_XXXXX` handle; pass that handle to `secedgar_dataframe_query` for joins, aggregates, window functions, percentiles — standard DuckDB SQL.
155
186
 
156
187
  - **Read-only by default.** Writes, DDL, DROP, COPY, PRAGMA, ATTACH, and external-file table functions are rejected by the framework SQL gate. System catalogs (`information_schema`, `pg_catalog`, `sqlite_master`, `duckdb_*`) are denied at the bridge layer so callers can't enumerate dataframes they don't already hold a handle for. `secedgar_dataframe_drop` is the only destructive tool and is opt-in (`EDGAR_DATAFRAME_DROP_ENABLED=true`); TTL handles cleanup otherwise.
157
188
  - **Per-table TTL.** Each dataframe ages on its own clock (default 24h, override with `EDGAR_DATASET_TTL_SECONDS`). The canvas itself uses the framework's sliding TTL.
@@ -188,7 +219,7 @@ SEC EDGAR–specific:
188
219
  - Friendly XBRL concept name mapping with historical tag change handling
189
220
  - Searchable concept catalog with statement-group metadata and reverse XBRL tag lookup
190
221
  - HTML-to-text conversion for filing documents via `html-to-text`
191
- - In-conversation SQL analytics: `secedgar_fetch_frames`, `secedgar_search_filings`, `secedgar_get_financials`, `secedgar_get_insider_transactions`, and `secedgar_get_institutional_holdings` materialize their full result as a DuckDB-backed canvas dataframe queryable via `secedgar_dataframe_query`
222
+ - In-conversation SQL analytics: `secedgar_fetch_frames`, `secedgar_compare_companies`, `secedgar_search_filings`, `secedgar_get_financials`, `secedgar_get_insider_transactions`, and `secedgar_get_institutional_holdings` materialize their full result as a DuckDB-backed canvas dataframe queryable via `secedgar_dataframe_query`
192
223
  - No API keys required — SEC EDGAR is a free, public API
193
224
 
194
225
  ## Getting started
@@ -341,7 +372,7 @@ docker exec <container> bun run mirror:refresh # re-ingest when the archive ha
341
372
 
342
373
  | Directory | Purpose |
343
374
  |:---|:---|
344
- | `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). Eight SEC EDGAR tools plus three `dataframe_*` tools for SQL analytics. |
375
+ | `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). Ten SEC EDGAR tools plus three `dataframe_*` tools for SQL analytics. |
345
376
  | `src/mcp-server/resources/definitions/` | Resource definitions. XBRL concepts and filing types. |
346
377
  | `src/mcp-server/prompts/definitions/` | Prompt definitions. Company analysis prompt. |
347
378
  | `src/services/edgar/` | SEC EDGAR API client, XBRL concept mapping, HTML-to-text conversion. |
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ import { companyAnalysisPrompt } from './mcp-server/prompts/definitions/company-
10
10
  import { conceptsResource } from './mcp-server/resources/definitions/concepts.resource.js';
11
11
  import { filingTypesResource } from './mcp-server/resources/definitions/filing-types.resource.js';
12
12
  import { companySearchTool } from './mcp-server/tools/definitions/company-search.tool.js';
13
+ import { compareCompaniesTool } from './mcp-server/tools/definitions/compare-companies.tool.js';
13
14
  import { dataframeDescribeTool } from './mcp-server/tools/definitions/dataframe-describe.tool.js';
14
15
  import { dataframeDropTool } from './mcp-server/tools/definitions/dataframe-drop.tool.js';
15
16
  import { dataframeQueryTool } from './mcp-server/tools/definitions/dataframe-query.tool.js';
@@ -18,6 +19,7 @@ import { getFilingTool } from './mcp-server/tools/definitions/get-filing.tool.js
18
19
  import { getFinancialsTool } from './mcp-server/tools/definitions/get-financials.tool.js';
19
20
  import { getInsiderTransactionsTool } from './mcp-server/tools/definitions/get-insider-transactions.tool.js';
20
21
  import { getInstitutionalHoldingsTool } from './mcp-server/tools/definitions/get-institutional-holdings.tool.js';
22
+ import { getSnapshotTool } from './mcp-server/tools/definitions/get-snapshot.tool.js';
21
23
  import { searchConceptsTool } from './mcp-server/tools/definitions/search-concepts.tool.js';
22
24
  import { searchFilingsTool } from './mcp-server/tools/definitions/search-filings.tool.js';
23
25
  import { initCanvasBridge } from './services/canvas-bridge/canvas-bridge.js';
@@ -40,9 +42,11 @@ await createApp({
40
42
  searchFilingsTool,
41
43
  getFilingTool,
42
44
  getFinancialsTool,
45
+ getSnapshotTool,
43
46
  getInsiderTransactionsTool,
44
47
  getInstitutionalHoldingsTool,
45
48
  fetchFramesTool,
49
+ compareCompaniesTool,
46
50
  searchConceptsTool,
47
51
  dataframeDescribeTool,
48
52
  dataframeQueryTool,
@@ -50,7 +54,7 @@ await createApp({
50
54
  ],
51
55
  resources: [conceptsResource, filingTypesResource],
52
56
  prompts: [companyAnalysisPrompt],
53
- instructions: 'Use the secedgar_* tools to query SEC EDGAR — US public-company filings since 1993 plus historical XBRL financials. Resolve companies with secedgar_company_search (accepts ticker, name, or CIK), fetch document text with secedgar_get_filing by accession number, and search filings with secedgar_search_filings (full-text covers 2001-present; pre-2001 date ranges browse the archives by form and entity/date, so pre-2001 full-text matching requires ticker:/cik: entity scope; supports boolean operators and inline ticker:AAPL / cik:320193 targeting). For financials, secedgar_get_financials and secedgar_fetch_frames accept friendly names like "revenue" or "eps_diluted" (discover them with secedgar_search_concepts) or raw XBRL tags. Data-returning tools also materialize their full upstream response as a df_<id> handle for downstream SQL via secedgar_dataframe_query — list dataframes with secedgar_dataframe_describe.',
57
+ instructions: 'Use the secedgar_* tools to query SEC EDGAR — US public-company filings since 1993 plus historical XBRL financials. Resolve companies with secedgar_company_search (accepts ticker, name, or CIK), fetch document text with secedgar_get_filing by accession number, and search filings with secedgar_search_filings (full-text covers 2001-present; pre-2001 date ranges browse the archives by form and entity/date, so pre-2001 full-text matching requires ticker:/cik: entity scope; supports boolean operators and inline ticker:AAPL / cik:320193 targeting). For financials, secedgar_get_financials and secedgar_fetch_frames accept friendly names like "revenue" or "eps_diluted" (discover them with secedgar_search_concepts) or raw XBRL tags; secedgar_get_snapshot profiles one company across every supported concept in a single call, and secedgar_compare_companies puts 2-10 named companies side by side on aligned calendar periods. Data-returning tools also materialize their full upstream response as a df_<id> handle for downstream SQL via secedgar_dataframe_query — list dataframes with secedgar_dataframe_describe.',
54
58
  async setup(core) {
55
59
  initEdgarApiService();
56
60
  initCanvasBridge(core.canvas);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,yDAAyD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,u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AC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;6BAC7C,CAAC,CAAC;4BACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;wBAC9E,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,EAAE;gCAC/C,GAAG,MAAM;gCACT,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;6BACxD,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC,EACD,0FAA0F,CAC3F,CAAC;oBACF,gBAAgB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;gBACjD,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,IAAI,CAAC,MAAM,CAAC,OAAO,CACjB,sIAAsI,EACtI;wBACE,GAAG,OAAO;wBACV,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;qBACxD,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -27,7 +27,7 @@ export const companyAnalysisPrompt = prompt('secedgar_company_analysis', {
27
27
  '**Material Events** — Use `secedgar_search_filings` (or call `secedgar_company_search` with `form_types: ["8-K"]`) to surface recent material events (M&A, leadership changes, earnings surprises).',
28
28
  ];
29
29
  if (wantsInsider) {
30
- steps.push('**Insider Activity** — Use `secedgar_get_insider_transactions` to review Form 3/4/5 buying and selling by officers, directors, and 10% owners.');
30
+ steps.push('**Insider Activity** — Use `secedgar_get_insider_transactions` to review Form 4 / 4-A transactions by officers, directors, and 10% owners (buys, sells, grants, exercises). It does not cover Form 3 initial statements or Form 5 annual statements — reach those with `secedgar_search_filings` (`forms: ["3", "5"]`) plus `secedgar_get_filing`.');
31
31
  }
32
32
  if (wantsInstitutional) {
33
33
  steps.push("**Institutional Ownership** — Use `secedgar_get_institutional_holdings` for a 13F filer's reported positions (pass the institutional manager, not the issuer — EDGAR has no issuer-to-holder index).");
@@ -1 +1 @@
1
- {"version":3,"file":"company-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/company-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,2BAA2B,EAAE;IACvE,WAAW,EAAE,mKAAmK;IAEhL,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QACtF,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,8HAA8H,CAC/H;KACJ,CAAC;IAEF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,+EAA+E;QAC/E,mFAAmF;QACnF,sEAAsE;QACtE,kEAAkE;QAClE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACrD,MAAM,YAAY,GAAG,0CAA0C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,kBAAkB,GAAG,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE3E,MAAM,KAAK,GAAa;YACtB,8GAA8G;YAC9G,6LAA6L;YAC7L,8JAA8J;YAC9J,qMAAqM;SACtM,CAAC;QACF,IAAI,YAAY,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CACR,gJAAgJ,CACjJ,CAAC;QACJ,CAAC;QACD,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CACR,sMAAsM,CACvM,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CACR,0FAA0F,CAC3F,CAAC;QAEF,MAAM,QAAQ,GAAa;YACzB,gEAAgE;YAChE,yDAAyD;YACzD,yDAAyD;YACzD,kEAAkE;SACnE,CAAC;QACF,IAAI,YAAY,IAAI,kBAAkB,EAAE,CAAC;YACvC,QAAQ,CAAC,IAAI,CACX,6FAA6F,CAC9F,CAAC;QACJ,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAClF,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAElF,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,iCAAiC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;wBACpH,EAAE;wBACF,kCAAkC;wBAClC,EAAE;wBACF,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC9C,EAAE;wBACF,sBAAsB;wBACtB,GAAG,QAAQ;qBACZ,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"company-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/company-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,2BAA2B,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O;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,iCAAiC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;wBACpH,EAAE;wBACF,kCAAkC;wBAClC,EAAE;wBACF,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;wBAC9C,EAAE;wBACF,sBAAsB;wBACtB,GAAG,QAAQ;qBACZ,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @fileoverview Period-aligned comparison of several named companies across
3
+ * several XBRL concepts. Sits between `secedgar_get_financials` (one company ×
4
+ * one concept over time) and `secedgar_fetch_frames` (one concept × one period
5
+ * across the whole market). Reads one companyfacts payload per company and
6
+ * resolves values through the shared frame dedup, so numbers match
7
+ * `secedgar_get_financials` for the same concept.
8
+ * @module mcp-server/tools/definitions/compare-companies
9
+ */
10
+ import { z } from '@cyanheads/mcp-ts-core';
11
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
12
+ export declare const compareCompaniesTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
13
+ companies: z.ZodArray<z.ZodString>;
14
+ concepts: z.ZodArray<z.ZodString>;
15
+ taxonomy: z.ZodDefault<z.ZodEnum<{
16
+ "ifrs-full": "ifrs-full";
17
+ "us-gaap": "us-gaap";
18
+ }>>;
19
+ period_type: z.ZodDefault<z.ZodEnum<{
20
+ annual: "annual";
21
+ quarterly: "quarterly";
22
+ }>>;
23
+ periods: z.ZodDefault<z.ZodNumber>;
24
+ }, z.core.$strip>, z.ZodObject<{
25
+ period_type: z.ZodString;
26
+ taxonomy: z.ZodString;
27
+ periods: z.ZodArray<z.ZodString>;
28
+ companies: z.ZodArray<z.ZodObject<{
29
+ input: z.ZodString;
30
+ cik: z.ZodString;
31
+ name: z.ZodString;
32
+ ticker: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>;
34
+ failed_companies: z.ZodArray<z.ZodObject<{
35
+ input: z.ZodString;
36
+ reason: z.ZodEnum<{
37
+ ambiguous: "ambiguous";
38
+ no_company_facts: "no_company_facts";
39
+ not_found: "not_found";
40
+ }>;
41
+ message: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ concepts: z.ZodArray<z.ZodObject<{
44
+ concept: z.ZodString;
45
+ label: z.ZodString;
46
+ units: z.ZodArray<z.ZodString>;
47
+ }, z.core.$strip>>;
48
+ cells: z.ZodArray<z.ZodObject<{
49
+ cik: z.ZodString;
50
+ company: z.ZodString;
51
+ concept: z.ZodString;
52
+ period: z.ZodString;
53
+ value: z.ZodNumber;
54
+ unit: z.ZodString;
55
+ taxonomy: z.ZodString;
56
+ tag: z.ZodString;
57
+ frame: z.ZodString;
58
+ period_end: z.ZodString;
59
+ form: z.ZodString;
60
+ accession_number: z.ZodString;
61
+ }, z.core.$strip>>;
62
+ gaps: z.ZodArray<z.ZodObject<{
63
+ cik: z.ZodString;
64
+ company: z.ZodString;
65
+ concept: z.ZodString;
66
+ tags_tried: z.ZodArray<z.ZodString>;
67
+ }, z.core.$strip>>;
68
+ caveats: z.ZodArray<z.ZodString>;
69
+ dataset: z.ZodOptional<z.ZodObject<{
70
+ name: z.ZodString;
71
+ row_count: z.ZodNumber;
72
+ expires_at: z.ZodString;
73
+ }, z.core.$strip>>;
74
+ }, z.core.$strip>, readonly [{
75
+ readonly reason: "no_companies_resolved";
76
+ readonly code: JsonRpcErrorCode.NotFound;
77
+ readonly when: "None of the supplied company inputs resolved to a CIK";
78
+ readonly recovery: "Use ticker symbols or 10-digit CIK numbers for exact matches.";
79
+ }, {
80
+ readonly reason: "no_comparable_data";
81
+ readonly code: JsonRpcErrorCode.NotFound;
82
+ readonly when: "Companies resolved but not one of them reports any of the requested concepts for the requested period type";
83
+ readonly recovery: "Switch period_type, or discover reported concept names with secedgar_search_concepts.";
84
+ }], {
85
+ readonly truncated: z.ZodOptional<z.ZodBoolean>;
86
+ readonly shown: z.ZodOptional<z.ZodNumber>;
87
+ readonly cap: z.ZodOptional<z.ZodNumber>;
88
+ }>;
89
+ //# sourceMappingURL=compare-companies.tool.d.ts.map
@@ -0,0 +1 @@
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;AA+DjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4d/B,CAAC"}