@cyanheads/secedgar-mcp-server 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +6 -3
  2. package/dist/mcp-server/resources/definitions/concepts.resource.d.ts.map +1 -1
  3. package/dist/mcp-server/resources/definitions/concepts.resource.js +6 -1
  4. package/dist/mcp-server/resources/definitions/concepts.resource.js.map +1 -1
  5. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
  6. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +12 -3
  7. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
  8. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +9 -0
  9. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
  10. package/dist/mcp-server/tools/definitions/get-filing.tool.js +91 -6
  11. package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
  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 +11 -3
  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.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +11 -3
  17. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/search-concepts.tool.d.ts +1 -0
  19. package/dist/mcp-server/tools/definitions/search-concepts.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/search-concepts.tool.js +9 -1
  21. package/dist/mcp-server/tools/definitions/search-concepts.tool.js.map +1 -1
  22. package/dist/services/edgar/concept-map.d.ts.map +1 -1
  23. package/dist/services/edgar/concept-map.js +127 -1
  24. package/dist/services/edgar/concept-map.js.map +1 -1
  25. package/dist/services/edgar/concept-series.d.ts +15 -0
  26. package/dist/services/edgar/concept-series.d.ts.map +1 -1
  27. package/dist/services/edgar/concept-series.js +29 -0
  28. package/dist/services/edgar/concept-series.js.map +1 -1
  29. package/dist/services/edgar/fiscal-periods.d.ts +10 -5
  30. package/dist/services/edgar/fiscal-periods.d.ts.map +1 -1
  31. package/dist/services/edgar/fiscal-periods.js +33 -10
  32. package/dist/services/edgar/fiscal-periods.js.map +1 -1
  33. package/package.json +1 -1
  34. package/server.json +3 -3
@@ -32,6 +32,21 @@ export type PeriodType = 'annual' | 'quarterly' | 'all';
32
32
  * concept is not reported at all".
33
33
  */
34
34
  export declare function resolveFrameSeries(units: readonly TagPrioritizedUnit[]): Map<string, FramedUnit>;
35
+ /**
36
+ * Caveat for a concept that resolved to a tag SEC has retired from the taxonomy.
37
+ *
38
+ * A friendly name is a priority-ordered list of tags, and the lookup walks it
39
+ * until one returns data. When every current tag comes back empty for a filer,
40
+ * a deprecated tag at the end of the list can still match and produce a series
41
+ * that looks complete but stops around the tag's retirement — the failure is
42
+ * otherwise silent, since nothing in the values themselves says the tag is dead.
43
+ * The signal is the taxonomy label SEC already ships with the payload, so this
44
+ * generalizes to any concept whose fallback chain reaches a retired tag rather
45
+ * than to one hard-coded pair.
46
+ *
47
+ * Returns an empty array for a current tag, which is the common case.
48
+ */
49
+ export declare function deprecatedTagCaveats(tag: string, label: string): string[];
35
50
  /**
36
51
  * Whether a frame belongs to the requested period type. `fp` reflects the source
37
52
  * filing rather than the data point, so the frame label is the only reliable
@@ -1 +1 @@
1
- {"version":3,"file":"concept-series.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/concept-series.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE3E,gFAAgF;AAChF,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,6EAA6E;AAC7E,M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AAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;AAgBxD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAoBhG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAIhF;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,aAAa,GAAG,SAAS,CA0B3B"}
@@ -8,6 +8,13 @@
8
8
  * than re-implementing the rules.
9
9
  * @module services/edgar/concept-series
10
10
  */
11
+ /**
12
+ * SEC stamps a retired element's retirement date into the taxonomy label it
13
+ * serves with every companyconcept and companyfacts payload — e.g.
14
+ * `"Sales Revenue, Goods, Net (Deprecated 2018-01-31)"`. Matching it is the whole
15
+ * staleness signal; no extra upstream call is involved.
16
+ */
17
+ const DEPRECATED_LABEL = /\(Deprecated\s+(\d{4}-\d{2}-\d{2})\)/i;
11
18
  /** Annual duration frame — `CY2023`. */
12
19
  const ANNUAL_FRAME = /^CY\d{4}$/;
13
20
  /** Quarterly frame — `CY2023Q3` (duration) or `CY2023Q3I` (instant). */
@@ -42,6 +49,28 @@ export function resolveFrameSeries(units) {
42
49
  }
43
50
  return resolved;
44
51
  }
