@finchagentic/mcp 4.6.1 → 4.6.2

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 (58) hide show
  1. package/package.json +5 -6
  2. package/dist/_http-cache.js +0 -96
  3. package/dist/_text-search.js +0 -39
  4. package/dist/agent-loop.js +0 -301
  5. package/dist/annotations.js +0 -122
  6. package/dist/cli.js +0 -1391
  7. package/dist/clink-input.js +0 -15
  8. package/dist/config.js +0 -132
  9. package/dist/convex.js +0 -175
  10. package/dist/dex-pair.js +0 -54
  11. package/dist/enrichment-router.js +0 -315
  12. package/dist/index.js +0 -258
  13. package/dist/llm.js +0 -298
  14. package/dist/local-memory-file.js +0 -150
  15. package/dist/local-memory.js +0 -135
  16. package/dist/local-vault.js +0 -456
  17. package/dist/output-schemas.js +0 -605
  18. package/dist/project.js +0 -36
  19. package/dist/prompts.js +0 -111
  20. package/dist/public-url.js +0 -107
  21. package/dist/resources.js +0 -111
  22. package/dist/server.js +0 -322
  23. package/dist/signal-gate.js +0 -57
  24. package/dist/token-decimals.js +0 -26
  25. package/dist/token-gate.js +0 -88
  26. package/dist/tool-filter.js +0 -53
  27. package/dist/tools/_solidity-scan.js +0 -313
  28. package/dist/tools/agents.js +0 -441
  29. package/dist/tools/automation.js +0 -354
  30. package/dist/tools/base-mcp.js +0 -466
  31. package/dist/tools/base.js +0 -283
  32. package/dist/tools/chronicle.js +0 -268
  33. package/dist/tools/coder.js +0 -94
  34. package/dist/tools/deep-research.js +0 -1421
  35. package/dist/tools/defi.js +0 -292
  36. package/dist/tools/equity.js +0 -372
  37. package/dist/tools/events.js +0 -182
  38. package/dist/tools/github.js +0 -564
  39. package/dist/tools/insider.js +0 -264
  40. package/dist/tools/insight.js +0 -630
  41. package/dist/tools/market.js +0 -555
  42. package/dist/tools/memory.js +0 -1059
  43. package/dist/tools/miroshark.js +0 -350
  44. package/dist/tools/monitor.js +0 -319
  45. package/dist/tools/os.js +0 -236
  46. package/dist/tools/packets.js +0 -296
  47. package/dist/tools/research-chain.js +0 -226
  48. package/dist/tools/research-compare.js +0 -280
  49. package/dist/tools/research.js +0 -188
  50. package/dist/tools/rh-bridge.js +0 -148
  51. package/dist/tools/rh-mcp.js +0 -1448
  52. package/dist/tools/rh-orders.js +0 -556
  53. package/dist/tools/scanner.js +0 -564
  54. package/dist/tools/stake.js +0 -369
  55. package/dist/tools/vault.js +0 -1020
  56. package/dist/tools/wallet.js +0 -200
  57. package/dist/types.js +0 -2
  58. package/dist/wallet.js +0 -372
