@cyanheads/secedgar-mcp-server 0.12.5 → 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 (45) hide show
  1. package/README.md +34 -5
  2. package/dist/index.js +5 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts +89 -0
  5. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -0
  6. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +442 -0
  7. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -0
  8. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts.map +1 -1
  9. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js +1 -24
  10. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts +1 -0
  12. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/get-financials.tool.js +36 -56
  14. package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts +81 -0
  16. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts.map +1 -0
  17. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +254 -0
  18. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -0
  19. package/dist/services/edgar/concept-map.d.ts +21 -1
  20. package/dist/services/edgar/concept-map.d.ts.map +1 -1
  21. package/dist/services/edgar/concept-map.js +16 -0
  22. package/dist/services/edgar/concept-map.js.map +1 -1
  23. package/dist/services/edgar/concept-series.d.ts +65 -0
  24. package/dist/services/edgar/concept-series.d.ts.map +1 -0
  25. package/dist/services/edgar/concept-series.js +91 -0
  26. package/dist/services/edgar/concept-series.js.map +1 -0
  27. package/dist/services/edgar/edgar-api-service.d.ts +8 -6
  28. package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
  29. package/dist/services/edgar/edgar-api-service.js +7 -3
  30. package/dist/services/edgar/edgar-api-service.js.map +1 -1
  31. package/dist/services/edgar/fiscal-periods.d.ts +37 -0
  32. package/dist/services/edgar/fiscal-periods.d.ts.map +1 -0
  33. package/dist/services/edgar/fiscal-periods.js +106 -0
  34. package/dist/services/edgar/fiscal-periods.js.map +1 -0
  35. package/dist/services/edgar/mirror/companyfacts-sync.d.ts +7 -10
  36. package/dist/services/edgar/mirror/companyfacts-sync.d.ts.map +1 -1
  37. package/dist/services/edgar/mirror/companyfacts-sync.js.map +1 -1
  38. package/dist/services/edgar/mirror/edgar-mirror.d.ts +10 -1
  39. package/dist/services/edgar/mirror/edgar-mirror.d.ts.map +1 -1
  40. package/dist/services/edgar/mirror/edgar-mirror.js +35 -1
  41. package/dist/services/edgar/mirror/edgar-mirror.js.map +1 -1
  42. package/dist/services/edgar/types.d.ts +20 -0
  43. package/dist/services/edgar/types.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/server.json +3 -3
package/README.md CHANGED
@@ -1,7 +1,7 @@
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
 
@@ -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_snapshot` | One-call financial profile — the latest value of every supported concept, grouped by statement |
40
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,10 +98,24 @@ 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
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`.
@@ -139,6 +155,19 @@ Fetch SEC XBRL frames for one concept × one period across all reporting compani
139
155
 
140
156
  ---
141
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
+
142
171
  ### `secedgar_search_concepts`
143
172
 
144
173
  Discover supported XBRL concept names before querying financials or cross-company comparisons.
@@ -153,7 +182,7 @@ Discover supported XBRL concept names before querying financials or cross-compan
153
182
 
154
183
  ### `secedgar_dataframe_describe` / `secedgar_dataframe_query` / `secedgar_dataframe_drop`
155
184
 
156
- 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.
157
186
 
158
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.
159
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.
@@ -190,7 +219,7 @@ SEC EDGAR–specific:
190
219
  - Friendly XBRL concept name mapping with historical tag change handling
191
220
  - Searchable concept catalog with statement-group metadata and reverse XBRL tag lookup
192
221
  - HTML-to-text conversion for filing documents via `html-to-text`
193
- - 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`
194
223
  - No API keys required — SEC EDGAR is a free, public API
195
224
 
196
225
  ## Getting started
@@ -343,7 +372,7 @@ docker exec <container> bun run mirror:refresh # re-ingest when the archive ha
343
372
 
344
373
  | Directory | Purpose |
345
374
  |:---|:---|
346
- | `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. |
347
376
  | `src/mcp-server/resources/definitions/` | Resource definitions. XBRL concepts and filing types. |
348
377
  | `src/mcp-server/prompts/definitions/` | Prompt definitions. Company analysis prompt. |
349
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,uDAAuD,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iEAAiE,CAAC;AAC7G,OAAO,EAAE,4BAA4B,EAAE,MAAM,mEAAmE,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,E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E,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"}
@@ -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"}