@cyanheads/secedgar-mcp-server 0.1.9
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/Dockerfile +99 -0
- package/LICENSE +190 -0
- package/README.md +260 -0
- package/dist/config/server-config.d.ts +14 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +33 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/company-analysis.prompt.d.ts +10 -0
- package/dist/mcp-server/prompts/definitions/company-analysis.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/company-analysis.prompt.js +43 -0
- package/dist/mcp-server/prompts/definitions/company-analysis.prompt.js.map +1 -0
- package/dist/mcp-server/resources/definitions/concepts.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/concepts.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/concepts.resource.js +77 -0
- package/dist/mcp-server/resources/definitions/concepts.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/filing-types.resource.d.ts +8 -0
- package/dist/mcp-server/resources/definitions/filing-types.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/filing-types.resource.js +94 -0
- package/dist/mcp-server/resources/definitions/filing-types.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/company-search.tool.d.ts +31 -0
- package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/company-search.tool.js +129 -0
- package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/compare-metric.tool.d.ts +37 -0
- package/dist/mcp-server/tools/definitions/compare-metric.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/compare-metric.tool.js +128 -0
- package/dist/mcp-server/tools/definitions/compare-metric.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +29 -0
- package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-filing.tool.js +157 -0
- package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts +40 -0
- package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-financials.tool.js +191 -0
- package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +29 -0
- package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-filings.tool.js +179 -0
- package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -0
- package/dist/services/edgar/concept-map.d.ts +13 -0
- package/dist/services/edgar/concept-map.d.ts.map +1 -0
- package/dist/services/edgar/concept-map.js +109 -0
- package/dist/services/edgar/concept-map.js.map +1 -0
- package/dist/services/edgar/edgar-api-service.d.ts +47 -0
- package/dist/services/edgar/edgar-api-service.d.ts.map +1 -0
- package/dist/services/edgar/edgar-api-service.js +213 -0
- package/dist/services/edgar/edgar-api-service.js.map +1 -0
- package/dist/services/edgar/filing-to-text.d.ts +11 -0
- package/dist/services/edgar/filing-to-text.d.ts.map +1 -0
- package/dist/services/edgar/filing-to-text.js +38 -0
- package/dist/services/edgar/filing-to-text.js.map +1 -0
- package/dist/services/edgar/types.d.ts +152 -0
- package/dist/services/edgar/types.d.ts.map +1 -0
- package/dist/services/edgar/types.js +6 -0
- package/dist/services/edgar/types.js.map +1 -0
- package/package.json +75 -0
- package/server.json +91 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt template for structured analysis of a public company's SEC filings.
|
|
3
|
+
* @module mcp-server/prompts/definitions/company-analysis
|
|
4
|
+
*/
|
|
5
|
+
import { prompt, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export const companyAnalysisPrompt = prompt('secedgar_company_analysis', {
|
|
7
|
+
description: `Guides a structured analysis of a public company's SEC filings: identify recent filings, extract financial trends, surface risk factors, and note material events.`,
|
|
8
|
+
args: z.object({
|
|
9
|
+
company: z.string().describe('Company name, ticker symbol, or CIK number to analyze.'),
|
|
10
|
+
focus_areas: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('Specific areas to focus on (e.g., "revenue growth, debt levels, insider activity"). If omitted, performs a general analysis.'),
|
|
14
|
+
}),
|
|
15
|
+
generate: (args) => [
|
|
16
|
+
{
|
|
17
|
+
role: 'user',
|
|
18
|
+
content: {
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: [
|
|
21
|
+
`Analyze the SEC filings for **${args.company}**${args.focus_areas ? ` with a focus on: ${args.focus_areas}` : ''}.`,
|
|
22
|
+
'',
|
|
23
|
+
'Follow this structured workflow:',
|
|
24
|
+
'',
|
|
25
|
+
'1. **Company Identification** — Use `secedgar_company_search` to resolve the company and review recent filings.',
|
|
26
|
+
'2. **Financial Trends** — Use `secedgar_get_financials` to pull key metrics (revenue, net_income, eps_diluted, assets, debt, operating_cash_flow) and identify trends over the last 3-5 years.',
|
|
27
|
+
'3. **Recent Filings Review** — Use `secedgar_get_filing` to read the most recent 10-K or 10-Q for qualitative insights (risk factors, MD&A, business overview).',
|
|
28
|
+
'4. **Material Events** — Search for recent 8-K filings to identify material events (M&A, leadership changes, earnings surprises).',
|
|
29
|
+
'5. **Industry Context** — Use `secedgar_compare_metric` to compare key metrics against peers.',
|
|
30
|
+
'',
|
|
31
|
+
'Present findings as:',
|
|
32
|
+
'- **Company Overview** — entity details, industry, fiscal year',
|
|
33
|
+
'- **Financial Summary** — key metrics table with trends',
|
|
34
|
+
'- **Risk Factors** — material risks from latest filings',
|
|
35
|
+
'- **Recent Events** — notable 8-K filings and their significance',
|
|
36
|
+
'- **Peer Comparison** — how the company stacks up on key metrics',
|
|
37
|
+
'- **Key Takeaways** — 3-5 bullet points summarizing the analysis',
|
|
38
|
+
].join('\n'),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=company-analysis.prompt.js.map
|
|
@@ -0,0 +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,oKAAoK;IAEjL,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,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;oBACJ,iCAAiC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;oBACpH,EAAE;oBACF,kCAAkC;oBAClC,EAAE;oBACF,iHAAiH;oBACjH,gMAAgM;oBAChM,iKAAiK;oBACjK,mIAAmI;oBACnI,+FAA+F;oBAC/F,EAAE;oBACF,sBAAsB;oBACtB,gEAAgE;oBAChE,yDAAyD;oBACzD,yDAAyD;oBACzD,kEAAkE;oBAClE,kEAAkE;oBAClE,kEAAkE;iBACnE,CAAC,IAAI,CAAC,IAAI,CAAC;aACb;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Reference list of common XBRL financial concepts grouped by financial statement.
|
|
3
|
+
* The "menu" an agent reads before calling secedgar_get_financials.
|
|
4
|
+
* @module mcp-server/resources/definitions/concepts
|
|
5
|
+
*/
|
|
6
|
+
export declare const conceptsResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<Readonly<{
|
|
7
|
+
[k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
+
}>, import("zod/v4/core").$strip>, undefined>;
|
|
9
|
+
//# sourceMappingURL=concepts.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concepts.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/concepts.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,gBAAgB;;6CAsF3B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Reference list of common XBRL financial concepts grouped by financial statement.
|
|
3
|
+
* The "menu" an agent reads before calling secedgar_get_financials.
|
|
4
|
+
* @module mcp-server/resources/definitions/concepts
|
|
5
|
+
*/
|
|
6
|
+
import { resource } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { getAllConcepts } from '../../../services/edgar/concept-map.js';
|
|
8
|
+
export const conceptsResource = resource('secedgar://concepts', {
|
|
9
|
+
name: 'XBRL Financial Concepts',
|
|
10
|
+
description: 'Reference list of common XBRL financial concepts grouped by financial statement, ' +
|
|
11
|
+
'mapping friendly names to XBRL tags. Read this before calling secedgar_get_financials to see available concept names.',
|
|
12
|
+
mimeType: 'text/markdown',
|
|
13
|
+
handler(_params, _ctx) {
|
|
14
|
+
const concepts = getAllConcepts();
|
|
15
|
+
const groups = {
|
|
16
|
+
'Income Statement': [],
|
|
17
|
+
'Balance Sheet': [],
|
|
18
|
+
'Cash Flow': [],
|
|
19
|
+
'Per Share': [],
|
|
20
|
+
'Entity Info': [],
|
|
21
|
+
};
|
|
22
|
+
const groupMap = {
|
|
23
|
+
revenue: 'Income Statement',
|
|
24
|
+
net_income: 'Income Statement',
|
|
25
|
+
operating_income: 'Income Statement',
|
|
26
|
+
gross_profit: 'Income Statement',
|
|
27
|
+
assets: 'Balance Sheet',
|
|
28
|
+
liabilities: 'Balance Sheet',
|
|
29
|
+
equity: 'Balance Sheet',
|
|
30
|
+
cash: 'Balance Sheet',
|
|
31
|
+
debt: 'Balance Sheet',
|
|
32
|
+
eps_basic: 'Per Share',
|
|
33
|
+
eps_diluted: 'Per Share',
|
|
34
|
+
operating_cash_flow: 'Cash Flow',
|
|
35
|
+
capex: 'Cash Flow',
|
|
36
|
+
shares_outstanding: 'Entity Info',
|
|
37
|
+
};
|
|
38
|
+
for (const [name, mapping] of Object.entries(concepts)) {
|
|
39
|
+
const group = groupMap[name] ?? 'Other';
|
|
40
|
+
if (!groups[group])
|
|
41
|
+
groups[group] = [];
|
|
42
|
+
groups[group].push({
|
|
43
|
+
name,
|
|
44
|
+
label: mapping.label,
|
|
45
|
+
tags: mapping.tags,
|
|
46
|
+
taxonomy: mapping.taxonomy,
|
|
47
|
+
unit: mapping.unit,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const lines = ['# XBRL Financial Concepts', ''];
|
|
51
|
+
lines.push('Use these friendly names with `secedgar_get_financials` and `secedgar_compare_metric`.', '');
|
|
52
|
+
lines.push('Raw XBRL tags are also accepted as an escape hatch for concepts not listed here.', '');
|
|
53
|
+
for (const [group, items] of Object.entries(groups)) {
|
|
54
|
+
if (items.length === 0)
|
|
55
|
+
continue;
|
|
56
|
+
lines.push(`## ${group}`, '');
|
|
57
|
+
lines.push('| Friendly Name | Label | XBRL Tags | Taxonomy | Unit |');
|
|
58
|
+
lines.push('|:------|:------|:----------|:---------|:-----|');
|
|
59
|
+
for (const item of items) {
|
|
60
|
+
lines.push(`| \`${item.name}\` | ${item.label} | ${item.tags.map((t) => `\`${t}\``).join(', ')} | ${item.taxonomy} | ${item.unit} |`);
|
|
61
|
+
}
|
|
62
|
+
lines.push('');
|
|
63
|
+
}
|
|
64
|
+
return lines.join('\n');
|
|
65
|
+
},
|
|
66
|
+
list: async () => ({
|
|
67
|
+
resources: [
|
|
68
|
+
{
|
|
69
|
+
uri: 'secedgar://concepts',
|
|
70
|
+
name: 'XBRL Financial Concepts',
|
|
71
|
+
description: 'Common financial concept names and their XBRL tag mappings',
|
|
72
|
+
mimeType: 'text/markdown',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=concepts.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concepts.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/concepts.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,qBAAqB,EAAE;IAC9D,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,mFAAmF;QACnF,uHAAuH;IACzH,QAAQ,EAAE,eAAe;IAEzB,OAAO,CAAC,OAAO,EAAE,IAAI;QACnB,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;QAElC,MAAM,MAAM,GAGR;YACF,kBAAkB,EAAE,EAAE;YACtB,eAAe,EAAE,EAAE;YACnB,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE;YACf,aAAa,EAAE,EAAE;SAClB,CAAC;QAEF,MAAM,QAAQ,GAA2B;YACvC,OAAO,EAAE,kBAAkB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AAE,EAAE,EAAE,CAAC,CAAC;YAC9B,KAAK,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;YACtE,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;YAC9D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,KAAK,CAAC,IAAI,CACR,OAAO,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,IAAI,IAAI,CAC1H,CAAC;YACJ,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,qBAAqB;gBAC1B,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,4DAA4D;gBACzE,QAAQ,EAAE,eAAe;aAC1B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Reference list of common SEC filing types with descriptions and use cases.
|
|
3
|
+
* @module mcp-server/resources/definitions/filing-types
|
|
4
|
+
*/
|
|
5
|
+
export declare const filingTypesResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<Readonly<{
|
|
6
|
+
[k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
+
}>, import("zod/v4/core").$strip>, undefined>;
|
|
8
|
+
//# sourceMappingURL=filing-types.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filing-types.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/filing-types.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsEH,eAAO,MAAM,mBAAmB;;6CA+B9B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Reference list of common SEC filing types with descriptions and use cases.
|
|
3
|
+
* @module mcp-server/resources/definitions/filing-types
|
|
4
|
+
*/
|
|
5
|
+
import { resource } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
const FILING_TYPES = [
|
|
7
|
+
{
|
|
8
|
+
form: '10-K',
|
|
9
|
+
cadence: 'Annual',
|
|
10
|
+
description: 'Annual report with audited financials, MD&A, risk factors, and business overview.',
|
|
11
|
+
use_cases: 'Financial analysis, due diligence, competitive research',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
form: '10-Q',
|
|
15
|
+
cadence: 'Quarterly (Q1-Q3)',
|
|
16
|
+
description: 'Quarterly report with unaudited financials, MD&A, and market risks.',
|
|
17
|
+
use_cases: 'Tracking quarterly performance, identifying trends',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
form: '8-K',
|
|
21
|
+
cadence: 'Event-driven',
|
|
22
|
+
description: 'Current report for material events: M&A (1.01), earnings (2.02), exec changes (5.02).',
|
|
23
|
+
use_cases: 'Breaking news, material events, earnings announcements',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
form: 'DEF 14A',
|
|
27
|
+
cadence: 'Annual proxy',
|
|
28
|
+
description: 'Definitive proxy statement with board elections, executive pay, and shareholder votes.',
|
|
29
|
+
use_cases: 'Executive compensation analysis, governance research',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
form: '13F-HR',
|
|
33
|
+
cadence: 'Quarterly',
|
|
34
|
+
description: 'Institutional investment manager holdings ($100M+ AUM).',
|
|
35
|
+
use_cases: 'Tracking institutional ownership, portfolio analysis',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
form: 'Form 4',
|
|
39
|
+
cadence: 'Per-transaction',
|
|
40
|
+
description: 'Insider buy/sell report: date, shares, price, and transaction code.',
|
|
41
|
+
use_cases: 'Insider trading activity, management confidence signals',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
form: 'SC 13D',
|
|
45
|
+
cadence: 'Threshold',
|
|
46
|
+
description: 'Beneficial ownership report for 5%+ activist investors.',
|
|
47
|
+
use_cases: 'Activist investor tracking, ownership changes',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
form: 'SC 13G',
|
|
51
|
+
cadence: 'Threshold',
|
|
52
|
+
description: 'Beneficial ownership report for 5%+ passive investors.',
|
|
53
|
+
use_cases: 'Passive institutional ownership tracking',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
form: 'S-1',
|
|
57
|
+
cadence: 'One-time',
|
|
58
|
+
description: 'IPO registration statement with prospectus, financials, and risk factors.',
|
|
59
|
+
use_cases: 'IPO research, pre-IPO due diligence',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
form: '20-F',
|
|
63
|
+
cadence: 'Annual',
|
|
64
|
+
description: 'Foreign private issuer annual report (equivalent of 10-K).',
|
|
65
|
+
use_cases: 'International company analysis',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
export const filingTypesResource = resource('secedgar://filing-types', {
|
|
69
|
+
name: 'SEC Filing Types',
|
|
70
|
+
description: 'Reference list of common SEC filing types with descriptions, cadence, and typical use cases. ' +
|
|
71
|
+
'Helps determine which form_types to filter when searching filings.',
|
|
72
|
+
mimeType: 'text/markdown',
|
|
73
|
+
handler(_params, _ctx) {
|
|
74
|
+
const lines = ['# SEC Filing Types', ''];
|
|
75
|
+
lines.push('Use these form types with `secedgar_company_search` (form_types filter) and `secedgar_search_filings` (forms filter).', '');
|
|
76
|
+
lines.push('| Form | Cadence | Description | Use Cases |');
|
|
77
|
+
lines.push('|:-----|:--------|:------------|:----------|');
|
|
78
|
+
for (const ft of FILING_TYPES) {
|
|
79
|
+
lines.push(`| **${ft.form}** | ${ft.cadence} | ${ft.description} | ${ft.use_cases} |`);
|
|
80
|
+
}
|
|
81
|
+
return lines.join('\n');
|
|
82
|
+
},
|
|
83
|
+
list: async () => ({
|
|
84
|
+
resources: [
|
|
85
|
+
{
|
|
86
|
+
uri: 'secedgar://filing-types',
|
|
87
|
+
name: 'SEC Filing Types',
|
|
88
|
+
description: 'Common SEC filing types with descriptions and use cases',
|
|
89
|
+
mimeType: 'text/markdown',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=filing-types.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filing-types.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/filing-types.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,QAAQ;QACjB,WAAW,EACT,mFAAmF;QACrF,SAAS,EAAE,yDAAyD;KACrE;IACD;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,mBAAmB;QAC5B,WAAW,EAAE,qEAAqE;QAClF,SAAS,EAAE,oDAAoD;KAChE;IACD;QACE,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,cAAc;QACvB,WAAW,EACT,uFAAuF;QACzF,SAAS,EAAE,wDAAwD;KACpE;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,cAAc;QACvB,WAAW,EACT,wFAAwF;QAC1F,SAAS,EAAE,sDAAsD;KAClE;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,yDAAyD;QACtE,SAAS,EAAE,sDAAsD;KAClE;IACD;Q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,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,yBAAyB;gBAC9B,IAAI,EAAE,kBAAkB;gBACxB,WAAW,EAAE,yDAAyD;gBACtE,QAAQ,EAAE,eAAe;aAC1B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Find companies and retrieve entity info with optional recent filings.
|
|
3
|
+
* Entry point for most SEC EDGAR workflows.
|
|
4
|
+
* @module mcp-server/tools/definitions/company-search
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
export declare const companySearchTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
query: z.ZodString;
|
|
9
|
+
include_filings: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
form_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
filing_limit: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
cik: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
tickers: z.ZodArray<z.ZodString>;
|
|
16
|
+
exchanges: z.ZodArray<z.ZodString>;
|
|
17
|
+
sic: z.ZodString;
|
|
18
|
+
sic_description: z.ZodString;
|
|
19
|
+
state_of_incorporation: z.ZodOptional<z.ZodString>;
|
|
20
|
+
fiscal_year_end: z.ZodString;
|
|
21
|
+
filings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
22
|
+
accession_number: z.ZodString;
|
|
23
|
+
form: z.ZodString;
|
|
24
|
+
filing_date: z.ZodString;
|
|
25
|
+
report_date: z.ZodOptional<z.ZodString>;
|
|
26
|
+
primary_document: z.ZodString;
|
|
27
|
+
description: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>>;
|
|
29
|
+
total_filings: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
//# sourceMappingURL=company-search.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-search.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/company-search.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAIjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;kBAiK5B,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Find companies and retrieve entity info with optional recent filings.
|
|
3
|
+
* Entry point for most SEC EDGAR workflows.
|
|
4
|
+
* @module mcp-server/tools/definitions/company-search
|
|
5
|
+
*/
|
|
6
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
import { getEdgarApiService } from '../../../services/edgar/edgar-api-service.js';
|
|
9
|
+
export const companySearchTool = tool('secedgar_company_search', {
|
|
10
|
+
description: 'Find companies and retrieve entity info with optional recent filings. ' +
|
|
11
|
+
'Entry point for most EDGAR workflows — resolve tickers, names, or CIKs to entity details.',
|
|
12
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
13
|
+
input: z.object({
|
|
14
|
+
query: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Company ticker symbol (e.g., "AAPL"), name (e.g., "Apple"), or CIK number (e.g., "320193"). Ticker is the fastest lookup. Name search does fuzzy matching.'),
|
|
18
|
+
include_filings: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.default(true)
|
|
21
|
+
.describe('Include recent filings in the response. Set to false for entity-info-only lookups.'),
|
|
22
|
+
form_types: z
|
|
23
|
+
.array(z.string())
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Filter filings to specific form types (e.g., ["10-K", "10-Q", "8-K"]). Without this, returns all form types.'),
|
|
26
|
+
filing_limit: z
|
|
27
|
+
.number()
|
|
28
|
+
.int()
|
|
29
|
+
.min(1)
|
|
30
|
+
.max(50)
|
|
31
|
+
.default(10)
|
|
32
|
+
.describe('Maximum number of filings to return.'),
|
|
33
|
+
}),
|
|
34
|
+
output: z.object({
|
|
35
|
+
cik: z.string().describe('Central Index Key, zero-padded to 10 digits.'),
|
|
36
|
+
name: z.string().describe('SEC-conformed company name.'),
|
|
37
|
+
tickers: z.array(z.string()).describe('Associated ticker symbols.'),
|
|
38
|
+
exchanges: z.array(z.string()).describe('Exchanges where listed.'),
|
|
39
|
+
sic: z.string().describe('SIC industry code.'),
|
|
40
|
+
sic_description: z.string().describe('Human-readable SIC description.'),
|
|
41
|
+
state_of_incorporation: z.string().optional().describe('State of incorporation.'),
|
|
42
|
+
fiscal_year_end: z.string().describe('Fiscal year end (MMDD format).'),
|
|
43
|
+
filings: z
|
|
44
|
+
.array(z.object({
|
|
45
|
+
accession_number: z.string().describe('Filing accession number.'),
|
|
46
|
+
form: z.string().describe('Form type (e.g., 10-K).'),
|
|
47
|
+
filing_date: z.string().describe('Date filed.'),
|
|
48
|
+
report_date: z.string().optional().describe('Period of report.'),
|
|
49
|
+
primary_document: z.string().describe('Primary document filename.'),
|
|
50
|
+
description: z.string().optional().describe('Filing description.'),
|
|
51
|
+
}))
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Recent filings, filtered by form_types if specified.'),
|
|
54
|
+
total_filings: z
|
|
55
|
+
.number()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Total filings matching the filter (may exceed filing_limit).'),
|
|
58
|
+
}),
|
|
59
|
+
async handler(input, ctx) {
|
|
60
|
+
const api = getEdgarApiService();
|
|
61
|
+
const resolved = await api.resolveCik(input.query);
|
|
62
|
+
if (Array.isArray(resolved)) {
|
|
63
|
+
if (resolved.length === 0) {
|
|
64
|
+
throw notFound(`No company found for '${input.query}'. Try a ticker symbol (e.g., 'AAPL'), full company name, or 10-digit CIK.`);
|
|
65
|
+
}
|
|
66
|
+
if (resolved.length > 1) {
|
|
67
|
+
const matches = resolved.map((m) => `${m.ticker} (${m.name})`).join(', ');
|
|
68
|
+
throw notFound(`Multiple matches for '${input.query}': ${matches}. Specify a ticker for an exact match.`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const match = Array.isArray(resolved) ? resolved[0] : resolved;
|
|
72
|
+
if (!match)
|
|
73
|
+
throw notFound(`No company found for '${input.query}'.`);
|
|
74
|
+
const submissions = await api.getSubmissions(match.cik);
|
|
75
|
+
ctx.log.info('Company resolved', {
|
|
76
|
+
query: input.query,
|
|
77
|
+
cik: match.cik,
|
|
78
|
+
name: submissions.name,
|
|
79
|
+
});
|
|
80
|
+
let filings;
|
|
81
|
+
let totalFilings;
|
|
82
|
+
if (input.include_filings) {
|
|
83
|
+
const recent = submissions.filings.recent;
|
|
84
|
+
const count = recent.accessionNumber.length;
|
|
85
|
+
// Zip parallel arrays into objects
|
|
86
|
+
const all = [];
|
|
87
|
+
for (let i = 0; i < count; i++) {
|
|
88
|
+
all.push({
|
|
89
|
+
accession_number: recent.accessionNumber[i] ?? '',
|
|
90
|
+
form: recent.form[i] ?? '',
|
|
91
|
+
filing_date: recent.filingDate[i] ?? '',
|
|
92
|
+
report_date: recent.reportDate[i] || undefined,
|
|
93
|
+
primary_document: recent.primaryDocument[i] ?? '',
|
|
94
|
+
description: recent.primaryDocDescription[i] || undefined,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Filter by form types
|
|
98
|
+
const filtered = input.form_types
|
|
99
|
+
? all.filter((f) => input.form_types?.some((ft) => f.form.toUpperCase() === ft.toUpperCase()))
|
|
100
|
+
: all;
|
|
101
|
+
totalFilings = filtered.length;
|
|
102
|
+
filings = filtered.slice(0, input.filing_limit);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
cik: match.cik,
|
|
106
|
+
name: submissions.name,
|
|
107
|
+
tickers: submissions.tickers,
|
|
108
|
+
exchanges: submissions.exchanges,
|
|
109
|
+
sic: submissions.sic,
|
|
110
|
+
sic_description: submissions.sicDescription,
|
|
111
|
+
state_of_incorporation: submissions.stateOfIncorporation || undefined,
|
|
112
|
+
fiscal_year_end: submissions.fiscalYearEnd,
|
|
113
|
+
filings,
|
|
114
|
+
total_filings: totalFilings,
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
format: (result) => {
|
|
118
|
+
const lines = [`**${result.name}** (${result.tickers.join(', ') || 'no ticker'})`];
|
|
119
|
+
lines.push(`CIK: ${result.cik} | SIC: ${result.sic} (${result.sic_description})`);
|
|
120
|
+
if (result.filings?.length) {
|
|
121
|
+
lines.push(`\nRecent filings (${result.filings.length} of ${result.total_filings}):`);
|
|
122
|
+
for (const f of result.filings) {
|
|
123
|
+
lines.push(`- ${f.form} ${f.filing_date} [${f.accession_number}]`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=company-search.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-search.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/company-search.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAC/D,WAAW,EACT,wEAAwE;QACxE,2FAA2F;IAC7F,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EA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CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,KAAK,GAAG,CAAC,KAAK,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC;QACnF,KAAK,CAAC,IAAI,CAAC,QAAQ,MAAM,CAAC,GAAG,WAAW,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,eAAe,GAAG,CAAC,CAAC;QAClF,IAAI,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,qBAAqB,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,MAAM,CAAC,aAAa,IAAI,CAAC,CAAC;YACtF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBAC/B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Compare a financial metric across all reporting companies for a specific period.
|
|
3
|
+
* @module mcp-server/tools/definitions/compare-metric
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const compareMetricTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
concept: z.ZodString;
|
|
8
|
+
period: z.ZodString;
|
|
9
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
10
|
+
USD: "USD";
|
|
11
|
+
shares: "shares";
|
|
12
|
+
"USD-per-shares": "USD-per-shares";
|
|
13
|
+
pure: "pure";
|
|
14
|
+
}>>;
|
|
15
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
17
|
+
desc: "desc";
|
|
18
|
+
asc: "asc";
|
|
19
|
+
}>>;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
concept: z.ZodString;
|
|
22
|
+
period: z.ZodString;
|
|
23
|
+
unit: z.ZodString;
|
|
24
|
+
label: z.ZodString;
|
|
25
|
+
total_companies: z.ZodNumber;
|
|
26
|
+
data: z.ZodArray<z.ZodObject<{
|
|
27
|
+
rank: z.ZodNumber;
|
|
28
|
+
company_name: z.ZodString;
|
|
29
|
+
cik: z.ZodString;
|
|
30
|
+
ticker: z.ZodOptional<z.ZodString>;
|
|
31
|
+
value: z.ZodNumber;
|
|
32
|
+
location: z.ZodOptional<z.ZodString>;
|
|
33
|
+
period_end: z.ZodString;
|
|
34
|
+
accession_number: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
//# sourceMappingURL=compare-metric.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-metric.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-metric.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAMjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8I5B,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Compare a financial metric across all reporting companies for a specific period.
|
|
3
|
+
* @module mcp-server/tools/definitions/compare-metric
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { resolveConcept } from '../../../services/edgar/concept-map.js';
|
|
8
|
+
import { getEdgarApiService } from '../../../services/edgar/edgar-api-service.js';
|
|
9
|
+
export const compareMetricTool = tool('secedgar_compare_metric', {
|
|
10
|
+
description: 'Compare a financial metric across all reporting companies for a specific period. ' +
|
|
11
|
+
'Uses the same friendly concept names as secedgar_get_financials (e.g., "revenue", "assets").',
|
|
12
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
13
|
+
input: z.object({
|
|
14
|
+
concept: z
|
|
15
|
+
.string()
|
|
16
|
+
.describe('Financial concept — same friendly names as secedgar_get_financials ' +
|
|
17
|
+
'(e.g., "revenue", "assets", "eps_basic") or raw XBRL tag.'),
|
|
18
|
+
period: z
|
|
19
|
+
.string()
|
|
20
|
+
.describe('Calendar period. Formats:\n' +
|
|
21
|
+
' "CY2023" — full year 2023 (duration, for income statement items)\n' +
|
|
22
|
+
' "CY2024Q2" — Q2 2024 (duration, for quarterly income items)\n' +
|
|
23
|
+
' "CY2023Q4I" — Q4 2023 instant (balance sheet items like assets, cash)\n' +
|
|
24
|
+
'Use duration periods (no I suffix) for income/cash flow items. ' +
|
|
25
|
+
'Use instant periods (I suffix) for balance sheet items.'),
|
|
26
|
+
unit: z
|
|
27
|
+
.enum(['USD', 'USD-per-shares', 'shares', 'pure'])
|
|
28
|
+
.default('USD')
|
|
29
|
+
.describe('Unit of measure. Use "USD-per-shares" for EPS, "shares" for share counts, "pure" for ratios.'),
|
|
30
|
+
limit: z.number().int().min(1).max(100).default(25).describe('Number of companies to return.'),
|
|
31
|
+
sort: z
|
|
32
|
+
.enum(['desc', 'asc'])
|
|
33
|
+
.default('desc')
|
|
34
|
+
.describe('Sort direction. "desc" for highest values first (typical for revenue, assets). "asc" for lowest values.'),
|
|
35
|
+
}),
|
|
36
|
+
output: z.object({
|
|
37
|
+
concept: z.string().describe('XBRL tag used.'),
|
|
38
|
+
period: z.string().describe('Calendar period.'),
|
|
39
|
+
unit: z.string().describe('Unit of measure.'),
|
|
40
|
+
label: z.string().describe('Human-readable concept label.'),
|
|
41
|
+
total_companies: z.number().describe('Total companies reporting this metric for this period.'),
|
|
42
|
+
data: z
|
|
43
|
+
.array(z.object({
|
|
44
|
+
rank: z.number().describe('Rank in sorted order.'),
|
|
45
|
+
company_name: z.string().describe('Entity name.'),
|
|
46
|
+
cik: z.string().describe('Company CIK.'),
|
|
47
|
+
ticker: z.string().optional().describe('Ticker symbol (if available).'),
|
|
48
|
+
value: z.number().describe('Reported value.'),
|
|
49
|
+
location: z.string().optional().describe('Business location.'),
|
|
50
|
+
period_end: z.string().describe('Period end date.'),
|
|
51
|
+
accession_number: z.string().describe('Source filing for secedgar_get_filing.'),
|
|
52
|
+
}))
|
|
53
|
+
.describe('Ranked companies for this metric.'),
|
|
54
|
+
}),
|
|
55
|
+
async handler(input, ctx) {
|
|
56
|
+
const api = getEdgarApiService();
|
|
57
|
+
// Resolve concept
|
|
58
|
+
const mapping = resolveConcept(input.concept);
|
|
59
|
+
const tag = mapping?.tags[0] ?? input.concept;
|
|
60
|
+
const taxonomy = mapping?.taxonomy ?? 'us-gaap';
|
|
61
|
+
const label = mapping?.label ?? input.concept;
|
|
62
|
+
const unit = mapping ? mapping.unit.replace('/', '-per-') : input.unit;
|
|
63
|
+
// Fetch frames data
|
|
64
|
+
let framesResponse;
|
|
65
|
+
try {
|
|
66
|
+
framesResponse = await api.getFrames(taxonomy, tag, unit, input.period);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
const is404 = err instanceof Error && /404|not found/i.test(err.message);
|
|
70
|
+
if (!is404)
|
|
71
|
+
throw err;
|
|
72
|
+
// Distinguish unknown concept (no mapping + 404) from valid concept with no data
|
|
73
|
+
const hint = !mapping
|
|
74
|
+
? `Unknown concept '${input.concept}'. Use a friendly name (e.g., "revenue", "assets") ` +
|
|
75
|
+
'or a valid XBRL tag. See secedgar://concepts for available names.'
|
|
76
|
+
: `No data for ${label}/${unit}/${input.period}. Check: ` +
|
|
77
|
+
'duration vs. instant period (add "I" for balance sheet items), ' +
|
|
78
|
+
'correct unit (USD-per-shares for EPS), and period exists (data starts ~CY2009).';
|
|
79
|
+
throw notFound(hint);
|
|
80
|
+
}
|
|
81
|
+
// Sort by value
|
|
82
|
+
const sorted = [...framesResponse.data].sort((a, b) => input.sort === 'desc' ? b.val - a.val : a.val - b.val);
|
|
83
|
+
// Slice to limit and enrich with tickers
|
|
84
|
+
const sliced = sorted.slice(0, input.limit);
|
|
85
|
+
const data = await Promise.all(sliced.map(async (entry, i) => {
|
|
86
|
+
const cik = String(entry.cik).padStart(10, '0');
|
|
87
|
+
const ticker = await api.cikToTicker(cik);
|
|
88
|
+
return {
|
|
89
|
+
rank: i + 1,
|
|
90
|
+
company_name: entry.entityName,
|
|
91
|
+
cik,
|
|
92
|
+
ticker: ticker || undefined,
|
|
93
|
+
value: entry.val,
|
|
94
|
+
location: entry.loc || undefined,
|
|
95
|
+
period_end: entry.end,
|
|
96
|
+
accession_number: entry.accn,
|
|
97
|
+
};
|
|
98
|
+
}));
|
|
99
|
+
ctx.log.info('Metric comparison completed', {
|
|
100
|
+
concept: tag,
|
|
101
|
+
period: input.period,
|
|
102
|
+
totalCompanies: framesResponse.pts,
|
|
103
|
+
returned: data.length,
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
concept: tag,
|
|
107
|
+
period: input.period,
|
|
108
|
+
unit,
|
|
109
|
+
label: framesResponse.label || label,
|
|
110
|
+
total_companies: framesResponse.pts,
|
|
111
|
+
data,
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
format: (result) => {
|
|
115
|
+
const lines = [`**${result.label}** — ${result.period} (${result.total_companies} companies)`];
|
|
116
|
+
for (const d of result.data) {
|
|
117
|
+
const ticker = d.ticker ? ` (${d.ticker})` : '';
|
|
118
|
+
const formatted = result.unit === 'USD'
|
|
119
|
+
? `$${(d.value / 1_000_000_000).toFixed(2)}B`
|
|
120
|
+
: result.unit === 'USD-per-shares'
|
|
121
|
+
? `$${d.value.toFixed(2)}`
|
|
122
|
+
: d.value.toLocaleString();
|
|
123
|
+
lines.push(`${d.rank}. ${d.company_name}${ticker}: ${formatted}`);
|
|
124
|
+
}
|
|
125
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=compare-metric.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-metric.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-metric.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAC/D,WAAW,EACT,mFAAmF;QACnF,8FAA8F;IAChG,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,qEAAqE;YACnE,2DAA2D,CAC9D;QACH,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CACP,6BAA6B;YAC3B,sEAAsE;YACtE,iEAAiE;YACjE,2EAA2E;YAC3E,iEAAiE;YACjE,yDAAyD,CAC5D;QACH,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;aACjD,OAAO,CAAC,KA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