fmp-ai-tools 0.2.1 → 0.2.3
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/dist/providers/openai/index.d.mts +7 -1
- package/dist/providers/openai/index.d.ts +7 -1
- package/dist/providers/openai/index.js +68 -4
- package/dist/providers/openai/index.js.map +1 -1
- package/dist/providers/openai/index.mjs +63 -5
- package/dist/providers/openai/index.mjs.map +1 -1
- package/dist/providers/vercel-ai/index.d.mts +7 -1
- package/dist/providers/vercel-ai/index.d.ts +7 -1
- package/dist/providers/vercel-ai/index.js +74 -7
- package/dist/providers/vercel-ai/index.js.map +1 -1
- package/dist/providers/vercel-ai/index.mjs +69 -8
- package/dist/providers/vercel-ai/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ export { c as configureFMPClient, r as resetFMPClient } from '../../client-ClF5A
|
|
|
3
3
|
import 'fmp-node-api';
|
|
4
4
|
|
|
5
5
|
declare const getStockQuote: Tool<unknown>;
|
|
6
|
+
declare const getStockQuoteShort: Tool<unknown>;
|
|
6
7
|
declare const getHistoricalPrice: Tool<unknown>;
|
|
7
8
|
declare const getIntraday: Tool<unknown>;
|
|
8
9
|
declare const getCompanyProfile: Tool<unknown>;
|
|
@@ -35,6 +36,7 @@ declare const getInsiderTrading: Tool<unknown>;
|
|
|
35
36
|
declare const getInstitutionalHolders: Tool<unknown>;
|
|
36
37
|
declare const getMarketPerformance: Tool<unknown>;
|
|
37
38
|
declare const getSectorPerformance: Tool<unknown>;
|
|
39
|
+
declare const getIndustryPESnapshot: Tool<unknown>;
|
|
38
40
|
declare const getGainers: Tool<unknown>;
|
|
39
41
|
declare const getLosers: Tool<unknown>;
|
|
40
42
|
declare const getMostActive: Tool<unknown>;
|
|
@@ -58,6 +60,9 @@ declare const getTechnicalIndicator: Tool<unknown>;
|
|
|
58
60
|
declare const getMarketCap: Tool<unknown>;
|
|
59
61
|
declare const getStockSplits: Tool<unknown>;
|
|
60
62
|
declare const getDividendHistory: Tool<unknown>;
|
|
63
|
+
declare const getStockPriceChange: Tool<unknown>;
|
|
64
|
+
declare const getAftermarketTrade: Tool<unknown>;
|
|
65
|
+
declare const getAftermarketQuote: Tool<unknown>;
|
|
61
66
|
declare const quoteTools: Tool<unknown>[];
|
|
62
67
|
declare const companyTools: Tool<unknown>[];
|
|
63
68
|
declare const financialTools: Tool<unknown>[];
|
|
@@ -75,6 +80,7 @@ declare const valuationTools: Tool<unknown>[];
|
|
|
75
80
|
declare const technicalTools: Tool<unknown>[];
|
|
76
81
|
declare const senateHouseTools: Tool<unknown>[];
|
|
77
82
|
declare const stockTools: Tool<unknown>[];
|
|
83
|
+
declare const aftermarketTools: Tool<unknown>[];
|
|
78
84
|
declare const fmpTools: Tool<unknown>[];
|
|
79
85
|
|
|
80
|
-
export { analystTools, calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getAnalystEstimates, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanyRating, getCompanySharesFloat, getDiscountedCashFlow, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getFinancialRatiosTTM, getFinancialScores, getGainers, getGradesConsensus, getHistoricalPrice, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getInsiderTrading, getInstitutionalHolders, getIntraday, getKeyMetrics, getKeyMetricsTTM, getLosers, getMarketCap, getMarketPerformance, getMostActive, getPriceTargetConsensus, getRevenueGeographicSegmentation, getRevenueProductSegmentation, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockGrades, getStockNews, getStockNewsBySymbol, getStockPeers, getStockQuote, getStockSplits, getTechnicalIndicator, getTreasuryRates, insiderTools, institutionalTools, marketTools, newsTools, quoteTools, screenStocks, screenerTools, searchSymbol, searchTools, senateHouseTools, stockTools, technicalTools, valuationTools };
|
|
86
|
+
export { aftermarketTools, analystTools, calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getAftermarketQuote, getAftermarketTrade, getAnalystEstimates, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanyRating, getCompanySharesFloat, getDiscountedCashFlow, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getFinancialRatiosTTM, getFinancialScores, getGainers, getGradesConsensus, getHistoricalPrice, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getIndustryPESnapshot, getInsiderTrading, getInstitutionalHolders, getIntraday, getKeyMetrics, getKeyMetricsTTM, getLosers, getMarketCap, getMarketPerformance, getMostActive, getPriceTargetConsensus, getRevenueGeographicSegmentation, getRevenueProductSegmentation, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockGrades, getStockNews, getStockNewsBySymbol, getStockPeers, getStockPriceChange, getStockQuote, getStockQuoteShort, getStockSplits, getTechnicalIndicator, getTreasuryRates, insiderTools, institutionalTools, marketTools, newsTools, quoteTools, screenStocks, screenerTools, searchSymbol, searchTools, senateHouseTools, stockTools, technicalTools, valuationTools };
|
|
@@ -3,6 +3,7 @@ export { c as configureFMPClient, r as resetFMPClient } from '../../client-ClF5A
|
|
|
3
3
|
import 'fmp-node-api';
|
|
4
4
|
|
|
5
5
|
declare const getStockQuote: Tool<unknown>;
|
|
6
|
+
declare const getStockQuoteShort: Tool<unknown>;
|
|
6
7
|
declare const getHistoricalPrice: Tool<unknown>;
|
|
7
8
|
declare const getIntraday: Tool<unknown>;
|
|
8
9
|
declare const getCompanyProfile: Tool<unknown>;
|
|
@@ -35,6 +36,7 @@ declare const getInsiderTrading: Tool<unknown>;
|
|
|
35
36
|
declare const getInstitutionalHolders: Tool<unknown>;
|
|
36
37
|
declare const getMarketPerformance: Tool<unknown>;
|
|
37
38
|
declare const getSectorPerformance: Tool<unknown>;
|
|
39
|
+
declare const getIndustryPESnapshot: Tool<unknown>;
|
|
38
40
|
declare const getGainers: Tool<unknown>;
|
|
39
41
|
declare const getLosers: Tool<unknown>;
|
|
40
42
|
declare const getMostActive: Tool<unknown>;
|
|
@@ -58,6 +60,9 @@ declare const getTechnicalIndicator: Tool<unknown>;
|
|
|
58
60
|
declare const getMarketCap: Tool<unknown>;
|
|
59
61
|
declare const getStockSplits: Tool<unknown>;
|
|
60
62
|
declare const getDividendHistory: Tool<unknown>;
|
|
63
|
+
declare const getStockPriceChange: Tool<unknown>;
|
|
64
|
+
declare const getAftermarketTrade: Tool<unknown>;
|
|
65
|
+
declare const getAftermarketQuote: Tool<unknown>;
|
|
61
66
|
declare const quoteTools: Tool<unknown>[];
|
|
62
67
|
declare const companyTools: Tool<unknown>[];
|
|
63
68
|
declare const financialTools: Tool<unknown>[];
|
|
@@ -75,6 +80,7 @@ declare const valuationTools: Tool<unknown>[];
|
|
|
75
80
|
declare const technicalTools: Tool<unknown>[];
|
|
76
81
|
declare const senateHouseTools: Tool<unknown>[];
|
|
77
82
|
declare const stockTools: Tool<unknown>[];
|
|
83
|
+
declare const aftermarketTools: Tool<unknown>[];
|
|
78
84
|
declare const fmpTools: Tool<unknown>[];
|
|
79
85
|
|
|
80
|
-
export { analystTools, calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getAnalystEstimates, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanyRating, getCompanySharesFloat, getDiscountedCashFlow, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getFinancialRatiosTTM, getFinancialScores, getGainers, getGradesConsensus, getHistoricalPrice, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getInsiderTrading, getInstitutionalHolders, getIntraday, getKeyMetrics, getKeyMetricsTTM, getLosers, getMarketCap, getMarketPerformance, getMostActive, getPriceTargetConsensus, getRevenueGeographicSegmentation, getRevenueProductSegmentation, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockGrades, getStockNews, getStockNewsBySymbol, getStockPeers, getStockQuote, getStockSplits, getTechnicalIndicator, getTreasuryRates, insiderTools, institutionalTools, marketTools, newsTools, quoteTools, screenStocks, screenerTools, searchSymbol, searchTools, senateHouseTools, stockTools, technicalTools, valuationTools };
|
|
86
|
+
export { aftermarketTools, analystTools, calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getAftermarketQuote, getAftermarketTrade, getAnalystEstimates, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanyRating, getCompanySharesFloat, getDiscountedCashFlow, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getFinancialRatiosTTM, getFinancialScores, getGainers, getGradesConsensus, getHistoricalPrice, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getIndustryPESnapshot, getInsiderTrading, getInstitutionalHolders, getIntraday, getKeyMetrics, getKeyMetricsTTM, getLosers, getMarketCap, getMarketPerformance, getMostActive, getPriceTargetConsensus, getRevenueGeographicSegmentation, getRevenueProductSegmentation, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockGrades, getStockNews, getStockNewsBySymbol, getStockPeers, getStockPriceChange, getStockQuote, getStockQuoteShort, getStockSplits, getTechnicalIndicator, getTreasuryRates, insiderTools, institutionalTools, marketTools, newsTools, quoteTools, screenStocks, screenerTools, searchSymbol, searchTools, senateHouseTools, stockTools, technicalTools, valuationTools };
|
|
@@ -256,6 +256,14 @@ var quoteDefinitions = [
|
|
|
256
256
|
}),
|
|
257
257
|
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().quote.getQuote(symbol2))
|
|
258
258
|
}),
|
|
259
|
+
defineTool({
|
|
260
|
+
name: "getStockQuoteShort",
|
|
261
|
+
description: "Get a short real-time quote (price, change, and volume only) for a symbol. Lighter than the full quote.",
|
|
262
|
+
inputSchema: zod.z.object({
|
|
263
|
+
symbol: zod.z.string().min(1, "Stock symbol is required").describe("The symbol to get the short quote for (e.g., AAPL, BTCUSD, EURUSD)")
|
|
264
|
+
}),
|
|
265
|
+
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().quote.getQuoteShort(symbol2))
|
|
266
|
+
}),
|
|
259
267
|
defineTool({
|
|
260
268
|
name: "getHistoricalPrice",
|
|
261
269
|
description: "Get historical daily prices (open/high/low/close/volume) for a symbol. Returns the most recent `limit` days.",
|
|
@@ -580,6 +588,10 @@ var institutionalDefinitions = [
|
|
|
580
588
|
})
|
|
581
589
|
];
|
|
582
590
|
var empty = zod.z.object({});
|
|
591
|
+
var snapshotDateSchema = zod.z.object({
|
|
592
|
+
date: zod.z.string().min(1).describe("Snapshot date in YYYY-MM-DD format"),
|
|
593
|
+
exchange: zod.z.string().optional().nullable().describe("Optional exchange filter (e.g., NASDAQ, NYSE)")
|
|
594
|
+
});
|
|
583
595
|
var marketDefinitions = [
|
|
584
596
|
defineTool({
|
|
585
597
|
name: "getMarketPerformance",
|
|
@@ -589,9 +601,25 @@ var marketDefinitions = [
|
|
|
589
601
|
}),
|
|
590
602
|
defineTool({
|
|
591
603
|
name: "getSectorPerformance",
|
|
592
|
-
description: "Get sector
|
|
593
|
-
inputSchema:
|
|
594
|
-
execute: async () => toToolResponse(
|
|
604
|
+
description: "Get a sector-performance snapshot for a given date, showing the average change per sector by exchange",
|
|
605
|
+
inputSchema: snapshotDateSchema,
|
|
606
|
+
execute: async ({ date, exchange }) => toToolResponse(
|
|
607
|
+
await getFMPClient().market.getSectorPerformance({
|
|
608
|
+
date,
|
|
609
|
+
exchange: exchange ?? void 0
|
|
610
|
+
})
|
|
611
|
+
)
|
|
612
|
+
}),
|
|
613
|
+
defineTool({
|
|
614
|
+
name: "getIndustryPESnapshot",
|
|
615
|
+
description: "Get an industry P/E snapshot for a given date, showing the average price-to-earnings ratio per industry by exchange",
|
|
616
|
+
inputSchema: snapshotDateSchema,
|
|
617
|
+
execute: async ({ date, exchange }) => toToolResponse(
|
|
618
|
+
await getFMPClient().market.getIndustryPESnapshot({
|
|
619
|
+
date,
|
|
620
|
+
exchange: exchange ?? void 0
|
|
621
|
+
})
|
|
622
|
+
)
|
|
595
623
|
}),
|
|
596
624
|
defineTool({
|
|
597
625
|
name: "getGainers",
|
|
@@ -846,6 +874,29 @@ var stockDefinitions = [
|
|
|
846
874
|
description: "Get dividend history for a company showing all historical dividend payments",
|
|
847
875
|
inputSchema: symbolSchema4,
|
|
848
876
|
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().stock.getDividendHistory(symbol2))
|
|
877
|
+
}),
|
|
878
|
+
defineTool({
|
|
879
|
+
name: "getStockPriceChange",
|
|
880
|
+
description: "Get the percentage price change for a stock across standard horizons (1D, 5D, 1M, 3M, 6M, YTD, 1Y, 3Y, 5Y, 10Y, max)",
|
|
881
|
+
inputSchema: symbolSchema4,
|
|
882
|
+
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().stock.getPriceChange(symbol2))
|
|
883
|
+
})
|
|
884
|
+
];
|
|
885
|
+
var symbolSchema5 = zod.z.object({
|
|
886
|
+
symbol: zod.z.string().min(1, "Stock symbol is required").describe("The stock symbol (e.g., AAPL, MSFT, GOOGL)")
|
|
887
|
+
});
|
|
888
|
+
var aftermarketDefinitions = [
|
|
889
|
+
defineTool({
|
|
890
|
+
name: "getAftermarketTrade",
|
|
891
|
+
description: "Get the latest extended-hours (pre/post-market) trade for a symbol, including price, trade size, and timestamp",
|
|
892
|
+
inputSchema: symbolSchema5,
|
|
893
|
+
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().aftermarket.getTrade(symbol2))
|
|
894
|
+
}),
|
|
895
|
+
defineTool({
|
|
896
|
+
name: "getAftermarketQuote",
|
|
897
|
+
description: "Get the latest extended-hours (pre/post-market) bid/ask quote for a symbol, including bid/ask prices and sizes",
|
|
898
|
+
inputSchema: symbolSchema5,
|
|
899
|
+
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().aftermarket.getQuote(symbol2))
|
|
849
900
|
})
|
|
850
901
|
];
|
|
851
902
|
|
|
@@ -867,7 +918,8 @@ var allDefinitions = [
|
|
|
867
918
|
...valuationDefinitions,
|
|
868
919
|
...technicalDefinitions,
|
|
869
920
|
...senateHouseDefinitions,
|
|
870
|
-
...stockDefinitions
|
|
921
|
+
...stockDefinitions,
|
|
922
|
+
...aftermarketDefinitions
|
|
871
923
|
];
|
|
872
924
|
|
|
873
925
|
// src/providers/openai/index.ts
|
|
@@ -876,6 +928,7 @@ var byName = Object.fromEntries(
|
|
|
876
928
|
);
|
|
877
929
|
var pick = (defs) => defs.map((def) => byName[def.name]);
|
|
878
930
|
var getStockQuote = byName.getStockQuote;
|
|
931
|
+
var getStockQuoteShort = byName.getStockQuoteShort;
|
|
879
932
|
var getHistoricalPrice = byName.getHistoricalPrice;
|
|
880
933
|
var getIntraday = byName.getIntraday;
|
|
881
934
|
var getCompanyProfile = byName.getCompanyProfile;
|
|
@@ -908,6 +961,7 @@ var getInsiderTrading = byName.getInsiderTrading;
|
|
|
908
961
|
var getInstitutionalHolders = byName.getInstitutionalHolders;
|
|
909
962
|
var getMarketPerformance = byName.getMarketPerformance;
|
|
910
963
|
var getSectorPerformance = byName.getSectorPerformance;
|
|
964
|
+
var getIndustryPESnapshot = byName.getIndustryPESnapshot;
|
|
911
965
|
var getGainers = byName.getGainers;
|
|
912
966
|
var getLosers = byName.getLosers;
|
|
913
967
|
var getMostActive = byName.getMostActive;
|
|
@@ -931,6 +985,9 @@ var getTechnicalIndicator = byName.getTechnicalIndicator;
|
|
|
931
985
|
var getMarketCap = byName.getMarketCap;
|
|
932
986
|
var getStockSplits = byName.getStockSplits;
|
|
933
987
|
var getDividendHistory = byName.getDividendHistory;
|
|
988
|
+
var getStockPriceChange = byName.getStockPriceChange;
|
|
989
|
+
var getAftermarketTrade = byName.getAftermarketTrade;
|
|
990
|
+
var getAftermarketQuote = byName.getAftermarketQuote;
|
|
934
991
|
var quoteTools = pick(quoteDefinitions);
|
|
935
992
|
var companyTools = pick(companyDefinitions);
|
|
936
993
|
var financialTools = pick(financialDefinitions);
|
|
@@ -948,8 +1005,10 @@ var valuationTools = pick(valuationDefinitions);
|
|
|
948
1005
|
var technicalTools = pick(technicalDefinitions);
|
|
949
1006
|
var senateHouseTools = pick(senateHouseDefinitions);
|
|
950
1007
|
var stockTools = pick(stockDefinitions);
|
|
1008
|
+
var aftermarketTools = pick(aftermarketDefinitions);
|
|
951
1009
|
var fmpTools = allDefinitions.map((def) => byName[def.name]);
|
|
952
1010
|
|
|
1011
|
+
exports.aftermarketTools = aftermarketTools;
|
|
953
1012
|
exports.analystTools = analystTools;
|
|
954
1013
|
exports.calendarTools = calendarTools;
|
|
955
1014
|
exports.companyTools = companyTools;
|
|
@@ -958,6 +1017,8 @@ exports.economicTools = economicTools;
|
|
|
958
1017
|
exports.etfTools = etfTools;
|
|
959
1018
|
exports.financialTools = financialTools;
|
|
960
1019
|
exports.fmpTools = fmpTools;
|
|
1020
|
+
exports.getAftermarketQuote = getAftermarketQuote;
|
|
1021
|
+
exports.getAftermarketTrade = getAftermarketTrade;
|
|
961
1022
|
exports.getAnalystEstimates = getAnalystEstimates;
|
|
962
1023
|
exports.getBalanceSheet = getBalanceSheet;
|
|
963
1024
|
exports.getBalanceSheetGrowth = getBalanceSheetGrowth;
|
|
@@ -988,6 +1049,7 @@ exports.getHouseTradingByName = getHouseTradingByName;
|
|
|
988
1049
|
exports.getHouseTradingRSSFeed = getHouseTradingRSSFeed;
|
|
989
1050
|
exports.getIncomeGrowth = getIncomeGrowth;
|
|
990
1051
|
exports.getIncomeStatement = getIncomeStatement;
|
|
1052
|
+
exports.getIndustryPESnapshot = getIndustryPESnapshot;
|
|
991
1053
|
exports.getInsiderTrading = getInsiderTrading;
|
|
992
1054
|
exports.getInstitutionalHolders = getInstitutionalHolders;
|
|
993
1055
|
exports.getIntraday = getIntraday;
|
|
@@ -1008,7 +1070,9 @@ exports.getStockGrades = getStockGrades;
|
|
|
1008
1070
|
exports.getStockNews = getStockNews;
|
|
1009
1071
|
exports.getStockNewsBySymbol = getStockNewsBySymbol;
|
|
1010
1072
|
exports.getStockPeers = getStockPeers;
|
|
1073
|
+
exports.getStockPriceChange = getStockPriceChange;
|
|
1011
1074
|
exports.getStockQuote = getStockQuote;
|
|
1075
|
+
exports.getStockQuoteShort = getStockQuoteShort;
|
|
1012
1076
|
exports.getStockSplits = getStockSplits;
|
|
1013
1077
|
exports.getTechnicalIndicator = getTechnicalIndicator;
|
|
1014
1078
|
exports.getTreasuryRates = getTreasuryRates;
|