52
+ /**
53
+ * Caveat for a concept that resolved to a tag SEC has retired from the taxonomy.
54
+ *
55
+ * A friendly name is a priority-ordered list of tags, and the lookup walks it
56
+ * until one returns data. When every current tag comes back empty for a filer,
57
+ * a deprecated tag at the end of the list can still match and produce a series
58
+ * that looks complete but stops around the tag's retirement — the failure is
59
+ * otherwise silent, since nothing in the values themselves says the tag is dead.
60
+ * The signal is the taxonomy label SEC already ships with the payload, so this
61
+ * generalizes to any concept whose fallback chain reaches a retired tag rather
62
+ * than to one hard-coded pair.
63
+ *
64
+ * Returns an empty array for a current tag, which is the common case.
65
+ */
66
+ export function deprecatedTagCaveats(tag, label) {
67
+ const match = DEPRECATED_LABEL.exec(label);
68
+ if (!match?.[1])
69
+ return [];
70
+ return [
71
+ `XBRL tag ${tag} was retired from the taxonomy on ${match[1]} — SEC labels it "${label}". It matched only because every current tag ahead of it in this concept's priority list reports nothing for this filer, so the series can end years before the filer's latest report. Check secedgar_search_concepts for the concept's full tag list, or pass the tag this filer reports today.`,
72
+ ];
73
+ }
45
74
  /**
46
75
  * Whether a frame belongs to the requested period type. `fp` reflects the source
47
76
  * filing rather than the data point, so the frame label is the only reliable
@@ -1 +1 @@
1
- {"version":3,"file":"concept-series.js","sourceRoot":"","sources":["../../../src/services/edgar/concept-series.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,wCAAwC;AACxC,MAAM,YAAY,GAAG,WAAW,CAAC;AAEjC,wEAAwE;AACxE,MAAM,eAAe,GAAG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I,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,QAAQ,KAAK;gBACX,GAAG;gBACH,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG;gBAC3B,IAAI,EAAE,OAAO;gBACb,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACnF,CAAC;YACF,KAAK,MAAM,KAAK,IAAI,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEtB,MAAM,MAAM,GAAG,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClG,OAAO,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACtD,CAAC"}
@@ -19,7 +19,7 @@
19
19
  */
20
20
  export declare function fiscalQ4Caveats(period: string): string[];
21
21
  /**
22
- * Caveat for one filer's frame-tagged quarterly series: name the calendar
22
+ * Caveat for one filer's frame-tagged quarterly series: name every calendar
23
23
  * quarter that never appears, so a caller can tell "the company did not report"
24
24
  * apart from "the frame tagging does not expose it".
25
25
  *
@@ -28,10 +28,15 @@ export declare function fiscalQ4Caveats(period: string): string[];
28
28
  * inside it a year counts only when it reports at least
29
29
  * {@link MIN_QUARTERS_PER_YEAR} of the four calendar quarters (partial first/last
30
30
  * years carry no signal), and a caveat is emitted only when at least
31
- * {@link MIN_YEARS} of the counting years all omit the same single quarter. A
32
- * year inside the window that reports all four quarters, two that disagree about
33
- * which quarter is missing, or a window too sparse to reach the quorum all
34
- * suppress the caveat.
31
+ * {@link MIN_YEARS} of the counting years agree on a non-empty set of absent
32
+ * quarters. A year inside the window that reports all four quarters, years that
33
+ * disagree so no quarter is absent from all of them, or a window too sparse to
34
+ * reach the quorum all suppress the caveat.
35
+ *
36
+ * One or two quarters can be absent — the per-year quorum bounds it there. A
37
+ * single absent quarter is the fiscal-Q4 residual; a second one means the
38
+ * filer's fiscal quarters do not line up with calendar quarters at all, so
39
+ * further durations match no `CY####Q#` frame.
35
40
  */
36
41
  export declare function missingQuarterCaveats(frames: Iterable<string>): string[];
37
42
  //# sourceMappingURL=fiscal-periods.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fiscal-periods.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/fiscal-periods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqCH;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAOxD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA8BxE"}
1
+ {"version":3,"file":"fiscal-periods.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/fiscal-periods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA8CH;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAOxD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA2CxE"}
@@ -23,8 +23,17 @@ const FISCAL_Q4_EXAMPLES = {
23
23
  };
24
24
  /** Duration quarterly frame (`CY2024Q2`). Instant frames (`CY2024Q2I`) are excluded. */
25
25
  const DURATION_QUARTER_FRAME = /^CY(\d{4})Q([1-4])$/;
26
- /** A year needs at least this many reported quarters before its gaps carry signal. */
27
- const MIN_QUARTERS_PER_YEAR = 3;
26
+ /**
27
+ * A year needs at least this many reported quarters before its gaps carry
28
+ * signal. Two, not three: a filer can lose more than one calendar quarter to
29
+ * frame tagging — Costco's fiscal Q2 and fiscal Q4 durations both fall outside
30
+ * the quarters SEC frames, leaving a steady two per year — and a three-of-four
31
+ * quorum reads that as a sparse year and suppresses the caveat entirely. Two is
32
+ * also the floor at which a year still carries signal: it bounds the absent set
33
+ * at two quarters, so a year reporting a single quarter (a stub, a first year of
34
+ * filings) cannot drag three quarters into the caveat.
35
+ */
36
+ const MIN_QUARTERS_PER_YEAR = 2;
28
37
  /** At least this many qualifying years must agree before a gap is called systematic. */
29
38
  const MIN_YEARS = 2;