@@ -1,182 +0,0 @@
1
- "use strict";
2
- // Material events from SEC Form 8-K.
3
- //
4
- // Companies must file an 8-K within four business days of a material event, and
5
- // each one is tagged with standardised item codes. The codes are where the
6
- // signal lives — and where it hides, because "Item 5.02" means nothing to a
7
- // reader who has not memorised the schedule. This decodes them.
8
- //
9
- // The item codes come straight from the submissions index, so building a
10
- // timeline costs one request rather than one per filing.
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EVENT_TOOLS = void 0;
13
- exports.buildStockEvents = buildStockEvents;
14
- exports.handleEventTool = handleEventTool;
15
- const zod_1 = require("zod");
16
- const SEC_UA = "Finch MCP research (contact: support@finchagentic.com)";
17
- /** 8-K item codes. `signal` marks the ones that usually move a thesis. */
18
- const ITEMS = {
19
- "1.01": { label: "Entered a material agreement", signal: true },
20
- "1.02": { label: "Terminated a material agreement", signal: true },
21
- "1.03": { label: "Bankruptcy or receivership", signal: true },
22
- "2.01": { label: "Completed an acquisition or disposal of assets", signal: true },
23
- "2.02": { label: "Results of operations — earnings release", signal: true },
24
- "2.03": { label: "Took on debt or an off-balance-sheet obligation", signal: true },
25
- "2.04": { label: "Debt acceleration or default triggered", signal: true },
26
- "2.05": { label: "Restructuring / exit costs (often layoffs or closures)", signal: true },
27
- "2.06": { label: "Material impairment (asset written down)", signal: true },
28
- "3.01": { label: "Delisting notice or listing-rule failure", signal: true },
29
- "3.02": { label: "Unregistered equity sale — dilution", signal: true },
30
- "3.03": { label: "Material change to shareholder rights", signal: true },
31
- "4.01": { label: "Changed auditors", signal: true },
32
- "4.02": { label: "Prior financials no longer reliable — restatement", signal: true },
33
- "5.01": { label: "Change in control of the company", signal: true },
34
- "5.02": { label: "Executive or director appointed, departed, or compensated", signal: true },
35
- "5.03": { label: "Amended charter or bylaws / changed fiscal year", signal: false },
36
- "5.05": { label: "Amended the code of ethics", signal: false },
37
- "5.07": { label: "Shareholder vote results", signal: false },
38
- "7.01": { label: "Regulation FD disclosure (investor-facing statement)", signal: false },
39
- "8.01": { label: "Other events the company chose to report", signal: false },
40
- "9.01": { label: "Exhibits attached (accompanies other items)", signal: false },
41
- };
42
- exports.EVENT_TOOLS = [
43
- {
44
- name: "stock_events",
45
- description: "Timeline of a US company's material events from SEC Form 8-K, with the item codes decoded " +
46
- "into plain language — earnings releases, executive departures, debt raises, dilution, " +
47
- "restatements, impairments, layoffs. Companies must file within four business days, so this " +
48
- "is the fastest authoritative record of what actually happened. No API key needed.",
49
- inputSchema: {
50
- type: "object",
51
- properties: {
52
- ticker: { type: "string", description: "US ticker symbol, e.g. 'HOOD', 'NVDA'" },
53
- limit: { type: "number", description: "How many recent 8-K filings (default 15, max 40)" },
54
- signalOnly: {
55
- type: "boolean",
56
- description: "Only show filings carrying a thesis-relevant item (skips routine votes/exhibits)",
57
- },
58
- },
59
- required: ["ticker"],
60
- },
61
- },
62
- ];
63
- const Schema = zod_1.z.object({
64
- ticker: zod_1.z.string().min(1).max(10),
65
- limit: zod_1.z.number().int().min(1).max(40).optional(),
66
- signalOnly: zod_1.z.boolean().optional(),
67
- });
68
- // Pure map to the stock_events structuredContent payload.
69
- function buildStockEvents(ticker, companyName, signalOnly, events) {
70
- return {
71
- ticker,
72
- companyName,
73
- signalOnly,
74
- count: events.length,
75
- events: events.map((e) => ({
76
- filingDate: e.date,
77
- reportDate: e.reportDate ?? null,
78
- codes: e.codes,
79
- hasSignal: e.hasSignal,
80
- url: e.url,
81
- })),
82
- };
83
- }
84
- async function secFetch(url) {
85
- try {
86
- const res = await fetch(url, { headers: { "User-Agent": SEC_UA }, signal: AbortSignal.timeout(20000) });
87
- if (!res.ok)
88
- return null;
89
- return await res.text();
90
- }
91
- catch {
92
- return null;
93
- }
94
- }
95
- async function handleEventTool(name, args) {
96
- if (name !== "stock_events")
97
- return null;
98
- const parsed = Schema.safeParse(args);
99
- if (!parsed.success) {
100
- return { content: [{ type: "text", text: `${parsed.error.issues[0].message}` }], isError: true };
101
- }
102
- const ticker = parsed.data.ticker.trim().toUpperCase();
103
- const limit = parsed.data.limit ?? 15;
104
- const signalOnly = parsed.data.signalOnly === true;
105
- const tickersRaw = await secFetch("https://www.sec.gov/files/company_tickers.json");
106
- if (!tickersRaw) {
107
- return { content: [{ type: "text", text: "SEC ticker index unavailable — try again shortly." }], isError: true };
108
- }
109
- const hit = Object.values(JSON.parse(tickersRaw)).find((x) => String(x.ticker).toUpperCase() === ticker);
110
- if (!hit) {
111
- return {
112
- content: [{ type: "text", text: `No SEC filer found for **${ticker}**. US-listed SEC filers only.` }],
113
- isError: true,
114
- };
115
- }
116
- const cik = String(hit.cik_str).padStart(10, "0");
117
- const subsRaw = await secFetch(`https://data.sec.gov/submissions/CIK${cik}.json`);
118
- if (!subsRaw) {
119
- return { content: [{ type: "text", text: `Could not load SEC filings for ${ticker}.` }], isError: true };
120
- }
121
- const subs = JSON.parse(subsRaw);
122
- const r = subs.filings?.recent;
123
- if (!r?.form) {
124
- return { content: [{ type: "text", text: `No filing index for ${ticker}.` }], isError: true };
125
- }
126
- const events = [];
127
- const cikNum = String(Number(cik));
128
- for (let i = 0; i < r.form.length && events.length < limit; i++) {
129
- if (r.form[i] !== "8-K")
130
- continue;
131
- const codes = String(r.items?.[i] ?? "")
132
- .split(",")
133
- .map((c) => c.trim())
134
- .filter(Boolean);
135
- const hasSignal = codes.some((c) => ITEMS[c]?.signal);
136
- if (signalOnly && !hasSignal)
137
- continue;
138
- const acc = String(r.accessionNumber[i]).replace(/-/g, "");
139
- events.push({
140
- date: r.filingDate[i],
141
- reportDate: r.reportDate?.[i],
142
- codes,
143
- url: `https://www.sec.gov/Archives/edgar/data/${cikNum}/${acc}/${r.primaryDocument[i]}`,
144
- hasSignal,
145
- });
146
- }
147
- if (!events.length) {
148
- return {
149
- content: [{
150
- type: "text",
151
- text: `# ${subs.name} (${ticker}) — material events\n\n` +
152
- (signalOnly
153
- ? `No 8-K filings with thesis-relevant items in the recent window. Re-run without \`signalOnly\` to see routine filings.`
154
- : `No 8-K filings found.`),
155
- }],
156
- structuredContent: buildStockEvents(ticker, subs.name ?? null, !!signalOnly, events),
157
- };
158
- }
159
- const lines = [
160
- `# ${subs.name} (${ticker}) — material events`,
161
- ``,
162
- `**${events.length}** Form 8-K filing(s) from SEC EDGAR${signalOnly ? " (thesis-relevant only)" : ""}. ` +
163
- `Companies must file within four business days of the event.`,
164
- ``,
165
- ];
166
- for (const e of events) {
167
- const decoded = e.codes.map((c) => ({ code: c, ...(ITEMS[c] ?? { label: "Unclassified item", signal: false }) }));
168
- const headline = decoded.find((d) => d.signal) ?? decoded[0];
169
- lines.push(`### ${e.hasSignal ? "🔔" : "▫️"} ${e.date}${e.reportDate && e.reportDate !== e.date ? ` _(event ${e.reportDate})_` : ""}`, `**${headline?.label ?? "8-K filed"}**`, ...decoded
170
- .filter((d) => d !== headline)
171
- .map((d) => `- ${d.signal ? "🔔 " : ""}Item ${d.code} — ${d.label}`), `${e.url}`, ``);
172
- }
173
- lines.push(`---`, ``, `## How to read this`, ``, `- 🔔 marks items that usually move a thesis. ▫️ items (shareholder votes, exhibit lists, ` +
174
- `Reg FD statements) are filed constantly and are mostly noise.`, `- **Item 5.02 is ambiguous by design** — it covers a resignation, a firing, a new hire and a ` +
175
- `pay change with the same code. Open the filing before concluding which one it was.`, `- **4.02 is the loudest code here**: prior financial statements can no longer be relied on. ` +
176
- `Treat any fundamentals you already pulled as suspect until the restatement lands.`, `- An 8-K states that something happened, not whether it was good. The filing text carries the ` +
177
- `detail; the item code only tells you where to look.`, ``, `_Source: SEC EDGAR Form 8-K. Not investment advice._`);
178
- return {
179
- content: [{ type: "text", text: lines.join("\n") }],
180
- structuredContent: buildStockEvents(ticker, subs.name ?? null, !!signalOnly, events),
181
- };
182
- }