fmp-ai-tools 0.2.0-beta.5 → 0.2.0-beta.6
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/README.md +25 -0
- package/dist/client-ClF5Akib.d.mts +20 -0
- package/dist/client-ClF5Akib.d.ts +20 -0
- package/dist/providers/openai/index.d.mts +12 -1
- package/dist/providers/openai/index.d.ts +12 -1
- package/dist/providers/openai/index.js +162 -2
- package/dist/providers/openai/index.js.map +1 -1
- package/dist/providers/openai/index.mjs +152 -3
- package/dist/providers/openai/index.mjs.map +1 -1
- package/dist/providers/vercel-ai/index.d.mts +12 -1
- package/dist/providers/vercel-ai/index.d.ts +12 -1
- package/dist/providers/vercel-ai/index.js +160 -3
- package/dist/providers/vercel-ai/index.js.map +1 -1
- package/dist/providers/vercel-ai/index.mjs +150 -4
- package/dist/providers/vercel-ai/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -96,6 +96,16 @@ Get your API key from [Financial Modeling Prep](https://site.financialmodelingpr
|
|
|
96
96
|
|
|
97
97
|
The tools internally use the `fmp-node-api` library, which reads this environment variable to authenticate with the Financial Modeling Prep API.
|
|
98
98
|
|
|
99
|
+
### Configuring the client explicitly (optional)
|
|
100
|
+
|
|
101
|
+
If you'd rather not use the environment variable, call `configureFMPClient` once at startup (available from either entry point). The client is memoized, so this only needs to happen once:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import { configureFMPClient } from 'fmp-ai-tools/vercel-ai'; // or 'fmp-ai-tools/openai'
|
|
105
|
+
|
|
106
|
+
configureFMPClient({ apiKey: 'your_api_key_here', timeout: 15000 });
|
|
107
|
+
```
|
|
108
|
+
|
|
99
109
|
### Debugging and Logging
|
|
100
110
|
|
|
101
111
|
**⚠️ Development Only**: These logging features are intended for debugging and development, not production use.
|
|
@@ -140,6 +150,8 @@ Logs: result summary and formatted JSON response data.
|
|
|
140
150
|
### Quote Tools
|
|
141
151
|
|
|
142
152
|
- `getStockQuote` - Get real-time stock quote for a company
|
|
153
|
+
- `getHistoricalPrice` - Get historical daily prices (most recent `limit` days, default 30)
|
|
154
|
+
- `getIntraday` - Get intraday price bars at a given interval (most recent `limit` bars, default 50)
|
|
143
155
|
|
|
144
156
|
### Company Tools
|
|
145
157
|
|
|
@@ -207,6 +219,19 @@ Logs: result summary and formatted JSON response data.
|
|
|
207
219
|
|
|
208
220
|
- `getInsiderTrading` - Get insider trading data for a company
|
|
209
221
|
|
|
222
|
+
### News Tools
|
|
223
|
+
|
|
224
|
+
- `getStockNews` - Get the latest general stock market news (most recent `limit`, default 20)
|
|
225
|
+
- `getStockNewsBySymbol` - Get the latest news for one or more symbols (default `limit` 20)
|
|
226
|
+
|
|
227
|
+
### Screener Tools
|
|
228
|
+
|
|
229
|
+
- `screenStocks` - Screen for stocks by market cap, price, sector, exchange, etc. (default `limit` 50)
|
|
230
|
+
|
|
231
|
+
### Search Tools
|
|
232
|
+
|
|
233
|
+
- `searchSymbol` - Resolve a company name or partial ticker to matching symbols (e.g., "Apple" → AAPL)
|
|
234
|
+
|
|
210
235
|
## Using Individual Tools
|
|
211
236
|
|
|
212
237
|
You can import and use specific tool categories or individual tools from either provider:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FMPConfig } from 'fmp-node-api';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internal FMP API client used by the tools.
|
|
5
|
+
*
|
|
6
|
+
* The client is memoized so tools reuse a single `FMP` instance instead of
|
|
7
|
+
* constructing one (and re-validating the API key) on every tool call. By
|
|
8
|
+
* default it reads the `FMP_API_KEY` environment variable; consumers can call
|
|
9
|
+
* `configureFMPClient(...)` once at startup to provide a key/timeout explicitly.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Configure the FMP client used by all tools. Optional — by default the client
|
|
14
|
+
* reads the `FMP_API_KEY` environment variable. Call once before using the tools.
|
|
15
|
+
*/
|
|
16
|
+
declare function configureFMPClient(config: FMPConfig): void;
|
|
17
|
+
/** Reset the memoized client and configuration (mainly for tests / serverless reuse). */
|
|
18
|
+
declare function resetFMPClient(): void;
|
|
19
|
+
|
|
20
|
+
export { configureFMPClient as c, resetFMPClient as r };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FMPConfig } from 'fmp-node-api';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internal FMP API client used by the tools.
|
|
5
|
+
*
|
|
6
|
+
* The client is memoized so tools reuse a single `FMP` instance instead of
|
|
7
|
+
* constructing one (and re-validating the API key) on every tool call. By
|
|
8
|
+
* default it reads the `FMP_API_KEY` environment variable; consumers can call
|
|
9
|
+
* `configureFMPClient(...)` once at startup to provide a key/timeout explicitly.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Configure the FMP client used by all tools. Optional — by default the client
|
|
14
|
+
* reads the `FMP_API_KEY` environment variable. Call once before using the tools.
|
|
15
|
+
*/
|
|
16
|
+
declare function configureFMPClient(config: FMPConfig): void;
|
|
17
|
+
/** Reset the memoized client and configuration (mainly for tests / serverless reuse). */
|
|
18
|
+
declare function resetFMPClient(): void;
|
|
19
|
+
|
|
20
|
+
export { configureFMPClient as c, resetFMPClient as r };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Tool } from '@openai/agents';
|
|
2
|
+
export { c as configureFMPClient, r as resetFMPClient } from '../../client-ClF5Akib.mjs';
|
|
3
|
+
import 'fmp-node-api';
|
|
2
4
|
|
|
3
5
|
declare const getStockQuote: Tool<unknown>;
|
|
6
|
+
declare const getHistoricalPrice: Tool<unknown>;
|
|
7
|
+
declare const getIntraday: Tool<unknown>;
|
|
4
8
|
declare const getCompanyProfile: Tool<unknown>;
|
|
5
9
|
declare const getCompanySharesFloat: Tool<unknown>;
|
|
6
10
|
declare const getCompanyExecutiveCompensation: Tool<unknown>;
|
|
@@ -34,6 +38,10 @@ declare const getSenateTradingByName: Tool<unknown>;
|
|
|
34
38
|
declare const getHouseTradingByName: Tool<unknown>;
|
|
35
39
|
declare const getSenateTradingRSSFeed: Tool<unknown>;
|
|
36
40
|
declare const getHouseTradingRSSFeed: Tool<unknown>;
|
|
41
|
+
declare const getStockNews: Tool<unknown>;
|
|
42
|
+
declare const getStockNewsBySymbol: Tool<unknown>;
|
|
43
|
+
declare const screenStocks: Tool<unknown>;
|
|
44
|
+
declare const searchSymbol: Tool<unknown>;
|
|
37
45
|
declare const getMarketCap: Tool<unknown>;
|
|
38
46
|
declare const getStockSplits: Tool<unknown>;
|
|
39
47
|
declare const getDividendHistory: Tool<unknown>;
|
|
@@ -46,8 +54,11 @@ declare const etfTools: Tool<unknown>[];
|
|
|
46
54
|
declare const insiderTools: Tool<unknown>[];
|
|
47
55
|
declare const institutionalTools: Tool<unknown>[];
|
|
48
56
|
declare const marketTools: Tool<unknown>[];
|
|
57
|
+
declare const newsTools: Tool<unknown>[];
|
|
58
|
+
declare const screenerTools: Tool<unknown>[];
|
|
59
|
+
declare const searchTools: Tool<unknown>[];
|
|
49
60
|
declare const senateHouseTools: Tool<unknown>[];
|
|
50
61
|
declare const stockTools: Tool<unknown>[];
|
|
51
62
|
declare const fmpTools: Tool<unknown>[];
|
|
52
63
|
|
|
53
|
-
export { calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanySharesFloat, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getGainers, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getInsiderTrading, getInstitutionalHolders, getKeyMetrics, getLosers, getMarketCap, getMarketPerformance, getMostActive, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockQuote, getStockSplits, getTreasuryRates, insiderTools, institutionalTools, marketTools, quoteTools, senateHouseTools, stockTools };
|
|
64
|
+
export { calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanySharesFloat, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getGainers, getHistoricalPrice, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getInsiderTrading, getInstitutionalHolders, getIntraday, getKeyMetrics, getLosers, getMarketCap, getMarketPerformance, getMostActive, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockNews, getStockNewsBySymbol, getStockQuote, getStockSplits, getTreasuryRates, insiderTools, institutionalTools, marketTools, newsTools, quoteTools, screenStocks, screenerTools, searchSymbol, searchTools, senateHouseTools, stockTools };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Tool } from '@openai/agents';
|
|
2
|
+
export { c as configureFMPClient, r as resetFMPClient } from '../../client-ClF5Akib.js';
|
|
3
|
+
import 'fmp-node-api';
|
|
2
4
|
|
|
3
5
|
declare const getStockQuote: Tool<unknown>;
|
|
6
|
+
declare const getHistoricalPrice: Tool<unknown>;
|
|
7
|
+
declare const getIntraday: Tool<unknown>;
|
|
4
8
|
declare const getCompanyProfile: Tool<unknown>;
|
|
5
9
|
declare const getCompanySharesFloat: Tool<unknown>;
|
|
6
10
|
declare const getCompanyExecutiveCompensation: Tool<unknown>;
|
|
@@ -34,6 +38,10 @@ declare const getSenateTradingByName: Tool<unknown>;
|
|
|
34
38
|
declare const getHouseTradingByName: Tool<unknown>;
|
|
35
39
|
declare const getSenateTradingRSSFeed: Tool<unknown>;
|
|
36
40
|
declare const getHouseTradingRSSFeed: Tool<unknown>;
|
|
41
|
+
declare const getStockNews: Tool<unknown>;
|
|
42
|
+
declare const getStockNewsBySymbol: Tool<unknown>;
|
|
43
|
+
declare const screenStocks: Tool<unknown>;
|
|
44
|
+
declare const searchSymbol: Tool<unknown>;
|
|
37
45
|
declare const getMarketCap: Tool<unknown>;
|
|
38
46
|
declare const getStockSplits: Tool<unknown>;
|
|
39
47
|
declare const getDividendHistory: Tool<unknown>;
|
|
@@ -46,8 +54,11 @@ declare const etfTools: Tool<unknown>[];
|
|
|
46
54
|
declare const insiderTools: Tool<unknown>[];
|
|
47
55
|
declare const institutionalTools: Tool<unknown>[];
|
|
48
56
|
declare const marketTools: Tool<unknown>[];
|
|
57
|
+
declare const newsTools: Tool<unknown>[];
|
|
58
|
+
declare const screenerTools: Tool<unknown>[];
|
|
59
|
+
declare const searchTools: Tool<unknown>[];
|
|
49
60
|
declare const senateHouseTools: Tool<unknown>[];
|
|
50
61
|
declare const stockTools: Tool<unknown>[];
|
|
51
62
|
declare const fmpTools: Tool<unknown>[];
|
|
52
63
|
|
|
53
|
-
export { calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanySharesFloat, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getGainers, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getInsiderTrading, getInstitutionalHolders, getKeyMetrics, getLosers, getMarketCap, getMarketPerformance, getMostActive, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockQuote, getStockSplits, getTreasuryRates, insiderTools, institutionalTools, marketTools, quoteTools, senateHouseTools, stockTools };
|
|
64
|
+
export { calendarTools, companyTools, economicTools, etfTools, financialTools, fmpTools, getBalanceSheet, getBalanceSheetGrowth, getCashFlowStatement, getCashflowGrowth, getCompanyExecutiveCompensation, getCompanyProfile, getCompanySharesFloat, getDividendHistory, getETFHoldings, getETFProfile, getEarningsCalendar, getEarningsHistorical, getEconomicCalendar, getEconomicIndicators, getEnterpriseValue, getFinancialGrowth, getFinancialRatios, getGainers, getHistoricalPrice, getHouseTrading, getHouseTradingByName, getHouseTradingRSSFeed, getIncomeGrowth, getIncomeStatement, getInsiderTrading, getInstitutionalHolders, getIntraday, getKeyMetrics, getLosers, getMarketCap, getMarketPerformance, getMostActive, getSectorPerformance, getSenateTrading, getSenateTradingByName, getSenateTradingRSSFeed, getStockNews, getStockNewsBySymbol, getStockQuote, getStockSplits, getTreasuryRates, insiderTools, institutionalTools, marketTools, newsTools, quoteTools, screenStocks, screenerTools, searchSymbol, searchTools, senateHouseTools, stockTools };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var agents = require('@openai/agents');
|
|
4
|
-
var zod = require('zod');
|
|
5
4
|
var fmpNodeApi = require('fmp-node-api');
|
|
5
|
+
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
// src/utils/openai-tool-wrapper.ts
|
|
8
8
|
|
|
@@ -224,8 +224,21 @@ function createOpenAITool(config) {
|
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
+
var cached;
|
|
228
|
+
var configured;
|
|
229
|
+
function configureFMPClient(config) {
|
|
230
|
+
configured = config;
|
|
231
|
+
cached = void 0;
|
|
232
|
+
}
|
|
233
|
+
function resetFMPClient() {
|
|
234
|
+
cached = void 0;
|
|
235
|
+
configured = void 0;
|
|
236
|
+
}
|
|
227
237
|
function getFMPClient() {
|
|
228
|
-
|
|
238
|
+
if (!cached) {
|
|
239
|
+
cached = new fmpNodeApi.FMP(configured);
|
|
240
|
+
}
|
|
241
|
+
return cached;
|
|
229
242
|
}
|
|
230
243
|
|
|
231
244
|
// src/definitions/types.ts
|
|
@@ -242,6 +255,54 @@ var quoteDefinitions = [
|
|
|
242
255
|
symbol: zod.z.string().min(1, "Stock symbol is required").describe("The symbol of the company to get the stock quote for")
|
|
243
256
|
}),
|
|
244
257
|
execute: async ({ symbol: symbol2 }) => toToolResponse(await getFMPClient().quote.getQuote(symbol2))
|
|
258
|
+
}),
|
|
259
|
+
defineTool({
|
|
260
|
+
name: "getHistoricalPrice",
|
|
261
|
+
description: "Get historical daily prices (open/high/low/close/volume) for a symbol. Returns the most recent `limit` days.",
|
|
262
|
+
inputSchema: zod.z.object({
|
|
263
|
+
symbol: zod.z.string().min(1).describe("The stock/ETF symbol (e.g., AAPL)"),
|
|
264
|
+
from: zod.z.string().optional().nullable().describe("Start date in YYYY-MM-DD format (optional)"),
|
|
265
|
+
to: zod.z.string().optional().nullable().describe("End date in YYYY-MM-DD format (optional)"),
|
|
266
|
+
limit: zod.z.number().int().positive().default(30).describe("Max number of most-recent days to return (default 30)")
|
|
267
|
+
}),
|
|
268
|
+
execute: async ({ symbol: symbol2, from, to, limit: limit2 = 30 }) => {
|
|
269
|
+
const res = await getFMPClient().quote.getHistoricalPrice({
|
|
270
|
+
symbol: symbol2,
|
|
271
|
+
from: from ?? void 0,
|
|
272
|
+
to: to ?? void 0
|
|
273
|
+
});
|
|
274
|
+
const data = res.data;
|
|
275
|
+
if (res.success && data && Array.isArray(data.historical)) {
|
|
276
|
+
return toToolResponse({
|
|
277
|
+
...res,
|
|
278
|
+
data: { ...data, historical: data.historical.slice(0, limit2) }
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return toToolResponse(res);
|
|
282
|
+
}
|
|
283
|
+
}),
|
|
284
|
+
defineTool({
|
|
285
|
+
name: "getIntraday",
|
|
286
|
+
description: "Get intraday price bars for a symbol at a given interval. Returns the most recent `limit` bars.",
|
|
287
|
+
inputSchema: zod.z.object({
|
|
288
|
+
symbol: zod.z.string().min(1).describe("The stock/ETF symbol (e.g., AAPL)"),
|
|
289
|
+
interval: zod.z.enum(["1min", "5min", "15min", "30min", "1hour", "4hour"]).default("5min").describe("Bar interval"),
|
|
290
|
+
from: zod.z.string().optional().nullable().describe("Start date in YYYY-MM-DD format (optional)"),
|
|
291
|
+
to: zod.z.string().optional().nullable().describe("End date in YYYY-MM-DD format (optional)"),
|
|
292
|
+
limit: zod.z.number().int().positive().default(50).describe("Max number of most-recent bars to return (default 50)")
|
|
293
|
+
}),
|
|
294
|
+
execute: async ({ symbol: symbol2, interval = "5min", from, to, limit: limit2 = 50 }) => {
|
|
295
|
+
const res = await getFMPClient().quote.getIntraday({
|
|
296
|
+
symbol: symbol2,
|
|
297
|
+
interval,
|
|
298
|
+
from: from ?? void 0,
|
|
299
|
+
to: to ?? void 0
|
|
300
|
+
});
|
|
301
|
+
if (res.success && Array.isArray(res.data)) {
|
|
302
|
+
return toToolResponse({ ...res, data: res.data.slice(0, limit2) });
|
|
303
|
+
}
|
|
304
|
+
return toToolResponse(res);
|
|
305
|
+
}
|
|
245
306
|
})
|
|
246
307
|
];
|
|
247
308
|
var symbolSchema = zod.z.object({
|
|
@@ -511,6 +572,82 @@ var marketDefinitions = [
|
|
|
511
572
|
execute: async () => toToolResponse(await getFMPClient().market.getMostActive())
|
|
512
573
|
})
|
|
513
574
|
];
|
|
575
|
+
var newsDefinitions = [
|
|
576
|
+
defineTool({
|
|
577
|
+
name: "getStockNews",
|
|
578
|
+
description: "Get the latest general stock market news articles",
|
|
579
|
+
inputSchema: zod.z.object({
|
|
580
|
+
from: zod.z.string().optional().nullable().describe("Start date in YYYY-MM-DD format (optional)"),
|
|
581
|
+
to: zod.z.string().optional().nullable().describe("End date in YYYY-MM-DD format (optional)"),
|
|
582
|
+
limit: zod.z.number().int().positive().default(20).describe("Max number of articles to return (default 20)")
|
|
583
|
+
}),
|
|
584
|
+
execute: async ({ from, to, limit: limit2 = 20 }) => toToolResponse(
|
|
585
|
+
await getFMPClient().news.getStockNews({
|
|
586
|
+
from: from ?? void 0,
|
|
587
|
+
to: to ?? void 0,
|
|
588
|
+
limit: limit2
|
|
589
|
+
})
|
|
590
|
+
)
|
|
591
|
+
}),
|
|
592
|
+
defineTool({
|
|
593
|
+
name: "getStockNewsBySymbol",
|
|
594
|
+
description: "Get the latest news articles for one or more specific stock symbols",
|
|
595
|
+
inputSchema: zod.z.object({
|
|
596
|
+
symbols: zod.z.array(zod.z.string().min(1)).min(1).describe('Stock symbols to get news for (e.g., ["AAPL", "MSFT"])'),
|
|
597
|
+
from: zod.z.string().optional().nullable().describe("Start date in YYYY-MM-DD format (optional)"),
|
|
598
|
+
to: zod.z.string().optional().nullable().describe("End date in YYYY-MM-DD format (optional)"),
|
|
599
|
+
limit: zod.z.number().int().positive().default(20).describe("Max number of articles to return (default 20)")
|
|
600
|
+
}),
|
|
601
|
+
execute: async ({ symbols, from, to, limit: limit2 = 20 }) => toToolResponse(
|
|
602
|
+
await getFMPClient().news.getStockNewsBySymbol({
|
|
603
|
+
symbols,
|
|
604
|
+
from: from ?? void 0,
|
|
605
|
+
to: to ?? void 0,
|
|
606
|
+
limit: limit2
|
|
607
|
+
})
|
|
608
|
+
)
|
|
609
|
+
})
|
|
610
|
+
];
|
|
611
|
+
var screenerDefinitions = [
|
|
612
|
+
defineTool({
|
|
613
|
+
name: "screenStocks",
|
|
614
|
+
description: "Screen for stocks matching financial criteria (market cap, price, sector, exchange, etc.). Returns matching companies.",
|
|
615
|
+
inputSchema: zod.z.object({
|
|
616
|
+
marketCapMoreThan: zod.z.number().optional().nullable().describe("Minimum market capitalization"),
|
|
617
|
+
marketCapLowerThan: zod.z.number().optional().nullable().describe("Maximum market capitalization"),
|
|
618
|
+
priceMoreThan: zod.z.number().optional().nullable().describe("Minimum stock price"),
|
|
619
|
+
priceLowerThan: zod.z.number().optional().nullable().describe("Maximum stock price"),
|
|
620
|
+
sector: zod.z.string().optional().nullable().describe('Sector filter (e.g., "Technology")'),
|
|
621
|
+
industry: zod.z.string().optional().nullable().describe("Industry filter"),
|
|
622
|
+
exchange: zod.z.string().optional().nullable().describe('Exchange filter (e.g., "NASDAQ")'),
|
|
623
|
+
country: zod.z.string().optional().nullable().describe('Country filter (e.g., "US")'),
|
|
624
|
+
isEtf: zod.z.boolean().optional().nullable().describe("Restrict to ETFs"),
|
|
625
|
+
isActivelyTrading: zod.z.boolean().optional().nullable().describe("Restrict to actively trading"),
|
|
626
|
+
limit: zod.z.number().int().positive().default(50).describe("Max number of results to return (default 50)")
|
|
627
|
+
}),
|
|
628
|
+
execute: async ({ limit: limit2 = 50, ...filters }) => {
|
|
629
|
+
const params = { limit: limit2 };
|
|
630
|
+
for (const [key, value] of Object.entries(filters)) {
|
|
631
|
+
if (value !== null && value !== void 0) params[key] = value;
|
|
632
|
+
}
|
|
633
|
+
return toToolResponse(await getFMPClient().screener.getScreener(params));
|
|
634
|
+
}
|
|
635
|
+
})
|
|
636
|
+
];
|
|
637
|
+
var searchDefinitions = [
|
|
638
|
+
defineTool({
|
|
639
|
+
name: "searchSymbol",
|
|
640
|
+
description: 'Search for a ticker symbol by company name or partial ticker (e.g., resolve "Apple" to "AAPL")',
|
|
641
|
+
inputSchema: zod.z.object({
|
|
642
|
+
query: zod.z.string().min(1).describe("Company name or ticker to search for"),
|
|
643
|
+
limit: zod.z.number().int().positive().default(10).describe("Max number of results to return (default 10)"),
|
|
644
|
+
exchange: zod.z.string().optional().nullable().describe('Restrict to a specific exchange (optional, e.g., "NASDAQ")')
|
|
645
|
+
}),
|
|
646
|
+
execute: async ({ query, limit: limit2 = 10, exchange }) => toToolResponse(
|
|
647
|
+
await getFMPClient().search.search({ query, limit: limit2, exchange: exchange ?? void 0 })
|
|
648
|
+
)
|
|
649
|
+
})
|
|
650
|
+
];
|
|
514
651
|
var symbolSchema2 = zod.z.object({
|
|
515
652
|
symbol: zod.z.string().min(1, "Stock symbol is required").describe("Stock symbol (e.g., AAPL, MSFT, GOOGL)")
|
|
516
653
|
});
|
|
@@ -598,6 +735,9 @@ var allDefinitions = [
|
|
|
598
735
|
...insiderDefinitions,
|
|
599
736
|
...institutionalDefinitions,
|
|
600
737
|
...marketDefinitions,
|
|
738
|
+
...newsDefinitions,
|
|
739
|
+
...screenerDefinitions,
|
|
740
|
+
...searchDefinitions,
|
|
601
741
|
...senateHouseDefinitions,
|
|
602
742
|
...stockDefinitions
|
|
603
743
|
];
|
|
@@ -608,6 +748,8 @@ var byName = Object.fromEntries(
|
|
|
608
748
|
);
|
|
609
749
|
var pick = (defs) => defs.map((def) => byName[def.name]);
|
|
610
750
|
var getStockQuote = byName.getStockQuote;
|
|
751
|
+
var getHistoricalPrice = byName.getHistoricalPrice;
|
|
752
|
+
var getIntraday = byName.getIntraday;
|
|
611
753
|
var getCompanyProfile = byName.getCompanyProfile;
|
|
612
754
|
var getCompanySharesFloat = byName.getCompanySharesFloat;
|
|
613
755
|
var getCompanyExecutiveCompensation = byName.getCompanyExecutiveCompensation;
|
|
@@ -641,6 +783,10 @@ var getSenateTradingByName = byName.getSenateTradingByName;
|
|
|
641
783
|
var getHouseTradingByName = byName.getHouseTradingByName;
|
|
642
784
|
var getSenateTradingRSSFeed = byName.getSenateTradingRSSFeed;
|
|
643
785
|
var getHouseTradingRSSFeed = byName.getHouseTradingRSSFeed;
|
|
786
|
+
var getStockNews = byName.getStockNews;
|
|
787
|
+
var getStockNewsBySymbol = byName.getStockNewsBySymbol;
|
|
788
|
+
var screenStocks = byName.screenStocks;
|
|
789
|
+
var searchSymbol = byName.searchSymbol;
|
|
644
790
|
var getMarketCap = byName.getMarketCap;
|
|
645
791
|
var getStockSplits = byName.getStockSplits;
|
|
646
792
|
var getDividendHistory = byName.getDividendHistory;
|
|
@@ -653,12 +799,16 @@ var etfTools = pick(etfDefinitions);
|
|
|
653
799
|
var insiderTools = pick(insiderDefinitions);
|
|
654
800
|
var institutionalTools = pick(institutionalDefinitions);
|
|
655
801
|
var marketTools = pick(marketDefinitions);
|
|
802
|
+
var newsTools = pick(newsDefinitions);
|
|
803
|
+
var screenerTools = pick(screenerDefinitions);
|
|
804
|
+
var searchTools = pick(searchDefinitions);
|
|
656
805
|
var senateHouseTools = pick(senateHouseDefinitions);
|
|
657
806
|
var stockTools = pick(stockDefinitions);
|
|
658
807
|
var fmpTools = allDefinitions.map((def) => byName[def.name]);
|
|
659
808
|
|
|
660
809
|
exports.calendarTools = calendarTools;
|
|
661
810
|
exports.companyTools = companyTools;
|
|
811
|
+
exports.configureFMPClient = configureFMPClient;
|
|
662
812
|
exports.economicTools = economicTools;
|
|
663
813
|
exports.etfTools = etfTools;
|
|
664
814
|
exports.financialTools = financialTools;
|
|
@@ -681,6 +831,7 @@ exports.getEnterpriseValue = getEnterpriseValue;
|
|
|
681
831
|
exports.getFinancialGrowth = getFinancialGrowth;
|
|
682
832
|
exports.getFinancialRatios = getFinancialRatios;
|
|
683
833
|
exports.getGainers = getGainers;
|
|
834
|
+
exports.getHistoricalPrice = getHistoricalPrice;
|
|
684
835
|
exports.getHouseTrading = getHouseTrading;
|
|
685
836
|
exports.getHouseTradingByName = getHouseTradingByName;
|
|
686
837
|
exports.getHouseTradingRSSFeed = getHouseTradingRSSFeed;
|
|
@@ -688,6 +839,7 @@ exports.getIncomeGrowth = getIncomeGrowth;
|
|
|
688
839
|
exports.getIncomeStatement = getIncomeStatement;
|
|
689
840
|
exports.getInsiderTrading = getInsiderTrading;
|
|
690
841
|
exports.getInstitutionalHolders = getInstitutionalHolders;
|
|
842
|
+
exports.getIntraday = getIntraday;
|
|
691
843
|
exports.getKeyMetrics = getKeyMetrics;
|
|
692
844
|
exports.getLosers = getLosers;
|
|
693
845
|
exports.getMarketCap = getMarketCap;
|
|
@@ -697,13 +849,21 @@ exports.getSectorPerformance = getSectorPerformance;
|
|
|
697
849
|
exports.getSenateTrading = getSenateTrading;
|
|
698
850
|
exports.getSenateTradingByName = getSenateTradingByName;
|
|
699
851
|
exports.getSenateTradingRSSFeed = getSenateTradingRSSFeed;
|
|
852
|
+
exports.getStockNews = getStockNews;
|
|
853
|
+
exports.getStockNewsBySymbol = getStockNewsBySymbol;
|
|
700
854
|
exports.getStockQuote = getStockQuote;
|
|
701
855
|
exports.getStockSplits = getStockSplits;
|
|
702
856
|
exports.getTreasuryRates = getTreasuryRates;
|
|
703
857
|
exports.insiderTools = insiderTools;
|
|
704
858
|
exports.institutionalTools = institutionalTools;
|
|
705
859
|
exports.marketTools = marketTools;
|
|
860
|
+
exports.newsTools = newsTools;
|
|
706
861
|
exports.quoteTools = quoteTools;
|
|
862
|
+
exports.resetFMPClient = resetFMPClient;
|
|
863
|
+
exports.screenStocks = screenStocks;
|
|
864
|
+
exports.screenerTools = screenerTools;
|
|
865
|
+
exports.searchSymbol = searchSymbol;
|
|
866
|
+
exports.searchTools = searchTools;
|
|
707
867
|
exports.senateHouseTools = senateHouseTools;
|
|
708
868
|
exports.stockTools = stockTools;
|
|
709
869
|
//# sourceMappingURL=index.js.map
|