30
39
  /**
@@ -57,7 +66,7 @@ export function fiscalQ4Caveats(period) {
57
66
  ];
58
67
  }
59
68
  /**
60
- * Caveat for one filer's frame-tagged quarterly series: name the calendar
69
+ * Caveat for one filer's frame-tagged quarterly series: name every calendar
61
70
  * quarter that never appears, so a caller can tell "the company did not report"
62
71
  * apart from "the frame tagging does not expose it".
63
72
  *
@@ -66,10 +75,15 @@ export function fiscalQ4Caveats(period) {
66
75
  * inside it a year counts only when it reports at least
67
76
  * {@link MIN_QUARTERS_PER_YEAR} of the four calendar quarters (partial first/last
68
77
  * years carry no signal), and a caveat is emitted only when at least
69
- * {@link MIN_YEARS} of the counting years all omit the same single quarter. A
70
- * year inside the window that reports all four quarters, two that disagree about
71
- * which quarter is missing, or a window too sparse to reach the quorum all
72
- * suppress the caveat.
78
+ * {@link MIN_YEARS} of the counting years agree on a non-empty set of absent
79
+ * quarters. A year inside the window that reports all four quarters, years that
80
+ * disagree so no quarter is absent from all of them, or a window too sparse to
81
+ * reach the quorum all suppress the caveat.
82
+ *
83
+ * One or two quarters can be absent — the per-year quorum bounds it there. A
84
+ * single absent quarter is the fiscal-Q4 residual; a second one means the
85
+ * filer's fiscal quarters do not line up with calendar quarters at all, so
86
+ * further durations match no `CY####Q#` frame.
73
87
  */
74
88
  export function missingQuarterCaveats(frames) {
75
89
  const quartersByYear = new Map();
@@ -96,11 +110,20 @@ export function missingQuarterCaveats(frames) {
96
110
  for (const quarter of quarters)
97
111
  absent.delete(quarter);
98
112
  }
99
- const [missing] = absent;
100
- if (absent.size !== 1 || !missing)
113
+ if (absent.size === 0)
101
114
  return [];
115
+ const missing = [...absent].sort();
116
+ const subject = missing.length === 1
117
+ ? `Calendar Q${missing[0]} carries`
118
+ : `Calendar ${missing.map((q) => `Q${q}`).join(' and ')} carry`;
119
+ const cause = missing.length === 1
120
+ ? 'SEC XBRL reports fiscal Q4 as the 10-K residual rather than a discrete quarterly fact, so the calendar quarter that fiscal Q4 spans drops out of the quarterly series — the period was reported, the frame tagging does not expose it.'
121
+ : "SEC XBRL reports fiscal Q4 as the 10-K residual rather than a discrete quarterly fact, and this filer's remaining fiscal quarters span durations that no standard calendar quarter matches, so both drop out of the quarterly series — the periods were reported, the frame tagging does not expose them.";
122
+ const recovery = missing.length === 1
123
+ ? "Use period_type='annual' for the full-year figure, or derive the missing quarter as the annual total minus the three reported quarters."
124
+ : "Use period_type='annual' for the full-year figure; the absent quarters can only be derived together, as the annual total minus the reported quarters, never one at a time.";
102
125
  return [
103
- `Calendar Q${missing} carries no frame-tagged value in any of this filer's recent fully-reported years. SEC XBRL reports fiscal Q4 as the 10-K residual rather than a discrete quarterly fact, so the calendar quarter that fiscal Q4 spans drops out of the quarterly series — the period was reported, the frame tagging does not expose it. Use period_type='annual' for the full-year figure, or derive the missing quarter as the annual total minus the three reported quarters.`,
126
+ `${subject} no frame-tagged value in any of this filer's recent qualifying years. ${cause} ${recovery}`,
104
127
  ];
105
128
  }
106
129
  //# sourceMappingURL=fiscal-periods.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fiscal-periods.js","sourceRoot":"","sources":["../../../src/services/edgar/fiscal-periods.ts"],"names":[],"mappings":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EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACpE,MAAM,KAAK,GACT,OAAO,CAAC,MAAM,KAAK,CAAC;QAClB,CAAC,CAAC,wOAAwO;QAC1O,CAAC,CAAC,2SAA2S,CAAC;IAClT,MAAM,QAAQ,GACZ,OAAO,CAAC,MAAM,KAAK,CAAC;QAClB,CAAC,CAAC,yIAAyI;QAC3I,CAAC,CAAC,4KAA4K,CAAC;IAEnL,OAAO;QACL,GAAG,OAAO,0EAA0E,KAAK,IAAI,QAAQ,EAAE;KACxG,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/secedgar-mcp-server",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.",
5
5
  "mcpName": "io.github.cyanheads/secedgar-mcp-server",
6
6
  "type": "module",
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.13.0",
9
+ "version": "0.13.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": "bun",
22
- "version": "0.13.0",
22
+ "version": "0.13.1",
23
23
  "environmentVariables": [
24
24
  {
25
25
  "name": "EDGAR_USER_AGENT",
@@ -44,7 +44,7 @@
44
44
  "registryBaseUrl": "https://registry.npmjs.org",
45
45
  "identifier": "@cyanheads/secedgar-mcp-server",
46
46
  "runtimeHint": "bun",
47
- "version": "0.13.0",
47
+ "version": "0.13.1",
48
48
  "environmentVariables": [
49
49
  {
50
50
  "name": "EDGAR_USER_AGENT",