fmp-ai-tools 0.0.1-1.beta.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.
@@ -0,0 +1,687 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+ var fmpNodeApi = require('fmp-node-api');
5
+ var ai = require('ai');
6
+
7
+ // src/providers/vercel-ai/quote.ts
8
+ function getFMPClient() {
9
+ return new fmpNodeApi.FMP();
10
+ }
11
+
12
+ // src/utils/logger.ts
13
+ function isApiLoggingEnabled() {
14
+ return process.env.FMP_TOOLS_LOG_API_RESULTS === "true";
15
+ }
16
+ function isDataOnlyLoggingEnabled() {
17
+ return process.env.FMP_TOOLS_LOG_DATA_ONLY === "true";
18
+ }
19
+ function estimateTokenCount(text) {
20
+ try {
21
+ const parsed = JSON.parse(text);
22
+ return estimateTokenCountForData(parsed);
23
+ } catch {
24
+ return estimateTokenCountForText(text);
25
+ }
26
+ }
27
+ function estimateTokenCountForData(data) {
28
+ if (data === null || data === void 0) {
29
+ return 1;
30
+ }
31
+ if (typeof data === "string") {
32
+ return Math.ceil(data.length / 3);
33
+ }
34
+ if (typeof data === "number") {
35
+ return data.toString().length > 10 ? 2 : 1;
36
+ }
37
+ if (typeof data === "boolean") {
38
+ return 1;
39
+ }
40
+ if (Array.isArray(data)) {
41
+ let tokens = 2;
42
+ for (const item of data) {
43
+ tokens += estimateTokenCountForData(item);
44
+ if (data.indexOf(item) < data.length - 1) {
45
+ tokens += 1;
46
+ }
47
+ }
48
+ return tokens;
49
+ }
50
+ if (typeof data === "object") {
51
+ let tokens = 2;
52
+ const keys = Object.keys(data);
53
+ for (let i = 0; i < keys.length; i++) {
54
+ const key = keys[i];
55
+ const value = data[key];
56
+ tokens += Math.ceil(key.length / 3);
57
+ tokens += 2;
58
+ tokens += 1;
59
+ tokens += estimateTokenCountForData(value);
60
+ if (i < keys.length - 1) {
61
+ tokens += 1;
62
+ }
63
+ }
64
+ return tokens;
65
+ }
66
+ return 1;
67
+ }
68
+ function estimateTokenCountForText(text) {
69
+ const words = text.split(/\s+/).filter((word) => word.length > 0);
70
+ let tokens = 0;
71
+ for (const word of words) {
72
+ if (/^\d+$/.test(word)) {
73
+ tokens += word.length > 8 ? 2 : 1;
74
+ } else if (/^[A-Z]+$/.test(word)) {
75
+ tokens += 1;
76
+ } else if (/^\$[\d,]+\.?\d*$/.test(word)) {
77
+ tokens += 3;
78
+ } else {
79
+ tokens += Math.ceil(word.length / 3.5);
80
+ }
81
+ }
82
+ return tokens;
83
+ }
84
+ function getResultInfo(result) {
85
+ if (result === null || result === void 0) {
86
+ return "null/undefined";
87
+ }
88
+ if (typeof result === "string") {
89
+ const tokenCount = estimateTokenCount(result);
90
+ try {
91
+ const parsed = JSON.parse(result);
92
+ if (Array.isArray(parsed)) {
93
+ return `JSON string (array of ${parsed.length} items, ~${tokenCount} tokens)`;
94
+ }
95
+ } catch {
96
+ }
97
+ return `string (${result.length} chars, ~${tokenCount} tokens)`;
98
+ }
99
+ if (Array.isArray(result)) {
100
+ const jsonStr = JSON.stringify(result);
101
+ const tokenCount = estimateTokenCount(jsonStr);
102
+ return `array (${result.length} items, ~${tokenCount} tokens)`;
103
+ }
104
+ if (typeof result === "object") {
105
+ const jsonStr = JSON.stringify(result);
106
+ const tokenCount = estimateTokenCount(jsonStr);
107
+ return `object (~${tokenCount} tokens)`;
108
+ }
109
+ return typeof result;
110
+ }
111
+ function logApiExecution(options) {
112
+ if (!isApiLoggingEnabled()) {
113
+ return;
114
+ }
115
+ const { toolName, input, result, executionTime } = options;
116
+ console.log("\n" + "=".repeat(80));
117
+ console.log(`\u{1F527} FMP Tool Execution: ${toolName}`);
118
+ console.log("=".repeat(80));
119
+ console.log("\n\u{1F4E5} Input:");
120
+ console.log(JSON.stringify(input, null, 2));
121
+ const resultInfo = getResultInfo(result);
122
+ console.log(`\u{1F527} ${toolName}: ${resultInfo}`);
123
+ if (executionTime !== void 0) {
124
+ console.log(`
125
+ \u23F1\uFE0F Execution Time: ${executionTime}ms`);
126
+ }
127
+ console.log("=".repeat(80) + "\n");
128
+ }
129
+ function logDataOnly(options) {
130
+ if (!isDataOnlyLoggingEnabled()) {
131
+ return;
132
+ }
133
+ const { result } = options;
134
+ console.log("\n\u{1F4E4} Result:");
135
+ if (typeof result === "string") {
136
+ try {
137
+ const parsed = JSON.parse(result);
138
+ console.log(JSON.stringify(parsed, null, 2));
139
+ } catch {
140
+ console.log(result);
141
+ }
142
+ } else {
143
+ console.log(JSON.stringify(result, null, 2));
144
+ }
145
+ console.log("=".repeat(80) + "\n");
146
+ }
147
+ async function logApiExecutionWithTiming(toolName, input, executeFn) {
148
+ const startTime = Date.now();
149
+ try {
150
+ const result = await executeFn();
151
+ const executionTime = Date.now() - startTime;
152
+ logApiExecution({
153
+ toolName,
154
+ input,
155
+ result,
156
+ executionTime
157
+ });
158
+ logDataOnly({
159
+ toolName,
160
+ input,
161
+ result,
162
+ executionTime
163
+ });
164
+ return result;
165
+ } catch (error) {
166
+ const executionTime = Date.now() - startTime;
167
+ if (isApiLoggingEnabled()) {
168
+ console.log("\n" + "=".repeat(80));
169
+ console.log(`\u274C FMP Tool Execution Error: ${toolName}`);
170
+ console.log("=".repeat(80));
171
+ console.log("\n\u{1F4E5} Input:");
172
+ console.log(JSON.stringify(input, null, 2));
173
+ console.log("\n\u274C Error:");
174
+ console.log(error instanceof Error ? error.message : String(error));
175
+ console.log(`
176
+ \u23F1\uFE0F Execution Time: ${executionTime}ms`);
177
+ console.log("=".repeat(80) + "\n");
178
+ }
179
+ throw error;
180
+ }
181
+ }
182
+
183
+ // src/utils/aisdk-tool-wrapper.ts
184
+ function createTool(config) {
185
+ const { name, description, inputSchema, execute } = config;
186
+ return ai.tool({
187
+ name,
188
+ description,
189
+ inputSchema,
190
+ execute: async (args) => {
191
+ return await logApiExecutionWithTiming(name, args, () => execute(args));
192
+ }
193
+ });
194
+ }
195
+
196
+ // src/providers/vercel-ai/quote.ts
197
+ var quoteTools = {
198
+ getStockQuote: createTool({
199
+ name: "getStockQuote",
200
+ description: "Get the stock quote for a company",
201
+ inputSchema: zod.z.object({
202
+ symbol: zod.z.string().describe("The symbol of the company to get the stock quote for")
203
+ }),
204
+ execute: async ({ symbol }) => {
205
+ const fmp = getFMPClient();
206
+ const stockQuote = await fmp.quote.getQuote(symbol);
207
+ const response = JSON.stringify(stockQuote.data, null, 2);
208
+ return response;
209
+ }
210
+ })
211
+ };
212
+ var companyTools = {
213
+ getCompanyProfile: createTool({
214
+ name: "getCompanyProfile",
215
+ description: "Get the company profile",
216
+ inputSchema: zod.z.object({
217
+ symbol: zod.z.string().describe("The stock ticker symbol (e.g., AAPL)")
218
+ }),
219
+ execute: async ({ symbol }) => {
220
+ const fmp = getFMPClient();
221
+ const companyProfile = await fmp.company.getCompanyProfile(symbol);
222
+ const response = JSON.stringify(companyProfile.data, null, 2);
223
+ return response;
224
+ }
225
+ })
226
+ };
227
+ var financialTools = {
228
+ getBalanceSheet: createTool({
229
+ name: "getBalanceSheet",
230
+ description: "Get balance sheet for a company",
231
+ inputSchema: zod.z.object({
232
+ symbol: zod.z.string().describe("The stock symbol to get balance sheet for"),
233
+ period: zod.z.enum(["annual", "quarter"]).default("annual").describe("The period type (annual or quarter)")
234
+ }),
235
+ execute: async ({ symbol, period }) => {
236
+ const fmp = getFMPClient();
237
+ const balanceSheet = await fmp.financial.getBalanceSheet({ symbol, period });
238
+ const response = JSON.stringify(balanceSheet.data, null, 2);
239
+ return response;
240
+ }
241
+ }),
242
+ getIncomeStatement: createTool({
243
+ name: "getIncomeStatement",
244
+ description: "Get income statement for a company",
245
+ inputSchema: zod.z.object({
246
+ symbol: zod.z.string().describe("The stock symbol to get income statement for"),
247
+ period: zod.z.enum(["annual", "quarter"]).default("annual").describe("The period type (annual or quarter)")
248
+ }),
249
+ execute: async ({ symbol, period }) => {
250
+ const fmp = getFMPClient();
251
+ const incomeStatement = await fmp.financial.getIncomeStatement({ symbol, period });
252
+ const response = JSON.stringify(incomeStatement.data, null, 2);
253
+ return response;
254
+ }
255
+ }),
256
+ getCashFlowStatement: createTool({
257
+ name: "getCashFlowStatement",
258
+ description: "Get cash flow statement for a company",
259
+ inputSchema: zod.z.object({
260
+ symbol: zod.z.string().describe("The stock symbol to get cash flow statement for"),
261
+ period: zod.z.enum(["annual", "quarter"]).default("annual").describe("The period type (annual or quarter)")
262
+ }),
263
+ execute: async ({ symbol, period }) => {
264
+ const fmp = getFMPClient();
265
+ const cashFlowStatement = await fmp.financial.getCashFlowStatement({ symbol, period });
266
+ const response = JSON.stringify(cashFlowStatement.data, null, 2);
267
+ return response;
268
+ }
269
+ }),
270
+ getFinancialRatios: createTool({
271
+ name: "getFinancialRatios",
272
+ description: "Get financial ratios for a company",
273
+ inputSchema: zod.z.object({
274
+ symbol: zod.z.string().describe("The stock symbol to get financial ratios for"),
275
+ period: zod.z.enum(["annual", "quarter"]).default("annual").describe("The period type (annual or quarter)")
276
+ }),
277
+ execute: async ({ symbol, period }) => {
278
+ const fmp = getFMPClient();
279
+ const financialRatios = await fmp.financial.getFinancialRatios({ symbol, period });
280
+ const response = JSON.stringify(financialRatios.data, null, 2);
281
+ return response;
282
+ }
283
+ })
284
+ };
285
+ var calendarTools = {
286
+ getEarningsCalendar: createTool({
287
+ name: "getEarningsCalendar",
288
+ description: "Get earnings calendar",
289
+ inputSchema: zod.z.object({
290
+ from: zod.z.string().optional().describe("Start date in YYYY-MM-DD format"),
291
+ to: zod.z.string().optional().describe("End date in YYYY-MM-DD format")
292
+ }),
293
+ execute: async ({ from, to }) => {
294
+ const fmp = getFMPClient();
295
+ const earningsCalendar = await fmp.calendar.getEarningsCalendar({ from, to });
296
+ const response = JSON.stringify(earningsCalendar.data, null, 2);
297
+ return response;
298
+ }
299
+ }),
300
+ getEconomicCalendar: createTool({
301
+ name: "getEconomicCalendar",
302
+ description: "Get economic calendar",
303
+ inputSchema: zod.z.object({
304
+ from: zod.z.string().optional().describe("Start date in YYYY-MM-DD format"),
305
+ to: zod.z.string().optional().describe("End date in YYYY-MM-DD format")
306
+ }),
307
+ execute: async ({ from, to }) => {
308
+ const fmp = getFMPClient();
309
+ const economicCalendar = await fmp.calendar.getEconomicsCalendar({ from, to });
310
+ const response = JSON.stringify(economicCalendar.data, null, 2);
311
+ return response;
312
+ }
313
+ })
314
+ };
315
+ var economicTools = {
316
+ getTreasuryRates: createTool({
317
+ name: "getTreasuryRates",
318
+ description: "Get treasury rates",
319
+ inputSchema: zod.z.object({
320
+ from: zod.z.string().optional().describe("Start date in YYYY-MM-DD format"),
321
+ to: zod.z.string().optional().describe("End date in YYYY-MM-DD format")
322
+ }),
323
+ execute: async ({ from, to }) => {
324
+ const fmp = getFMPClient();
325
+ const treasuryRates = await fmp.economic.getTreasuryRates({ from, to });
326
+ const response = JSON.stringify(treasuryRates.data, null, 2);
327
+ return response;
328
+ }
329
+ }),
330
+ getEconomicIndicators: createTool({
331
+ name: "getEconomicIndicators",
332
+ description: "Get economic indicators",
333
+ inputSchema: zod.z.object({
334
+ name: zod.z.enum([
335
+ "GDP",
336
+ "realGDP",
337
+ "nominalPotentialGDP",
338
+ "realGDPPerCapita",
339
+ "federalFunds",
340
+ "CPI",
341
+ "inflationRate",
342
+ "inflation",
343
+ "retailSales",
344
+ "consumerSentiment",
345
+ "durableGoods",
346
+ "unemploymentRate",
347
+ "totalNonfarmPayroll",
348
+ "initialClaims",
349
+ "industrialProductionTotalIndex",
350
+ "newPrivatelyOwnedHousingUnitsStartedTotalUnits",
351
+ "totalVehicleSales",
352
+ "retailMoneyFunds",
353
+ "smoothedUSRecessionProbabilities",
354
+ "3MonthOr90DayRatesAndYieldsCertificatesOfDeposit",
355
+ "commercialBankInterestRateOnCreditCardPlansAllAccounts",
356
+ "30YearFixedRateMortgageAverage",
357
+ "15YearFixedRateMortgageAverage"
358
+ ]).describe("The name of the economic indicator"),
359
+ from: zod.z.string().optional().describe("Start date in YYYY-MM-DD format"),
360
+ to: zod.z.string().optional().describe("End date in YYYY-MM-DD format")
361
+ }),
362
+ execute: async ({ name, from, to }) => {
363
+ const fmp = getFMPClient();
364
+ const economicIndicators = await fmp.economic.getEconomicIndicators({ name, from, to });
365
+ const response = JSON.stringify(economicIndicators.data, null, 2);
366
+ return response;
367
+ }
368
+ })
369
+ };
370
+ var etfTools = {
371
+ getETFHoldings: createTool({
372
+ name: "getETFHoldings",
373
+ description: "Get ETF holdings for a specific ETF symbol",
374
+ inputSchema: zod.z.object({
375
+ symbol: zod.z.string().describe("ETF symbol (e.g., SPY, QQQ, VTI)"),
376
+ date: zod.z.string().optional().describe("Date for holdings (YYYY-MM-DD format)")
377
+ }),
378
+ execute: async ({ symbol, date }) => {
379
+ const fmp = getFMPClient();
380
+ const params = { symbol };
381
+ if (date) {
382
+ params.date = date;
383
+ }
384
+ const etfHoldings = await fmp.etf.getHoldings(params);
385
+ const response = JSON.stringify(etfHoldings.data, null, 2);
386
+ return response;
387
+ }
388
+ }),
389
+ getETFProfile: createTool({
390
+ name: "getETFProfile",
391
+ description: "Get ETF profile information",
392
+ inputSchema: zod.z.object({
393
+ symbol: zod.z.string().describe("ETF symbol (e.g., SPY, QQQ, VTI)")
394
+ }),
395
+ execute: async ({ symbol }) => {
396
+ const fmp = getFMPClient();
397
+ const etfProfile = await fmp.etf.getProfile(symbol);
398
+ const response = JSON.stringify(etfProfile.data, null, 2);
399
+ return response;
400
+ }
401
+ })
402
+ };
403
+ var insiderTools = {
404
+ getInsiderTrading: createTool({
405
+ name: "getInsiderTrading",
406
+ description: "Get insider trading data for a specific stock symbol",
407
+ inputSchema: zod.z.object({
408
+ symbol: zod.z.string().describe("Stock symbol (e.g., AAPL, MSFT, GOOGL)"),
409
+ page: zod.z.number().default(0).describe("Page number for pagination")
410
+ }),
411
+ execute: async ({ symbol, page }) => {
412
+ const fmp = getFMPClient();
413
+ const insiderTrading = await fmp.insider.getInsiderTradesBySymbol(symbol, page);
414
+ const response = JSON.stringify(insiderTrading.data, null, 2);
415
+ return response;
416
+ }
417
+ })
418
+ };
419
+ var institutionalTools = {
420
+ getInstitutionalHolders: createTool({
421
+ name: "getInstitutionalHolders",
422
+ description: "Get institutional holders for a specific stock symbol",
423
+ inputSchema: zod.z.object({
424
+ symbol: zod.z.string().describe("Stock symbol (e.g., AAPL, MSFT, GOOGL)")
425
+ }),
426
+ execute: async ({ symbol }) => {
427
+ const fmp = getFMPClient();
428
+ const institutionalHolders = await fmp.institutional.getInstitutionalHolders({ symbol });
429
+ const response = JSON.stringify(institutionalHolders.data, null, 2);
430
+ return response;
431
+ }
432
+ })
433
+ };
434
+ var marketTools = {
435
+ getMarketPerformance: createTool({
436
+ name: "getMarketPerformance",
437
+ description: "Get overall market performance data",
438
+ inputSchema: zod.z.object({}),
439
+ execute: async () => {
440
+ const fmp = getFMPClient();
441
+ const marketPerformance = await fmp.market.getMarketPerformance();
442
+ const response = JSON.stringify(marketPerformance.data, null, 2);
443
+ return response;
444
+ }
445
+ }),
446
+ getSectorPerformance: createTool({
447
+ name: "getSectorPerformance",
448
+ description: "Get sector performance data",
449
+ inputSchema: zod.z.object({}),
450
+ execute: async () => {
451
+ const fmp = getFMPClient();
452
+ const sectorPerformance = await fmp.market.getSectorPerformance();
453
+ const response = JSON.stringify(sectorPerformance.data, null, 2);
454
+ return response;
455
+ }
456
+ }),
457
+ getGainers: createTool({
458
+ name: "getGainers",
459
+ description: "Get top gaining stocks",
460
+ inputSchema: zod.z.object({}),
461
+ execute: async () => {
462
+ const fmp = getFMPClient();
463
+ const gainers = await fmp.market.getGainers();
464
+ const response = JSON.stringify(gainers.data, null, 2);
465
+ return response;
466
+ }
467
+ }),
468
+ getLosers: createTool({
469
+ name: "getLosers",
470
+ description: "Get top losing stocks",
471
+ inputSchema: zod.z.object({}),
472
+ execute: async () => {
473
+ const fmp = getFMPClient();
474
+ const losers = await fmp.market.getLosers();
475
+ const response = JSON.stringify(losers.data, null, 2);
476
+ return response;
477
+ }
478
+ }),
479
+ getMostActive: createTool({
480
+ name: "getMostActive",
481
+ description: "Get most active stocks",
482
+ inputSchema: zod.z.object({}),
483
+ execute: async () => {
484
+ const fmp = getFMPClient();
485
+ const mostActive = await fmp.market.getMostActive();
486
+ const response = JSON.stringify(mostActive.data, null, 2);
487
+ return response;
488
+ }
489
+ })
490
+ };
491
+ var senateHouseTools = {
492
+ getSenateTrading: createTool({
493
+ name: "getSenateTrading",
494
+ description: "Get senate trading data for a specific stock symbol",
495
+ inputSchema: zod.z.object({
496
+ symbol: zod.z.string().describe("Stock symbol (e.g., AAPL, MSFT, GOOGL)")
497
+ }),
498
+ execute: async ({ symbol }) => {
499
+ const fmp = getFMPClient();
500
+ const senateTrading = await fmp.senateHouse.getSenateTrading({ symbol });
501
+ const response = JSON.stringify(senateTrading.data, null, 2);
502
+ return response;
503
+ }
504
+ }),
505
+ getHouseTrading: createTool({
506
+ name: "getHouseTrading",
507
+ description: "Get house trading data for a specific stock symbol",
508
+ inputSchema: zod.z.object({
509
+ symbol: zod.z.string().describe("Stock symbol (e.g., AAPL, MSFT, GOOGL)")
510
+ }),
511
+ execute: async ({ symbol }) => {
512
+ const fmp = getFMPClient();
513
+ const houseTrading = await fmp.senateHouse.getHouseTrading({ symbol });
514
+ const response = JSON.stringify(houseTrading.data, null, 2);
515
+ return response;
516
+ }
517
+ }),
518
+ getSenateTradingByName: createTool({
519
+ name: "getSenateTradingByName",
520
+ description: "Get senate trading data for a specific senator by name",
521
+ inputSchema: zod.z.object({
522
+ name: zod.z.string().describe("The name of the senator to get trading data for")
523
+ }),
524
+ execute: async ({ name }) => {
525
+ const fmp = getFMPClient();
526
+ const senateTradingByName = await fmp.senateHouse.getSenateTradingByName({ name });
527
+ const response = JSON.stringify(senateTradingByName.data, null, 2);
528
+ return response;
529
+ }
530
+ }),
531
+ getHouseTradingByName: createTool({
532
+ name: "getHouseTradingByName",
533
+ description: "Get house trading data for a specific representative by name",
534
+ inputSchema: zod.z.object({
535
+ name: zod.z.string().describe("The name of the representative to get trading data for")
536
+ }),
537
+ execute: async ({ name }) => {
538
+ const fmp = getFMPClient();
539
+ const houseTradingByName = await fmp.senateHouse.getHouseTradingByName({ name });
540
+ const response = JSON.stringify(houseTradingByName.data, null, 2);
541
+ return response;
542
+ }
543
+ }),
544
+ getSenateTradingRSSFeed: createTool({
545
+ name: "getSenateTradingRSSFeed",
546
+ description: "Get senate trading data through RSS feed with pagination",
547
+ inputSchema: zod.z.object({
548
+ page: zod.z.number().default(0).describe("Page number for pagination")
549
+ }),
550
+ execute: async ({ page = 0 }) => {
551
+ const fmp = getFMPClient();
552
+ const senateTradingRSSFeed = await fmp.senateHouse.getSenateTradingRSSFeed({ page });
553
+ const response = JSON.stringify(senateTradingRSSFeed.data, null, 2);
554
+ return response;
555
+ }
556
+ }),
557
+ getHouseTradingRSSFeed: createTool({
558
+ name: "getHouseTradingRSSFeed",
559
+ description: "Get house trading data through RSS feed with pagination",
560
+ inputSchema: zod.z.object({
561
+ page: zod.z.number().default(0).describe("Page number for pagination")
562
+ }),
563
+ execute: async ({ page = 0 }) => {
564
+ const fmp = getFMPClient();
565
+ const houseTradingRSSFeed = await fmp.senateHouse.getHouseTradingRSSFeed({ page });
566
+ const response = JSON.stringify(houseTradingRSSFeed.data, null, 2);
567
+ return response;
568
+ }
569
+ })
570
+ };
571
+ var stockTools = {
572
+ getMarketCap: createTool({
573
+ name: "getMarketCap",
574
+ description: "Get market capitalization for a company",
575
+ inputSchema: zod.z.object({
576
+ symbol: zod.z.string().describe("The stock symbol to get market cap for")
577
+ }),
578
+ execute: async ({ symbol }) => {
579
+ const fmp = getFMPClient();
580
+ const marketCap = await fmp.stock.getMarketCap(symbol);
581
+ const response = JSON.stringify(marketCap.data, null, 2);
582
+ return response;
583
+ }
584
+ }),
585
+ getStockSplits: createTool({
586
+ name: "getStockSplits",
587
+ description: "Get stock splits history for a company",
588
+ inputSchema: zod.z.object({
589
+ symbol: zod.z.string().describe("The stock symbol to get stock splits for")
590
+ }),
591
+ execute: async ({ symbol }) => {
592
+ const fmp = getFMPClient();
593
+ const stockSplits = await fmp.stock.getStockSplits(symbol);
594
+ const response = JSON.stringify(stockSplits.data, null, 2);
595
+ return response;
596
+ }
597
+ }),
598
+ getDividendHistory: createTool({
599
+ name: "getDividendHistory",
600
+ description: "Get dividend history for a company",
601
+ inputSchema: zod.z.object({
602
+ symbol: zod.z.string().describe("The stock symbol to get dividend history for")
603
+ }),
604
+ execute: async ({ symbol }) => {
605
+ const fmp = getFMPClient();
606
+ const dividendHistory = await fmp.stock.getDividendHistory(symbol);
607
+ const response = JSON.stringify(dividendHistory.data, null, 2);
608
+ return response;
609
+ }
610
+ })
611
+ };
612
+
613
+ // src/providers/vercel-ai/index.ts
614
+ var { getCompanyProfile } = companyTools;
615
+ var { getEarningsCalendar, getEconomicCalendar } = calendarTools;
616
+ var { getTreasuryRates, getEconomicIndicators } = economicTools;
617
+ var { getETFHoldings, getETFProfile } = etfTools;
618
+ var { getBalanceSheet, getIncomeStatement, getCashFlowStatement, getFinancialRatios } = financialTools;
619
+ var { getInsiderTrading } = insiderTools;
620
+ var { getInstitutionalHolders } = institutionalTools;
621
+ var { getMarketPerformance, getSectorPerformance, getGainers, getLosers, getMostActive } = marketTools;
622
+ var { getStockQuote } = quoteTools;
623
+ var {
624
+ getSenateTrading,
625
+ getHouseTrading,
626
+ getSenateTradingByName,
627
+ getHouseTradingByName,
628
+ getSenateTradingRSSFeed,
629
+ getHouseTradingRSSFeed
630
+ } = senateHouseTools;
631
+ var { getMarketCap, getStockSplits, getDividendHistory } = stockTools;
632
+ var fmpTools = {
633
+ ...quoteTools,
634
+ ...companyTools,
635
+ ...financialTools,
636
+ ...calendarTools,
637
+ ...economicTools,
638
+ ...etfTools,
639
+ ...insiderTools,
640
+ ...institutionalTools,
641
+ ...marketTools,
642
+ ...senateHouseTools,
643
+ ...stockTools
644
+ };
645
+
646
+ exports.calendarTools = calendarTools;
647
+ exports.companyTools = companyTools;
648
+ exports.economicTools = economicTools;
649
+ exports.etfTools = etfTools;
650
+ exports.financialTools = financialTools;
651
+ exports.fmpTools = fmpTools;
652
+ exports.getBalanceSheet = getBalanceSheet;
653
+ exports.getCashFlowStatement = getCashFlowStatement;
654
+ exports.getCompanyProfile = getCompanyProfile;
655
+ exports.getDividendHistory = getDividendHistory;
656
+ exports.getETFHoldings = getETFHoldings;
657
+ exports.getETFProfile = getETFProfile;
658
+ exports.getEarningsCalendar = getEarningsCalendar;
659
+ exports.getEconomicCalendar = getEconomicCalendar;
660
+ exports.getEconomicIndicators = getEconomicIndicators;
661
+ exports.getFinancialRatios = getFinancialRatios;
662
+ exports.getGainers = getGainers;
663
+ exports.getHouseTrading = getHouseTrading;
664
+ exports.getHouseTradingByName = getHouseTradingByName;
665
+ exports.getHouseTradingRSSFeed = getHouseTradingRSSFeed;
666
+ exports.getIncomeStatement = getIncomeStatement;
667
+ exports.getInsiderTrading = getInsiderTrading;
668
+ exports.getInstitutionalHolders = getInstitutionalHolders;
669
+ exports.getLosers = getLosers;
670
+ exports.getMarketCap = getMarketCap;
671
+ exports.getMarketPerformance = getMarketPerformance;
672
+ exports.getMostActive = getMostActive;
673
+ exports.getSectorPerformance = getSectorPerformance;
674
+ exports.getSenateTrading = getSenateTrading;
675
+ exports.getSenateTradingByName = getSenateTradingByName;
676
+ exports.getSenateTradingRSSFeed = getSenateTradingRSSFeed;
677
+ exports.getStockQuote = getStockQuote;
678
+ exports.getStockSplits = getStockSplits;
679
+ exports.getTreasuryRates = getTreasuryRates;
680
+ exports.insiderTools = insiderTools;
681
+ exports.institutionalTools = institutionalTools;
682
+ exports.marketTools = marketTools;
683
+ exports.quoteTools = quoteTools;
684
+ exports.senateHouseTools = senateHouseTools;
685
+ exports.stockTools = stockTools;
686
+ //# sourceMappingURL=index.js.map
687
+ //# sourceMappingURL=index.js.map