@axionquant/mcp 1.0.2 → 1.0.5

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 (3) hide show
  1. package/README.md +167 -110
  2. package/index.js +1294 -815
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -40,19 +40,16 @@ async function makeApiRequest(endpoint, options = {}) {
40
40
  */
41
41
  function buildQueryString(params) {
42
42
  const filtered = Object.entries(params || {})
43
- .filter(([_, value]) => value !== undefined && value !== null && value !== '')
44
- .map(([key, value]) => `${key}=${encodeURIComponent(value)}`);
43
+ .filter(([_, value]) => value !== undefined && value !== null && value !== '')
44
+ .map(([key, value]) => `${key}=${encodeURIComponent(value)}`);
45
45
 
46
46
  return filtered.length > 0 ? `?${filtered.join('&')}` : '';
47
47
  }
48
48
 
49
- /**
50
- * Create the MCP server
51
- */
52
49
  const server = new Server(
53
50
  {
54
51
  name: "axion-financial-data",
55
- version: "1.0.0",
52
+ version: "2.0.0",
56
53
  },
57
54
  {
58
55
  capabilities: {
@@ -61,23 +58,19 @@ const server = new Server(
61
58
  }
62
59
  );
63
60
 
64
- /**
65
- * List all available tools
66
- */
67
61
  server.setRequestHandler(ListToolsRequestSchema, async () => {
68
62
  return {
69
63
  tools: [
64
+ // ---------- Credit ----------
70
65
  {
71
66
  name: "credit_search",
72
- description: "Search for credit entities by name, sector, country, or state",
67
+ description: "Search for credit entities by organization name",
73
68
  inputSchema: {
74
69
  type: "object",
75
70
  properties: {
76
- query: {
77
- type: "string",
78
- description: "Search query (organization name)"
79
- },
80
- }
71
+ query: { type: "string", description: "Organization name to search" }
72
+ },
73
+ required: ["query"]
81
74
  }
82
75
  },
83
76
  {
@@ -86,1247 +79,1733 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
86
79
  inputSchema: {
87
80
  type: "object",
88
81
  properties: {
89
- id: {
90
- type: "string",
91
- description: "Organization ID (from search results)"
92
- }
82
+ id: { type: "string", description: "Organization ID from search results" }
93
83
  },
94
84
  required: ["id"]
95
85
  }
96
86
  },
87
+
88
+ // ---------- ESG ----------
97
89
  {
98
- name: "econ_search",
99
- description: "Search for economic datasets (FRED)",
90
+ name: "esg_data",
91
+ description: "Get ESG scores for a specific ticker",
100
92
  inputSchema: {
101
93
  type: "object",
102
94
  properties: {
103
- query: {
104
- type: "string",
105
- description: "Search query for economic indicators"
106
- }
95
+ ticker: { type: "string", description: "Stock ticker (e.g., AAPL)" }
107
96
  },
108
- required: ["query"]
97
+ required: ["ticker"]
109
98
  }
110
99
  },
111
- {
112
- name: "econ_dataset",
113
- description: "Get economic dataset time series data by ID",
100
+
101
+ // ---------- ETF (note plural endpoints) ----------
102
+ {
103
+ name: "etf_tickers",
104
+ description: "List etf tickers, optionally filtered by country or exchange",
114
105
  inputSchema: {
115
106
  type: "object",
116
107
  properties: {
117
- id: {
118
- type: "string",
119
- description: "Dataset ID (from search results, e.g., 'PMAIZMTUSDM')"
120
- }
121
- },
122
- required: ["id"]
108
+ country: { type: "string", description: "Filter by country (e.g., 'america')" },
109
+ exchange: { type: "string", description: "Filter by exchange (e.g., 'NASDAQ')" }
110
+ }
123
111
  }
124
112
  },
125
113
  {
126
- name: "econ_calendar",
127
- description: "Get economic calendar events with filtering options",
128
- inputSchema: {
129
- type: "object",
130
- properties: {
131
- from: {
132
- type: "string",
133
- description: "Start date (YYYY-MM-DD)"
134
- },
135
- to: {
136
- type: "string",
137
- description: "End date (YYYY-MM-DD)"
138
- },
139
- country: {
140
- type: "string",
141
- description: "Country code or comma-separated list (e.g., 'US' or 'US,GB,JP')"
142
- },
143
- minImportance: {
144
- type: "integer",
145
- description: "Minimum importance level (0-3, where 3 is highest)",
146
- minimum: -1,
147
- maximum: 3
148
- },
149
- currency: {
150
- type: "string",
151
- description: "Currency code or comma-separated list (e.g., 'USD' or 'USD,EUR,GBP')"
152
- },
153
- category: {
154
- type: "string",
155
- description: "Category or comma-separated list (e.g., 'gov' or 'gov,infl')"
156
- }
157
- }
158
- }
114
+ name: "etf_gainers",
115
+ description: "Get top ETF gainers",
116
+ inputSchema: { type: "object", properties: {} }
159
117
  },
160
118
  {
161
- name: "esg_data",
162
- description: "Get ESG (Environmental, Social, Governance) scores for a specific ticker",
119
+ name: "etf_losers",
120
+ description: "Get top ETF losers",
121
+ inputSchema: { type: "object", properties: {} }
122
+ },
123
+ {
124
+ name: "etf_list_market",
125
+ description: "Get unique market values for ETFs",
126
+ inputSchema: { type: "object", properties: {} }
127
+ },
128
+ {
129
+ name: "etf_list_country",
130
+ description: "Get unique country values for ETFs",
131
+ inputSchema: { type: "object", properties: {} }
132
+ },
133
+ {
134
+ name: "etf_list_currency",
135
+ description: "Get unique currency values for ETFs",
136
+ inputSchema: { type: "object", properties: {} }
137
+ },
138
+ {
139
+ name: "etf_list_sector",
140
+ description: "Get unique sector values for ETFs",
141
+ inputSchema: { type: "object", properties: {} }
142
+ },
143
+ {
144
+ name: "etf_list_industry",
145
+ description: "Get unique industry values for ETFs",
146
+ inputSchema: { type: "object", properties: {} }
147
+ },
148
+ {
149
+ name: "etf_list_type",
150
+ description: "Get unique type values for ETFs",
151
+ inputSchema: { type: "object", properties: {} }
152
+ },
153
+ {
154
+ name: "etf_quote",
155
+ description: "Get an ETF quote",
163
156
  inputSchema: {
164
157
  type: "object",
165
158
  properties: {
166
- ticker: {
167
- type: "string",
168
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
169
- }
159
+ ticker: { type: "string", description: "ETF ticker (e.g., SPY)" }
170
160
  },
171
161
  required: ["ticker"]
172
162
  }
173
163
  },
174
164
  {
175
- name: "etf_fund",
176
- description: "Get ETF fund information including ratings, metrics, and classification",
165
+ name: "etf_prices",
166
+ description: "Get historical price data for an etf",
177
167
  inputSchema: {
178
168
  type: "object",
179
169
  properties: {
180
- ticker: {
181
- type: "string",
182
- description: "ETF ticker symbol (e.g., 'SPY' for SPDR S&P 500 ETF Trust)"
183
- }
170
+ ticker: { type: "string", description: "ETF ticker" },
171
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
172
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
173
+ frame: { type: "string", description: "Time frame (e.g., '1d', '1wk', '1mo')" }
184
174
  },
185
175
  required: ["ticker"]
186
176
  }
187
177
  },
178
+
188
179
  {
189
- name: "etf_weights",
190
- description: "Get ETF sector and region allocation weights",
180
+ name: "etf_fund",
181
+ description: "Get ETF fund information including ratings and metrics",
191
182
  inputSchema: {
192
183
  type: "object",
193
184
  properties: {
194
- ticker: {
195
- type: "string",
196
- description: "ETF ticker symbol (e.g., 'SPY' for SPDR S&P 500 ETF Trust)"
197
- }
185
+ ticker: { type: "string", description: "ETF ticker (e.g., SPY)" }
198
186
  },
199
187
  required: ["ticker"]
200
188
  }
201
189
  },
202
190
  {
203
191
  name: "etf_holdings",
204
- description: "Get ETF top holdings including weight, shares, and market value",
192
+ description: "Get ETF top holdings with weights, shares, and market value",
205
193
  inputSchema: {
206
194
  type: "object",
207
195
  properties: {
208
- ticker: {
209
- type: "string",
210
- description: "ETF ticker symbol (e.g., 'SPY' for SPDR S&P 500 ETF Trust)"
211
- }
196
+ ticker: { type: "string", description: "ETF ticker (e.g., SPY)" }
212
197
  },
213
198
  required: ["ticker"]
214
199
  }
215
200
  },
216
201
  {
217
202
  name: "etf_exposure",
218
- description: "Get which other ETFs hold a specific ticker (inverse exposure)",
203
+ description: "Find which ETFs hold a specific stock ticker",
219
204
  inputSchema: {
220
205
  type: "object",
221
206
  properties: {
222
- ticker: {
223
- type: "string",
224
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple) to find ETFs that hold it"
225
- }
207
+ ticker: { type: "string", description: "Stock ticker (e.g., AAPL)" }
226
208
  },
227
209
  required: ["ticker"]
228
210
  }
229
211
  },
230
- // News tools
231
212
  {
232
- name: "news_ticker",
233
- description: "Get news for a specific company by ticker symbol",
213
+ name: "etf_weights",
214
+ description: "Find what percentage of each sector industry and stocks make up the ETF",
234
215
  inputSchema: {
235
216
  type: "object",
236
217
  properties: {
237
- ticker: {
238
- type: "string",
239
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
240
- }
218
+ ticker: { type: "string", description: "Stock ticker (e.g., AAPL)" }
241
219
  },
242
220
  required: ["ticker"]
243
221
  }
244
222
  },
223
+
224
+ // ---------- Supply Chain ----------
245
225
  {
246
- name: "news_country",
247
- description: "Get news for a specific country",
226
+ name: "supply_chain_customers",
227
+ description: "Get supply chain customers for a company",
248
228
  inputSchema: {
249
229
  type: "object",
250
230
  properties: {
251
- country: {
252
- type: "string",
253
- description: "Country name or code (e.g., 'US', 'United States')"
254
- }
231
+ ticker: { type: "string", description: "Stock ticker" }
255
232
  },
256
- required: ["country"]
233
+ required: ["ticker"]
257
234
  }
258
235
  },
259
236
  {
260
- name: "news_category",
261
- description: "Get news for a specific category",
237
+ name: "supply_chain_peers",
238
+ description: "Get supply chain competitors for a company",
262
239
  inputSchema: {
263
240
  type: "object",
264
241
  properties: {
265
- category: {
266
- type: "string",
267
- description: "News category (e.g., 'business', 'technology', 'politics')"
268
- }
242
+ ticker: { type: "string", description: "Stock ticker" }
269
243
  },
270
- required: ["category"]
244
+ required: ["ticker"]
271
245
  }
272
246
  },
273
247
  {
274
- name: "news_general",
275
- description: "Get general news headlines",
248
+ name: "supply_chain_suppliers",
249
+ description: "Get supply chain suppliers for a company",
276
250
  inputSchema: {
277
251
  type: "object",
278
- properties: {}
252
+ properties: {
253
+ ticker: { type: "string", description: "Stock ticker" }
254
+ },
255
+ required: ["ticker"]
279
256
  }
280
257
  },
281
- // Sentiment analysis tools
258
+
259
+ // ---------- Stocks ----------
282
260
  {
283
- name: "sentiment_social",
284
- description: "Get social media sentiment for a specific ticker (from Google, Reddit, Twitter)",
261
+ name: "stocks_tickers",
262
+ description: "List stock tickers, optionally filtered by country or exchange",
285
263
  inputSchema: {
286
264
  type: "object",
287
265
  properties: {
288
- ticker: {
289
- type: "string",
290
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
291
- }
292
- },
293
- required: ["ticker"]
266
+ country: { type: "string", description: "Filter by country (e.g., 'america')" },
267
+ exchange: { type: "string", description: "Filter by exchange (e.g., 'NASDAQ')" }
268
+ }
294
269
  }
295
270
  },
296
271
  {
297
- name: "sentiment_news",
298
- description: "Get news sentiment for a specific ticker",
272
+ name: "stocks_gainers",
273
+ description: "Get top stock gainers",
274
+ inputSchema: { type: "object", properties: {} }
275
+ },
276
+ {
277
+ name: "stocks_losers",
278
+ description: "Get top stock losers",
279
+ inputSchema: { type: "object", properties: {} }
280
+ },
281
+ {
282
+ name: "stocks_list_market",
283
+ description: "Get unique market values for stocks",
284
+ inputSchema: { type: "object", properties: {} }
285
+ },
286
+ {
287
+ name: "stocks_list_country",
288
+ description: "Get unique country values for stocks",
289
+ inputSchema: { type: "object", properties: {} }
290
+ },
291
+ {
292
+ name: "stocks_list_currency",
293
+ description: "Get unique currency values for stocks",
294
+ inputSchema: { type: "object", properties: {} }
295
+ },
296
+ {
297
+ name: "stocks_list_sector",
298
+ description: "Get unique sector values for stocks",
299
+ inputSchema: { type: "object", properties: {} }
300
+ },
301
+ {
302
+ name: "stocks_list_industry",
303
+ description: "Get unique industry values for stocks",
304
+ inputSchema: { type: "object", properties: {} }
305
+ },
306
+ {
307
+ name: "stocks_list_type",
308
+ description: "Get unique type values for stocks",
309
+ inputSchema: { type: "object", properties: {} }
310
+ },
311
+ {
312
+ name: "stocks_quote",
313
+ description: "Get a stock quote",
299
314
  inputSchema: {
300
315
  type: "object",
301
316
  properties: {
302
- ticker: {
303
- type: "string",
304
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
305
- }
317
+ ticker: { type: "string", description: "Stock ticker (e.g., AAPL)" }
306
318
  },
307
319
  required: ["ticker"]
308
320
  }
309
321
  },
310
322
  {
311
- name: "sentiment_analyst",
312
- description: "Get analyst/AI sentiment for a specific ticker",
323
+ name: "stocks_prices",
324
+ description: "Get historical price data for a stock",
313
325
  inputSchema: {
314
326
  type: "object",
315
327
  properties: {
316
- ticker: {
317
- type: "string",
318
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
319
- }
328
+ ticker: { type: "string", description: "Stock ticker" },
329
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
330
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
331
+ frame: { type: "string", description: "Time frame (e.g., '1d', '1wk', '1mo')" }
320
332
  },
321
333
  required: ["ticker"]
322
334
  }
323
335
  },
324
- // Supply chain tools
336
+
337
+ // ---------- Crypto ----------
325
338
  {
326
- name: "supply_chain_customers",
327
- description: "Get supply chain customers for a specific company by ticker symbol",
339
+ name: "crypto_tickers",
340
+ description: "List cryptocurrency tickers, optionally filtered by type",
328
341
  inputSchema: {
329
342
  type: "object",
330
343
  properties: {
331
- ticker: {
332
- type: "string",
333
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
334
- }
335
- },
336
- required: ["ticker"]
344
+ type: { type: "string", description: "Filter by type (e.g., 'spot')" }
345
+ }
337
346
  }
338
347
  },
339
348
  {
340
- name: "supply_chain_peers",
341
- description: "Get supply chain peers (competitors) for a specific company by ticker symbol",
349
+ name: "crypto_gainers",
350
+ description: "Get top crypto gainers",
351
+ inputSchema: { type: "object", properties: {} }
352
+ },
353
+ {
354
+ name: "crypto_losers",
355
+ description: "Get top crypto losers",
356
+ inputSchema: { type: "object", properties: {} }
357
+ },
358
+ {
359
+ name: "crypto_list_category",
360
+ description: "Get unique category values for crypto",
361
+ inputSchema: { type: "object", properties: {} }
362
+ },
363
+ {
364
+ name: "crypto_list_rating",
365
+ description: "Get unique rating values for crypto",
366
+ inputSchema: { type: "object", properties: {} }
367
+ },
368
+ {
369
+ name: "crypto_list_type",
370
+ description: "Get unique type values for crypto",
371
+ inputSchema: { type: "object", properties: {} }
372
+ },
373
+ {
374
+ name: "crypto_quote",
375
+ description: "Get a cryptocurrency quote",
342
376
  inputSchema: {
343
377
  type: "object",
344
378
  properties: {
345
- ticker: {
346
- type: "string",
347
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
348
- }
379
+ ticker: { type: "string", description: "Crypto ticker (e.g., BTC)" }
349
380
  },
350
381
  required: ["ticker"]
351
382
  }
352
383
  },
353
384
  {
354
- name: "supply_chain_suppliers",
355
- description: "Get supply chain suppliers for a specific company by ticker symbol",
385
+ name: "crypto_prices",
386
+ description: "Get historical price data for a cryptocurrency",
356
387
  inputSchema: {
357
388
  type: "object",
358
389
  properties: {
359
- ticker: {
360
- type: "string",
361
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
362
- }
390
+ ticker: { type: "string", description: "Crypto ticker" },
391
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
392
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
393
+ frame: { type: "string", description: "Time frame (e.g., '1d', '1wk', '1mo')" }
363
394
  },
364
395
  required: ["ticker"]
365
396
  }
366
397
  },
398
+
399
+ // ---------- Forex ----------
367
400
  {
368
- name: "profiles_asset",
369
- description: "Get asset profile information for a specific ticker",
401
+ name: "forex_tickers",
402
+ description: "List forex tickers, optionally filtered by country or exchange",
370
403
  inputSchema: {
371
404
  type: "object",
372
405
  properties: {
373
- ticker: {
374
- type: "string",
375
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
376
- }
377
- },
378
- required: ["ticker"]
406
+ country: { type: "string", description: "Country code (e.g., 'US', 'AE')" },
407
+ exchange: { type: "string", description: "Exchange (e.g., 'IDC')" }
408
+ }
379
409
  }
380
410
  },
381
411
  {
382
- name: "profiles_recommendation",
383
- description: "Get recommendation trend for a specific ticker",
412
+ name: "forex_gainers",
413
+ description: "Get top forex gainers",
414
+ inputSchema: { type: "object", properties: {} }
415
+ },
416
+ {
417
+ name: "forex_losers",
418
+ description: "Get top forex losers",
419
+ inputSchema: { type: "object", properties: {} }
420
+ },
421
+ {
422
+ name: "forex_list_exchange",
423
+ description: "Get unique exchange values for forex",
424
+ inputSchema: { type: "object", properties: {} }
425
+ },
426
+ {
427
+ name: "forex_list_rating",
428
+ description: "Get unique rating values for forex",
429
+ inputSchema: { type: "object", properties: {} }
430
+ },
431
+ {
432
+ name: "forex_list_country",
433
+ description: "Get unique country values for forex",
434
+ inputSchema: { type: "object", properties: {} }
435
+ },
436
+ {
437
+ name: "forex_quote",
438
+ description: "Get a forex pair quote",
384
439
  inputSchema: {
385
440
  type: "object",
386
441
  properties: {
387
- ticker: {
388
- type: "string",
389
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
390
- }
442
+ ticker: { type: "string", description: "Forex ticker (e.g., EURUSD)" }
391
443
  },
392
444
  required: ["ticker"]
393
445
  }
394
446
  },
395
447
  {
396
- name: "profiles_cashflow",
397
- description: "Get cash flow statement history for a specific ticker",
448
+ name: "forex_prices",
449
+ description: "Get historical price data for a forex pair",
398
450
  inputSchema: {
399
451
  type: "object",
400
452
  properties: {
401
- ticker: {
402
- type: "string",
403
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
404
- }
453
+ ticker: { type: "string", description: "Forex ticker" },
454
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
455
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
456
+ frame: { type: "string", description: "Time frame (e.g., '1d', '1wk', '1mo')" }
405
457
  },
406
458
  required: ["ticker"]
407
459
  }
408
460
  },
461
+
462
+ // ---------- Futures (renamed from 'future' to 'futures') ----------
463
+ {
464
+ name: "futures_tickers",
465
+ description: "List futures tickers, optionally filtered by exchange",
466
+ inputSchema: {
467
+ type: "object",
468
+ properties: {
469
+ exchange: { type: "string", description: "Exchange (e.g., 'CME', 'CMX')" }
470
+ }
471
+ }
472
+ },
473
+ {
474
+ name: "futures_gainers",
475
+ description: "Get top futures gainers",
476
+ inputSchema: { type: "object", properties: {} }
477
+ },
478
+ {
479
+ name: "futures_losers",
480
+ description: "Get top futures losers",
481
+ inputSchema: { type: "object", properties: {} }
482
+ },
483
+ {
484
+ name: "futures_list_exchange",
485
+ description: "Get unique exchange values for futures",
486
+ inputSchema: { type: "object", properties: {} }
487
+ },
488
+ {
489
+ name: "futures_list_currency",
490
+ description: "Get unique currency values for futures",
491
+ inputSchema: { type: "object", properties: {} }
492
+ },
493
+ {
494
+ name: "futures_list_timezone",
495
+ description: "Get unique timezone values for futures",
496
+ inputSchema: { type: "object", properties: {} }
497
+ },
498
+ {
499
+ name: "futures_list_country",
500
+ description: "Get unique country values for futures",
501
+ inputSchema: { type: "object", properties: {} }
502
+ },
409
503
  {
410
- name: "profiles_trend_index",
411
- description: "Get index trend information for a specific ticker",
504
+ name: "futures_quote",
505
+ description: "Get a futures contract quote",
412
506
  inputSchema: {
413
507
  type: "object",
414
508
  properties: {
415
- ticker: {
416
- type: "string",
417
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
418
- }
509
+ ticker: { type: "string", description: "Futures ticker (e.g., 'ALI', 'M6A')" }
419
510
  },
420
511
  required: ["ticker"]
421
512
  }
422
513
  },
423
514
  {
424
- name: "profiles_statistics",
425
- description: "Get default key statistics for a specific ticker",
515
+ name: "futures_prices",
516
+ description: "Get historical price data for a futures contract",
426
517
  inputSchema: {
427
518
  type: "object",
428
519
  properties: {
429
- ticker: {
430
- type: "string",
431
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
432
- }
520
+ ticker: { type: "string", description: "Futures ticker" },
521
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
522
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
523
+ frame: { type: "string", description: "Time frame (e.g., '1d', '1wk', '1mo')" }
433
524
  },
434
525
  required: ["ticker"]
435
526
  }
436
527
  },
528
+
529
+ // ---------- Indices ----------
530
+ {
531
+ name: "indices_tickers",
532
+ description: "List index tickers, optionally filtered by exchange",
533
+ inputSchema: {
534
+ type: "object",
535
+ properties: {
536
+ exchange: { type: "string", description: "Exchange (e.g., 'ASX', 'AMS')" }
537
+ }
538
+ }
539
+ },
540
+ {
541
+ name: "indices_gainers",
542
+ description: "Get top index gainers",
543
+ inputSchema: { type: "object", properties: {} }
544
+ },
545
+ {
546
+ name: "indices_losers",
547
+ description: "Get top index losers",
548
+ inputSchema: { type: "object", properties: {} }
549
+ },
437
550
  {
438
- name: "profiles_income",
439
- description: "Get income statement history for a specific ticker",
551
+ name: "indices_list_exchange",
552
+ description: "Get unique exchange values for indices",
553
+ inputSchema: { type: "object", properties: {} }
554
+ },
555
+ {
556
+ name: "indices_list_timezone",
557
+ description: "Get unique timezone values for indices",
558
+ inputSchema: { type: "object", properties: {} }
559
+ },
560
+ {
561
+ name: "indices_list_country",
562
+ description: "Get unique country values for indices",
563
+ inputSchema: { type: "object", properties: {} }
564
+ },
565
+ {
566
+ name: "indices_quote",
567
+ description: "Get an index quote",
440
568
  inputSchema: {
441
569
  type: "object",
442
570
  properties: {
443
- ticker: {
444
- type: "string",
445
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
446
- }
571
+ ticker: { type: "string", description: "Index ticker (e.g., 'AXJO', 'AEX')" }
447
572
  },
448
573
  required: ["ticker"]
449
574
  }
450
575
  },
451
576
  {
452
- name: "profiles_fund",
453
- description: "Get fund ownership data for a specific ticker",
577
+ name: "indices_prices",
578
+ description: "Get historical price data for an index",
454
579
  inputSchema: {
455
580
  type: "object",
456
581
  properties: {
457
- ticker: {
458
- type: "string",
459
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
460
- }
582
+ ticker: { type: "string", description: "Index ticker" },
583
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
584
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
585
+ frame: { type: "string", description: "Time frame (e.g., '1d', '1wk', '1mo')" }
461
586
  },
462
587
  required: ["ticker"]
463
588
  }
464
589
  },
465
590
  {
466
- name: "profiles_summary",
467
- description: "Get summary detail information for a specific ticker",
591
+ name: "indices_components",
592
+ description: "Get the component stocks that make up an index",
468
593
  inputSchema: {
469
594
  type: "object",
470
595
  properties: {
471
- ticker: {
472
- type: "string",
473
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
474
- }
596
+ ticker: { type: "string", description: "Index ticker (e.g., 'SPX', 'AXJO')" }
475
597
  },
476
598
  required: ["ticker"]
477
599
  }
478
600
  },
479
601
  {
480
- name: "profiles_insiders",
481
- description: "Get insider holders information for a specific ticker",
602
+ name: "indices_exposure",
603
+ description: "Find which indices hold a specific ticker as a component",
482
604
  inputSchema: {
483
605
  type: "object",
484
606
  properties: {
485
- ticker: {
486
- type: "string",
487
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
488
- }
607
+ ticker: { type: "string", description: "Stock ticker to find index exposure for" }
489
608
  },
490
609
  required: ["ticker"]
491
610
  }
492
611
  },
612
+
613
+ // ---------- Economics ----------
493
614
  {
494
- name: "profiles_calendar",
495
- description: "Get calendar events for a specific ticker",
615
+ name: "econ_search",
616
+ description: "Search for economic datasets (FRED)",
496
617
  inputSchema: {
497
618
  type: "object",
498
619
  properties: {
499
- ticker: {
500
- type: "string",
501
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
502
- }
620
+ query: { type: "string", description: "Search query" }
503
621
  },
504
- required: ["ticker"]
622
+ required: ["query"]
505
623
  }
506
624
  },
507
625
  {
508
- name: "profiles_balancesheet",
509
- description: "Get balance sheet history for a specific ticker",
626
+ name: "econ_dataset",
627
+ description: "Get economic dataset time series by ID",
510
628
  inputSchema: {
511
629
  type: "object",
512
630
  properties: {
513
- ticker: {
514
- type: "string",
515
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
516
- }
631
+ id: { type: "string", description: "Dataset ID (e.g., 'PMAIZMTUSDM')" }
517
632
  },
518
- required: ["ticker"]
633
+ required: ["id"]
634
+ }
635
+ },
636
+ {
637
+ name: "econ_calendar",
638
+ description: "Get economic calendar events",
639
+ inputSchema: {
640
+ type: "object",
641
+ properties: {
642
+ from: { type: "string", description: "Start date (YYYY-MM-DD)" },
643
+ to: { type: "string", description: "End date (YYYY-MM-DD)" },
644
+ country: { type: "string", description: "Country code(s) comma-separated" },
645
+ minImportance: { type: "integer", minimum: -1, maximum: 3, description: "Minimum importance (0-3)" },
646
+ currency: { type: "string", description: "Currency code(s) comma-separated" },
647
+ category: { type: "string", description: "Category (e.g., 'gov', 'infl')" },
648
+ limit: { type: "integer", description: "Number of events to return (default 10)" }
649
+ }
519
650
  }
520
651
  },
521
652
  {
522
- name: "profiles_trend_earnings",
523
- description: "Get earnings trend for a specific ticker",
653
+ name: "econ_find",
654
+ description: "Find economic datasets using natural language description (AI-powered)",
524
655
  inputSchema: {
525
656
  type: "object",
526
657
  properties: {
527
- ticker: {
528
- type: "string",
529
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
530
- }
658
+ query: { type: "string", description: "Natural language description of the data you need" }
531
659
  },
532
- required: ["ticker"]
660
+ required: ["query"]
533
661
  }
534
662
  },
663
+
664
+ // ---------- News ----------
665
+ {
666
+ name: "news_general",
667
+ description: "Get general news headlines",
668
+ inputSchema: { type: "object", properties: {} }
669
+ },
535
670
  {
536
- name: "profiles_institution",
537
- description: "Get institution ownership data for a specific ticker",
671
+ name: "news_ticker",
672
+ description: "Get news for a specific company by ticker",
538
673
  inputSchema: {
539
674
  type: "object",
540
675
  properties: {
541
- ticker: {
542
- type: "string",
543
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
544
- }
676
+ ticker: { type: "string", description: "Stock ticker" }
545
677
  },
546
678
  required: ["ticker"]
547
679
  }
548
680
  },
549
681
  {
550
- name: "profiles_ownership",
551
- description: "Get major holders breakdown for a specific ticker",
682
+ name: "news_country",
683
+ description: "Get news for a specific country",
552
684
  inputSchema: {
553
685
  type: "object",
554
686
  properties: {
555
- ticker: {
556
- type: "string",
557
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
558
- }
687
+ country: { type: "string", description: "Country name or code" }
559
688
  },
560
- required: ["ticker"]
689
+ required: ["country"]
561
690
  }
562
691
  },
563
692
  {
564
- name: "profiles_earnings",
565
- description: "Get earnings history for a specific ticker",
693
+ name: "news_category",
694
+ description: "Get news for a specific category",
566
695
  inputSchema: {
567
696
  type: "object",
568
697
  properties: {
569
- ticker: {
570
- type: "string",
571
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
572
- }
698
+ category: { type: "string", description: "Category (e.g., 'business', 'technology')" }
573
699
  },
574
- required: ["ticker"]
700
+ required: ["category"]
575
701
  }
576
702
  },
577
703
  {
578
- name: "profiles_info",
579
- description: "Get summary profile information for a specific ticker",
704
+ name: "news_article",
705
+ description: "Get the full URL for a news article by its encoded ID",
580
706
  inputSchema: {
581
707
  type: "object",
582
708
  properties: {
583
- ticker: {
584
- type: "string",
585
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
586
- }
709
+ id: { type: "string", description: "Article ID from news results" }
587
710
  },
588
- required: ["ticker"]
711
+ required: ["id"]
589
712
  }
590
713
  },
714
+
715
+ // ---------- Sentiment ----------
591
716
  {
592
- name: "profiles_activity",
593
- description: "Get net share purchase activity for a specific ticker",
717
+ name: "sentiment_all",
718
+ description: "Get combined sentiment (social, news, analyst) for a ticker",
594
719
  inputSchema: {
595
720
  type: "object",
596
721
  properties: {
597
- ticker: {
598
- type: "string",
599
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
600
- }
722
+ ticker: { type: "string", description: "Stock ticker" }
601
723
  },
602
724
  required: ["ticker"]
603
725
  }
604
726
  },
605
727
  {
606
- name: "profiles_transactions",
607
- description: "Get insider transactions for a specific ticker",
728
+ name: "sentiment_social",
729
+ description: "Get social media sentiment for a ticker",
608
730
  inputSchema: {
609
731
  type: "object",
610
732
  properties: {
611
- ticker: {
612
- type: "string",
613
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
614
- }
733
+ ticker: { type: "string", description: "Stock ticker" }
615
734
  },
616
735
  required: ["ticker"]
617
736
  }
618
737
  },
619
738
  {
620
- name: "profiles_financials",
621
- description: "Get financial data for a specific ticker",
739
+ name: "sentiment_news",
740
+ description: "Get news sentiment for a ticker",
622
741
  inputSchema: {
623
742
  type: "object",
624
743
  properties: {
625
- ticker: {
626
- type: "string",
627
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
628
- }
744
+ ticker: { type: "string", description: "Stock ticker" }
629
745
  },
630
746
  required: ["ticker"]
631
747
  }
632
748
  },
633
749
  {
634
- name: "profiles_traffic",
635
- description: "Get website traffic data for a specific ticker",
750
+ name: "sentiment_analyst",
751
+ description: "Get analyst/AI sentiment for a ticker",
636
752
  inputSchema: {
637
753
  type: "object",
638
754
  properties: {
639
- ticker: {
640
- type: "string",
641
- description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
642
- }
755
+ ticker: { type: "string", description: "Stock ticker" }
643
756
  },
644
757
  required: ["ticker"]
645
758
  }
646
759
  },
647
760
 
761
+ // ---------- Profiles ----------
648
762
  {
649
- name: "crypto_tickers",
650
- description: "Get list of cryptocurrency tickers, optionally filtered by type",
763
+ name: "profiles_profile",
764
+ description: "Get full asset profile for a ticker",
651
765
  inputSchema: {
652
766
  type: "object",
653
767
  properties: {
654
- type: {
655
- type: "string",
656
- description: "Filter by type (e.g., 'spot')"
657
- }
658
- }
768
+ ticker: { type: "string", description: "Stock ticker" }
769
+ },
770
+ required: ["ticker"]
659
771
  }
660
772
  },
661
773
  {
662
- name: "crypto_quote",
663
- description: "Get details for a specific cryptocurrency by ticker symbol",
774
+ name: "profiles_recommendation",
775
+ description: "Get recommendation trend for a ticker",
664
776
  inputSchema: {
665
777
  type: "object",
666
778
  properties: {
667
- ticker: {
668
- type: "string",
669
- description: "Cryptocurrency ticker symbol (e.g., 'BTC', 'ETH')"
670
- }
779
+ ticker: { type: "string", description: "Stock ticker" }
671
780
  },
672
781
  required: ["ticker"]
673
782
  }
674
783
  },
675
784
  {
676
- name: "crypto_prices",
677
- description: "Get historical price data for a cryptocurrency ticker",
785
+ name: "profiles_statistics",
786
+ description: "Get key statistics for a ticker",
678
787
  inputSchema: {
679
788
  type: "object",
680
789
  properties: {
681
- ticker: {
682
- type: "string",
683
- description: "Cryptocurrency ticker symbol (e.g., 'BTC', 'ETH')"
684
- }
790
+ ticker: { type: "string", description: "Stock ticker" }
685
791
  },
686
792
  required: ["ticker"]
687
793
  }
688
794
  },
689
795
  {
690
- name: "forex_tickers",
691
- description: "Get list of forex tickers with optional filtering by country or exchange",
796
+ name: "profiles_summary",
797
+ description: "Get summary detail for a ticker",
692
798
  inputSchema: {
693
799
  type: "object",
694
800
  properties: {
695
- country: {
696
- type: "string",
697
- description: "Filter by country code (e.g., 'US', 'AE')"
698
- },
699
- exchange: {
700
- type: "string",
701
- description: "Filter by exchange (e.g., 'IDC')"
702
- }
703
- }
801
+ ticker: { type: "string", description: "Stock ticker" }
802
+ },
803
+ required: ["ticker"]
704
804
  }
705
805
  },
706
806
  {
707
- name: "forex_quote",
708
- description: "Get details for a specific forex pair by ticker symbol",
807
+ name: "profiles_calendar",
808
+ description: "Get calendar events (earnings, dividends) for a ticker",
709
809
  inputSchema: {
710
810
  type: "object",
711
811
  properties: {
712
- ticker: {
713
- type: "string",
714
- description: "Forex ticker symbol (e.g., 'AEDAUD', 'EURUSD')"
715
- }
812
+ ticker: { type: "string", description: "Stock ticker" }
716
813
  },
717
814
  required: ["ticker"]
718
815
  }
719
816
  },
720
817
  {
721
- name: "forex_prices",
722
- description: "Get historical price data for a forex ticker",
818
+ name: "profiles_info",
819
+ description: "Get company info / summary profile for a ticker",
723
820
  inputSchema: {
724
821
  type: "object",
725
822
  properties: {
726
- ticker: {
727
- type: "string",
728
- description: "Forex ticker symbol (e.g., 'AEDAUD', 'EURUSD')"
729
- }
823
+ ticker: { type: "string", description: "Stock ticker" }
730
824
  },
731
825
  required: ["ticker"]
732
826
  }
733
827
  },
828
+
829
+ // ---------- Earnings ----------
734
830
  {
735
- name: "future_tickers",
736
- description: "Get list of futures tickers with optional filtering by exchange",
831
+ name: "earnings_history",
832
+ description: "Get earnings history for a ticker",
737
833
  inputSchema: {
738
834
  type: "object",
739
835
  properties: {
740
- exchange: {
741
- type: "string",
742
- description: "Filter by exchange (e.g., 'CME', 'CMX')"
743
- }
744
- }
836
+ ticker: { type: "string", description: "Stock ticker" }
837
+ },
838
+ required: ["ticker"]
745
839
  }
746
840
  },
747
841
  {
748
- name: "future_quote",
749
- description: "Get details for a specific futures contract by ticker symbol",
842
+ name: "earnings_trend",
843
+ description: "Get earnings trend for a ticker",
750
844
  inputSchema: {
751
845
  type: "object",
752
846
  properties: {
753
- ticker: {
754
- type: "string",
755
- description: "Futures ticker symbol (e.g., 'ALI', 'M6A', 'BTC')"
756
- }
847
+ ticker: { type: "string", description: "Stock ticker" }
757
848
  },
758
849
  required: ["ticker"]
759
850
  }
760
851
  },
761
852
  {
762
- name: "future_prices",
763
- description: "Get historical price data for a futures contract",
853
+ name: "earnings_index",
854
+ description: "Get index trend for a ticker",
764
855
  inputSchema: {
765
856
  type: "object",
766
857
  properties: {
767
- ticker: {
768
- type: "string",
769
- description: "Futures ticker symbol (e.g., 'ALI', 'M6A', 'BTC')"
770
- }
858
+ ticker: { type: "string", description: "Stock ticker" }
771
859
  },
772
860
  required: ["ticker"]
773
861
  }
774
862
  },
775
863
  {
776
- name: "indices_tickers",
777
- description: "Get list of index tickers with optional filtering by exchange",
864
+ name: "earnings_report",
865
+ description: "Get earnings report for a specific year and quarter",
778
866
  inputSchema: {
779
867
  type: "object",
780
868
  properties: {
781
- exchange: {
782
- type: "string",
783
- description: "Filter by exchange (e.g., 'ASX', 'AMS', 'VIE')"
784
- }
785
- }
869
+ ticker: { type: "string", description: "Stock ticker" },
870
+ year: { type: "string", description: "Year (e.g., '2024')" },
871
+ quarter: { type: "string", description: "Quarter (e.g., 'Q1')" }
872
+ },
873
+ required: ["ticker", "year", "quarter"]
786
874
  }
787
875
  },
788
876
  {
789
- name: "indices_quote",
790
- description: "Get details for a specific index by ticker symbol",
877
+ name: "earnings_transcript",
878
+ description: "Get earnings call transcript for a ticker, year, and quarter",
791
879
  inputSchema: {
792
880
  type: "object",
793
881
  properties: {
794
- ticker: {
795
- type: "string",
796
- description: "Index ticker symbol (e.g., 'AXJO', 'AEX', 'ATX')"
797
- }
882
+ ticker: { type: "string", description: "Stock ticker" },
883
+ year: { type: "string", description: "Year (e.g., '2024')" },
884
+ quarter: { type: "string", description: "Quarter (e.g., '2')" }
798
885
  },
799
- required: ["ticker"]
886
+ required: ["ticker", "year", "quarter"]
800
887
  }
801
888
  },
802
889
  {
803
- name: "indices_prices",
804
- description: "Get historical price data for an index",
890
+ name: "earnings_transcript_sentiment",
891
+ description: "Get sentiment analysis of an earnings call transcript",
805
892
  inputSchema: {
806
893
  type: "object",
807
894
  properties: {
808
- ticker: {
809
- type: "string",
810
- description: "Index ticker symbol (e.g., 'AXJO', 'AEX', 'ATX')"
811
- }
895
+ ticker: { type: "string", description: "Stock ticker" },
896
+ year: { type: "string", description: "Year (e.g., '2024')" },
897
+ quarter: { type: "string", description: "Quarter (e.g., '2')" }
812
898
  },
813
- required: ["ticker"]
899
+ required: ["ticker", "year", "quarter"]
814
900
  }
815
901
  },
816
902
 
903
+ // ---------- Filings ----------
817
904
  {
818
- name: "stocks_tickers",
819
- description: "Get list of stock tickers with optional filtering by country or exchange",
905
+ name: "filings_recent",
906
+ description: "Get recent SEC filings for a company",
820
907
  inputSchema: {
821
908
  type: "object",
822
909
  properties: {
823
- country: {
824
- type: "string",
825
- description: "Filter by country (e.g., 'america')"
826
- },
827
- exchange: {
828
- type: "string",
829
- description: "Filter by exchange (e.g., 'NASDAQ', 'AMEX', 'OTC')"
830
- }
831
- }
910
+ ticker: { type: "string", description: "Stock ticker" },
911
+ limit: { type: "integer", description: "Number of filings to return" },
912
+ form: { type: "string", description: "Filter by form type (e.g., '10-K')" }
913
+ },
914
+ required: ["ticker"]
832
915
  }
833
916
  },
834
917
  {
835
- name: "stocks_quote",
836
- description: "Get details for a specific stock by ticker symbol",
918
+ name: "filings_forms",
919
+ description: "Get specific SEC form type filings for a company",
837
920
  inputSchema: {
838
921
  type: "object",
839
922
  properties: {
840
- ticker: {
841
- type: "string",
842
- description: "Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'TSLA')"
843
- }
923
+ ticker: { type: "string", description: "Stock ticker" },
924
+ formType: { type: "string", description: "Form type (e.g., '10-K', '8-K')" },
925
+ year: { type: "string", description: "Filter by year" },
926
+ quarter: { type: "string", description: "Filter by quarter" },
927
+ limit: { type: "integer", description: "Number of filings to return" }
844
928
  },
845
- required: ["ticker"]
929
+ required: ["ticker", "formType"]
846
930
  }
847
931
  },
848
932
  {
849
- name: "stocks_prices",
850
- description: "Get historical price data for a stock",
933
+ name: "filings_desc_forms",
934
+ description: "List available SEC form types and their descriptions",
935
+ inputSchema: { type: "object", properties: {} }
936
+ },
937
+ {
938
+ name: "filings_search",
939
+ description: "Search filings by year/quarter",
851
940
  inputSchema: {
852
941
  type: "object",
853
942
  properties: {
854
- ticker: {
855
- type: "string",
856
- description: "Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'TSLA')"
857
- }
943
+ year: { type: "string", description: "Year (e.g., '2024')" },
944
+ quarter: { type: "string", description: "Quarter (e.g., 'Q1')" },
945
+ form: { type: "string", description: "Form type filter" },
946
+ ticker: { type: "string", description: "Ticker filter" }
858
947
  },
859
- required: ["ticker"]
948
+ required: ["year", "quarter"]
860
949
  }
861
- }
862
-
863
-
864
- ],
865
- };
866
- });
867
-
868
- /**
869
- * Handle tool execution
870
- */
871
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
872
- const { name, arguments: args } = request.params;
873
-
874
- try {
875
- let result;
876
- let endpoint;
877
-
878
- switch (name) {
879
- case "credit_search":
880
- // Build query parameters for search
881
- const queryParams = buildQueryString({
882
- query: args.query,
883
- });
884
- endpoint = `credit/search${queryParams}`;
885
- result = await makeApiRequest(endpoint, { method: 'GET' });
886
- break;
887
-
888
- case "credit_ratings":
889
- if (!args.id) {
890
- throw new Error("Organization ID is required");
891
- }
892
- endpoint = `credit/ratings/${args.id}`;
893
- result = await makeApiRequest(endpoint, { method: 'GET' });
894
- break;
895
-
896
- case "econ_search":
897
- if (!args.query) {
898
- throw new Error("Search query is required");
899
- }
900
- endpoint = `econ/search${buildQueryString({ query: args.query })}`;
901
- result = await makeApiRequest(endpoint, { method: 'GET' });
902
- break;
903
-
904
- case "econ_dataset":
905
- if (!args.id) {
906
- throw new Error("Dataset ID is required");
907
- }
908
- endpoint = `econ/dataset/${args.id}`;
909
- result = await makeApiRequest(endpoint, { method: 'GET' });
910
- break;
911
-
912
- case "econ_calendar":
913
- endpoint = `econ/calendar${buildQueryString({
914
- from: args.from,
915
- to: args.to,
916
- country: args.country,
917
- minImportance: args.minImportance,
918
- currency: args.currency,
919
- category: args.category
920
- })}`;
921
- result = await makeApiRequest(endpoint, { method: 'GET' });
922
- break;
923
-
924
- case "esg_data":
925
- if (!args.ticker) {
926
- throw new Error("Ticker symbol is required");
950
+ },
951
+ {
952
+ name: "filings_document_text",
953
+ description: "Get the full text of an SEC filing document by its document ID",
954
+ inputSchema: {
955
+ type: "object",
956
+ properties: {
957
+ documentId: { type: "string", description: "Document ID (base64-encoded URL) from filing results" }
958
+ },
959
+ required: ["documentId"]
927
960
  }
928
- endpoint = `esg/${args.ticker}`;
929
- result = await makeApiRequest(endpoint, { method: 'GET' });
930
- break;
931
-
932
- case "etf_fund":
933
- if (!args.ticker) {
934
- throw new Error("ETF ticker symbol is required");
961
+ },
962
+ {
963
+ name: "filings_document_sentiment",
964
+ description: "Get sentiment analysis of an SEC filing document",
965
+ inputSchema: {
966
+ type: "object",
967
+ properties: {
968
+ documentId: { type: "string", description: "Document ID (base64-encoded URL) from filing results" }
969
+ },
970
+ required: ["documentId"]
935
971
  }
936
- endpoint = `etf/${args.ticker}/fund`;
937
- result = await makeApiRequest(endpoint, { method: 'GET' });
938
- break;
972
+ },
939
973
 
940
- case "etf_weights":
941
- if (!args.ticker) {
942
- throw new Error("ETF ticker symbol is required");
974
+ // ---------- Financials ----------
975
+ {
976
+ name: "financials_revenue",
977
+ description: "Get historical revenue for a ticker",
978
+ inputSchema: {
979
+ type: "object",
980
+ properties: {
981
+ ticker: { type: "string", description: "Stock ticker" },
982
+ periods: { type: "integer", description: "Number of periods to return" }
983
+ },
984
+ required: ["ticker"]
943
985
  }
944
- endpoint = `etf/${args.ticker}/weights`;
945
- result = await makeApiRequest(endpoint, { method: 'GET' });
946
- break;
947
-
948
- case "etf_holdings":
949
- if (!args.ticker) {
950
- throw new Error("ETF ticker symbol is required");
986
+ },
987
+ {
988
+ name: "financials_net_income",
989
+ description: "Get historical net income for a ticker",
990
+ inputSchema: {
991
+ type: "object",
992
+ properties: {
993
+ ticker: { type: "string", description: "Stock ticker" },
994
+ periods: { type: "integer", description: "Number of periods" }
995
+ },
996
+ required: ["ticker"]
951
997
  }
952
- endpoint = `etf/${args.ticker}/holdings`;
953
- result = await makeApiRequest(endpoint, { method: 'GET' });
954
- break;
955
-
956
- case "etf_exposure":
957
- if (!args.ticker) {
958
- throw new Error("Ticker symbol is required");
998
+ },
999
+ {
1000
+ name: "financials_total_assets",
1001
+ description: "Get historical total assets",
1002
+ inputSchema: {
1003
+ type: "object",
1004
+ properties: {
1005
+ ticker: { type: "string", description: "Stock ticker" },
1006
+ periods: { type: "integer", description: "Number of periods" }
1007
+ },
1008
+ required: ["ticker"]
959
1009
  }
960
- endpoint = `etf/${args.ticker}/exposure`;
961
- result = await makeApiRequest(endpoint, { method: 'GET' });
962
- break;
963
-
964
- // News handlers
965
- case "news_ticker":
966
- if (!args.ticker) {
967
- throw new Error("Ticker symbol is required");
968
- }
969
- endpoint = `news/${args.ticker}`;
970
- result = await makeApiRequest(endpoint, { method: 'GET' });
971
- break;
972
-
973
- case "news_country":
974
- if (!args.country) {
975
- throw new Error("Country parameter is required");
1010
+ },
1011
+ {
1012
+ name: "financials_total_liabilities",
1013
+ description: "Get historical total liabilities",
1014
+ inputSchema: {
1015
+ type: "object",
1016
+ properties: {
1017
+ ticker: { type: "string", description: "Stock ticker" },
1018
+ periods: { type: "integer", description: "Number of periods" }
1019
+ },
1020
+ required: ["ticker"]
976
1021
  }
977
- endpoint = `news/country/${encodeURIComponent(args.country)}`;
978
- result = await makeApiRequest(endpoint, { method: 'GET' });
979
- break;
980
-
981
- case "news_category":
982
- if (!args.category) {
983
- throw new Error("Category parameter is required");
1022
+ },
1023
+ {
1024
+ name: "financials_stockholders_equity",
1025
+ description: "Get historical stockholders equity",
1026
+ inputSchema: {
1027
+ type: "object",
1028
+ properties: {
1029
+ ticker: { type: "string", description: "Stock ticker" },
1030
+ periods: { type: "integer", description: "Number of periods" }
1031
+ },
1032
+ required: ["ticker"]
984
1033
  }
985
- endpoint = `news/category/${encodeURIComponent(args.category)}`;
986
- result = await makeApiRequest(endpoint, { method: 'GET' });
987
- break;
988
-
989
- case "news_general":
990
- endpoint = `news`;
991
- result = await makeApiRequest(endpoint, { method: 'GET' });
992
- break;
993
-
994
- // Sentiment analysis handlers
995
- case "sentiment_social":
996
- if (!args.ticker) {
997
- throw new Error("Ticker symbol is required");
998
- }
999
- endpoint = `sentiment/${args.ticker}/social`;
1000
- result = await makeApiRequest(endpoint, { method: 'GET' });
1001
- break;
1002
-
1003
- case "sentiment_news":
1004
- if (!args.ticker) {
1005
- throw new Error("Ticker symbol is required");
1034
+ },
1035
+ {
1036
+ name: "financials_current_assets",
1037
+ description: "Get historical current assets",
1038
+ inputSchema: {
1039
+ type: "object",
1040
+ properties: {
1041
+ ticker: { type: "string", description: "Stock ticker" },
1042
+ periods: { type: "integer", description: "Number of periods" }
1043
+ },
1044
+ required: ["ticker"]
1006
1045
  }
1007
- endpoint = `sentiment/${args.ticker}/news`;
1008
- result = await makeApiRequest(endpoint, { method: 'GET' });
1009
- break;
1010
-
1011
- case "sentiment_analyst":
1012
- if (!args.ticker) {
1013
- throw new Error("Ticker symbol is required");
1046
+ },
1047
+ {
1048
+ name: "financials_current_liabilities",
1049
+ description: "Get historical current liabilities",
1050
+ inputSchema: {
1051
+ type: "object",
1052
+ properties: {
1053
+ ticker: { type: "string", description: "Stock ticker" },
1054
+ periods: { type: "integer", description: "Number of periods" }
1055
+ },
1056
+ required: ["ticker"]
1014
1057
  }
1015
- endpoint = `sentiment/${args.ticker}/analyst`;
1016
- result = await makeApiRequest(endpoint, { method: 'GET' });
1017
- break;
1018
-
1019
- // Supply chain handlers
1020
- case "supply_chain_customers":
1021
- if (!args.ticker) {
1022
- throw new Error("Ticker symbol is required");
1023
- }
1024
- endpoint = `supply-chain/${args.ticker}/customers`;
1025
- result = await makeApiRequest(endpoint, { method: 'GET' });
1026
- break;
1027
-
1028
- case "supply_chain_peers":
1029
- if (!args.ticker) {
1030
- throw new Error("Ticker symbol is required");
1058
+ },
1059
+ {
1060
+ name: "financials_operating_cash_flow",
1061
+ description: "Get historical operating cash flow",
1062
+ inputSchema: {
1063
+ type: "object",
1064
+ properties: {
1065
+ ticker: { type: "string", description: "Stock ticker" },
1066
+ periods: { type: "integer", description: "Number of periods" }
1067
+ },
1068
+ required: ["ticker"]
1031
1069
  }
1032
- endpoint = `supply-chain/${args.ticker}/peers`;
1033
- result = await makeApiRequest(endpoint, { method: 'GET' });
1034
- break;
1035
-
1036
- case "supply_chain_suppliers":
1037
- if (!args.ticker) {
1038
- throw new Error("Ticker symbol is required");
1070
+ },
1071
+ {
1072
+ name: "financials_capital_expenditures",
1073
+ description: "Get historical capital expenditures",
1074
+ inputSchema: {
1075
+ type: "object",
1076
+ properties: {
1077
+ ticker: { type: "string", description: "Stock ticker" },
1078
+ periods: { type: "integer", description: "Number of periods" }
1079
+ },
1080
+ required: ["ticker"]
1039
1081
  }
1040
- endpoint = `supply-chain/${args.ticker}/suppliers`;
1041
- result = await makeApiRequest(endpoint, { method: 'GET' });
1042
- break;
1043
-
1044
- case "profiles_asset":
1045
- if (!args.ticker) {
1046
- throw new Error("Ticker symbol is required");
1082
+ },
1083
+ {
1084
+ name: "financials_free_cash_flow",
1085
+ description: "Get historical free cash flow",
1086
+ inputSchema: {
1087
+ type: "object",
1088
+ properties: {
1089
+ ticker: { type: "string", description: "Stock ticker" },
1090
+ periods: { type: "integer", description: "Number of periods" }
1091
+ },
1092
+ required: ["ticker"]
1047
1093
  }
1048
- endpoint = `profiles/${args.ticker}/asset`;
1049
- result = await makeApiRequest(endpoint, { method: 'GET' });
1050
- break;
1051
-
1052
- case "profiles_recommendation":
1053
- if (!args.ticker) {
1054
- throw new Error("Ticker symbol is required");
1094
+ },
1095
+ {
1096
+ name: "financials_shares_outstanding_basic",
1097
+ description: "Get historical basic shares outstanding",
1098
+ inputSchema: {
1099
+ type: "object",
1100
+ properties: {
1101
+ ticker: { type: "string", description: "Stock ticker" },
1102
+ periods: { type: "integer", description: "Number of periods" }
1103
+ },
1104
+ required: ["ticker"]
1055
1105
  }
1056
- endpoint = `profiles/${args.ticker}/recommendation`;
1057
- result = await makeApiRequest(endpoint, { method: 'GET' });
1058
- break;
1059
-
1060
- case "profiles_cashflow":
1061
- if (!args.ticker) {
1062
- throw new Error("Ticker symbol is required");
1106
+ },
1107
+ {
1108
+ name: "financials_shares_outstanding_diluted",
1109
+ description: "Get historical diluted shares outstanding",
1110
+ inputSchema: {
1111
+ type: "object",
1112
+ properties: {
1113
+ ticker: { type: "string", description: "Stock ticker" },
1114
+ periods: { type: "integer", description: "Number of periods" }
1115
+ },
1116
+ required: ["ticker"]
1063
1117
  }
1064
- endpoint = `profiles/${args.ticker}/cashflow`;
1065
- result = await makeApiRequest(endpoint, { method: 'GET' });
1066
- break;
1067
-
1068
- case "profiles_trend_index":
1069
- if (!args.ticker) {
1070
- throw new Error("Ticker symbol is required");
1118
+ },
1119
+ {
1120
+ name: "financials_metrics",
1121
+ description: "Get calculated financial metrics for a ticker",
1122
+ inputSchema: {
1123
+ type: "object",
1124
+ properties: {
1125
+ ticker: { type: "string", description: "Stock ticker" }
1126
+ },
1127
+ required: ["ticker"]
1071
1128
  }
1072
- endpoint = `profiles/${args.ticker}/trend/index`;
1073
- result = await makeApiRequest(endpoint, { method: 'GET' });
1074
- break;
1075
-
1076
- case "profiles_statistics":
1077
- if (!args.ticker) {
1078
- throw new Error("Ticker symbol is required");
1129
+ },
1130
+ {
1131
+ name: "financials_snapshot",
1132
+ description: "Get a snapshot of key financial data",
1133
+ inputSchema: {
1134
+ type: "object",
1135
+ properties: {
1136
+ ticker: { type: "string", description: "Stock ticker" }
1137
+ },
1138
+ required: ["ticker"]
1079
1139
  }
1080
- endpoint = `profiles/${args.ticker}/statistics`;
1081
- result = await makeApiRequest(endpoint, { method: 'GET' });
1082
- break;
1083
-
1084
- case "profiles_income":
1085
- if (!args.ticker) {
1086
- throw new Error("Ticker symbol is required");
1140
+ },
1141
+ {
1142
+ name: "financials_balance_sheet",
1143
+ description: "Get balance sheet statement for a ticker (optionally by year/quarter)",
1144
+ inputSchema: {
1145
+ type: "object",
1146
+ properties: {
1147
+ ticker: { type: "string", description: "Stock ticker" },
1148
+ year: { type: "integer", description: "Year (e.g., 2024)" },
1149
+ quarter: { type: "integer", description: "Quarter (1-4)" }
1150
+ },
1151
+ required: ["ticker"]
1087
1152
  }
1088
- endpoint = `profiles/${args.ticker}/income`;
1089
- result = await makeApiRequest(endpoint, { method: 'GET' });
1090
- break;
1091
-
1092
- case "profiles_fund":
1093
- if (!args.ticker) {
1094
- throw new Error("Ticker symbol is required");
1153
+ },
1154
+ {
1155
+ name: "financials_income_statement",
1156
+ description: "Get income statement for a ticker (optionally by year/quarter)",
1157
+ inputSchema: {
1158
+ type: "object",
1159
+ properties: {
1160
+ ticker: { type: "string", description: "Stock ticker" },
1161
+ year: { type: "integer", description: "Year (e.g., 2024)" },
1162
+ quarter: { type: "integer", description: "Quarter (1-4)" }
1163
+ },
1164
+ required: ["ticker"]
1095
1165
  }
1096
- endpoint = `profiles/${args.ticker}/fund`;
1097
- result = await makeApiRequest(endpoint, { method: 'GET' });
1098
- break;
1099
-
1100
- case "profiles_summary":
1101
- if (!args.ticker) {
1102
- throw new Error("Ticker symbol is required");
1166
+ },
1167
+ {
1168
+ name: "financials_cash_flow_statement",
1169
+ description: "Get cash flow statement for a ticker (optionally by year/quarter)",
1170
+ inputSchema: {
1171
+ type: "object",
1172
+ properties: {
1173
+ ticker: { type: "string", description: "Stock ticker" },
1174
+ year: { type: "integer", description: "Year (e.g., 2024)" },
1175
+ quarter: { type: "integer", description: "Quarter (1-4)" }
1176
+ },
1177
+ required: ["ticker"]
1103
1178
  }
1104
- endpoint = `profiles/${args.ticker}/summary`;
1105
- result = await makeApiRequest(endpoint, { method: 'GET' });
1106
- break;
1179
+ },
1107
1180
 
1108
- case "profiles_insiders":
1109
- if (!args.ticker) {
1110
- throw new Error("Ticker symbol is required");
1181
+ // ---------- Insiders / Ownership ----------
1182
+ {
1183
+ name: "insiders_funds",
1184
+ description: "Get fund ownership data for a ticker",
1185
+ inputSchema: {
1186
+ type: "object",
1187
+ properties: {
1188
+ ticker: { type: "string", description: "Stock ticker" }
1189
+ },
1190
+ required: ["ticker"]
1111
1191
  }
1112
- endpoint = `profiles/${args.ticker}/insiders`;
1113
- result = await makeApiRequest(endpoint, { method: 'GET' });
1114
- break;
1115
-
1116
- case "profiles_calendar":
1117
- if (!args.ticker) {
1118
- throw new Error("Ticker symbol is required");
1192
+ },
1193
+ {
1194
+ name: "insiders_individuals",
1195
+ description: "Get insider holders (individuals) for a ticker",
1196
+ inputSchema: {
1197
+ type: "object",
1198
+ properties: {
1199
+ ticker: { type: "string", description: "Stock ticker" }
1200
+ },
1201
+ required: ["ticker"]
1119
1202
  }
1120
- endpoint = `profiles/${args.ticker}/calendar`;
1121
- result = await makeApiRequest(endpoint, { method: 'GET' });
1122
- break;
1123
-
1124
- case "profiles_balancesheet":
1125
- if (!args.ticker) {
1126
- throw new Error("Ticker symbol is required");
1203
+ },
1204
+ {
1205
+ name: "insiders_institutions",
1206
+ description: "Get institutional ownership data",
1207
+ inputSchema: {
1208
+ type: "object",
1209
+ properties: {
1210
+ ticker: { type: "string", description: "Stock ticker" }
1211
+ },
1212
+ required: ["ticker"]
1127
1213
  }
1128
- endpoint = `profiles/${args.ticker}/balancesheet`;
1129
- result = await makeApiRequest(endpoint, { method: 'GET' });
1130
- break;
1131
-
1132
- case "profiles_trend_earnings":
1133
- if (!args.ticker) {
1134
- throw new Error("Ticker symbol is required");
1214
+ },
1215
+ {
1216
+ name: "insiders_ownership",
1217
+ description: "Get major holders breakdown",
1218
+ inputSchema: {
1219
+ type: "object",
1220
+ properties: {
1221
+ ticker: { type: "string", description: "Stock ticker" }
1222
+ },
1223
+ required: ["ticker"]
1135
1224
  }
1136
- endpoint = `profiles/${args.ticker}/trend/earnings`;
1137
- result = await makeApiRequest(endpoint, { method: 'GET' });
1138
- break;
1139
-
1140
- case "profiles_institution":
1141
- if (!args.ticker) {
1142
- throw new Error("Ticker symbol is required");
1225
+ },
1226
+ {
1227
+ name: "insiders_activity",
1228
+ description: "Get net share purchase activity",
1229
+ inputSchema: {
1230
+ type: "object",
1231
+ properties: {
1232
+ ticker: { type: "string", description: "Stock ticker" }
1233
+ },
1234
+ required: ["ticker"]
1143
1235
  }
1144
- endpoint = `profiles/${args.ticker}/institution`;
1145
- result = await makeApiRequest(endpoint, { method: 'GET' });
1146
- break;
1147
-
1148
- case "profiles_ownership":
1149
- if (!args.ticker) {
1150
- throw new Error("Ticker symbol is required");
1236
+ },
1237
+ {
1238
+ name: "insiders_transactions",
1239
+ description: "Get insider transactions",
1240
+ inputSchema: {
1241
+ type: "object",
1242
+ properties: {
1243
+ ticker: { type: "string", description: "Stock ticker" }
1244
+ },
1245
+ required: ["ticker"]
1151
1246
  }
1152
- endpoint = `profiles/${args.ticker}/ownership`;
1153
- result = await makeApiRequest(endpoint, { method: 'GET' });
1154
- break;
1247
+ },
1155
1248
 
1156
- case "profiles_earnings":
1157
- if (!args.ticker) {
1158
- throw new Error("Ticker symbol is required");
1249
+ // ---------- Web Traffic ----------
1250
+ {
1251
+ name: "webtraffic_traffic",
1252
+ description: "Get website traffic data for a company",
1253
+ inputSchema: {
1254
+ type: "object",
1255
+ properties: {
1256
+ ticker: { type: "string", description: "Stock ticker" }
1257
+ },
1258
+ required: ["ticker"]
1159
1259
  }
1160
- endpoint = `profiles/${args.ticker}/earnings`;
1161
- result = await makeApiRequest(endpoint, { method: 'GET' });
1162
- break;
1260
+ }
1261
+ ],
1262
+ };
1263
+ });
1163
1264
 
1164
- case "profiles_info":
1165
- if (!args.ticker) {
1166
- throw new Error("Ticker symbol is required");
1167
- }
1168
- endpoint = `profiles/${args.ticker}/info`;
1169
- result = await makeApiRequest(endpoint, { method: 'GET' });
1170
- break;
1265
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1266
+ const { name, arguments: args } = request.params;
1171
1267
 
1172
- case "profiles_activity":
1173
- if (!args.ticker) {
1174
- throw new Error("Ticker symbol is required");
1175
- }
1176
- endpoint = `profiles/${args.ticker}/activity`;
1177
- result = await makeApiRequest(endpoint, { method: 'GET' });
1178
- break;
1268
+ try {
1269
+ let result;
1270
+ let endpoint;
1179
1271
 
1180
- case "profiles_transactions":
1181
- if (!args.ticker) {
1182
- throw new Error("Ticker symbol is required");
1183
- }
1184
- endpoint = `profiles/${args.ticker}/transactions`;
1185
- result = await makeApiRequest(endpoint, { method: 'GET' });
1186
- break;
1272
+ // ---------- Credit ----------
1273
+ if (name === "credit_search") {
1274
+ endpoint = `credit/search${buildQueryString({ query: args.query })}`;
1275
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1276
+ }
1277
+ else if (name === "credit_ratings") {
1278
+ endpoint = `credit/ratings/${args.id}`;
1279
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1280
+ }
1187
1281
 
1188
- case "profiles_financials":
1189
- if (!args.ticker) {
1190
- throw new Error("Ticker symbol is required");
1191
- }
1192
- endpoint = `profiles/${args.ticker}/financials`;
1193
- result = await makeApiRequest(endpoint, { method: 'GET' });
1194
- break;
1282
+ // ---------- ESG ----------
1283
+ else if (name === "esg_data") {
1284
+ endpoint = `esg/${args.ticker}`;
1285
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1286
+ }
1195
1287
 
1196
- case "profiles_traffic":
1197
- if (!args.ticker) {
1198
- throw new Error("Ticker symbol is required");
1199
- }
1200
- endpoint = `profiles/${args.ticker}/traffic`;
1201
- result = await makeApiRequest(endpoint, { method: 'GET' });
1202
- break;
1288
+ // ---------- ETF (plural endpoints) ----------
1203
1289
 
1290
+ else if (name === "etf_tickers") {
1291
+ endpoint = `etfs/tickers${buildQueryString({ country: args.country, exchange: args.exchange })}`;
1292
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1293
+ }
1294
+ else if (name === "etf_gainers") {
1295
+ endpoint = `etfs/gainers`;
1296
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1297
+ }
1298
+ else if (name === "etf_losers") {
1299
+ endpoint = `etfs/losers`;
1300
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1301
+ }
1302
+ else if (name === "etf_list_market") {
1303
+ endpoint = `etfs/list/market`;
1304
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1305
+ }
1306
+ else if (name === "etf_list_country") {
1307
+ endpoint = `etfs/list/country`;
1308
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1309
+ }
1310
+ else if (name === "etf_list_currency") {
1311
+ endpoint = `etfs/list/currency`;
1312
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1313
+ }
1314
+ else if (name === "etf_list_sector") {
1315
+ endpoint = `etfs/list/sector`;
1316
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1317
+ }
1318
+ else if (name === "etf_list_industry") {
1319
+ endpoint = `etfs/list/industry`;
1320
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1321
+ }
1322
+ else if (name === "etf_list_type") {
1323
+ endpoint = `etfs/list/type`;
1324
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1325
+ }
1326
+ else if (name === "etf_quote") {
1327
+ endpoint = `etfs/${args.ticker}/quote`;
1328
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1329
+ }
1330
+ else if (name === "etf_prices") {
1331
+ endpoint = `etfs/${args.ticker}/prices${buildQueryString({ from: args.from, to: args.to, frame: args.frame })}`;
1332
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1333
+ }
1334
+ else if (name === "etf_fund") {
1335
+ endpoint = `etfs/${args.ticker}/fund`;
1336
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1337
+ }
1338
+ else if (name === "etf_holdings") {
1339
+ endpoint = `etfs/${args.ticker}/holdings`;
1340
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1341
+ }
1342
+ else if (name === "etf_exposure") {
1343
+ endpoint = `etfs/${args.ticker}/exposure`;
1344
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1345
+ }
1346
+ else if (name === "etf_weights") {
1347
+ endpoint = `etfs/${args.ticker}/weights`;
1348
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1349
+ }
1204
1350
 
1205
- // Crypto handlers
1206
- case "crypto_tickers":
1207
- endpoint = `crypto/tickers${buildQueryString({
1208
- type: args.type
1209
- })}`;
1210
- result = await makeApiRequest(endpoint, { method: 'GET' });
1211
- break;
1212
1351
 
1213
- case "crypto_quote":
1214
- if (!args.ticker) {
1215
- throw new Error("Cryptocurrency ticker symbol is required");
1216
- }
1217
- endpoint = `crypto/${args.ticker}`;
1218
- result = await makeApiRequest(endpoint, { method: 'GET' });
1219
- break;
1352
+ // ---------- Supply Chain ----------
1353
+ else if (name === "supply_chain_customers") {
1354
+ endpoint = `supply-chain/${args.ticker}/customers`;
1355
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1356
+ }
1357
+ else if (name === "supply_chain_peers") {
1358
+ endpoint = `supply-chain/${args.ticker}/peers`;
1359
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1360
+ }
1361
+ else if (name === "supply_chain_suppliers") {
1362
+ endpoint = `supply-chain/${args.ticker}/suppliers`;
1363
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1364
+ }
1220
1365
 
1221
- case "crypto_prices":
1222
- if (!args.ticker) {
1223
- throw new Error("Cryptocurrency ticker symbol is required");
1224
- }
1225
- endpoint = `crypto/${args.ticker}/prices`;
1226
- result = await makeApiRequest(endpoint, { method: 'GET' });
1227
- break;
1366
+ // ---------- Stocks ----------
1367
+ else if (name === "stocks_tickers") {
1368
+ endpoint = `stocks/tickers${buildQueryString({ country: args.country, exchange: args.exchange })}`;
1369
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1370
+ }
1371
+ else if (name === "stocks_gainers") {
1372
+ endpoint = `stocks/gainers`;
1373
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1374
+ }
1375
+ else if (name === "stocks_losers") {
1376
+ endpoint = `stocks/losers`;
1377
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1378
+ }
1379
+ else if (name === "stocks_list_market") {
1380
+ endpoint = `stocks/list/market`;
1381
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1382
+ }
1383
+ else if (name === "stocks_list_country") {
1384
+ endpoint = `stocks/list/country`;
1385
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1386
+ }
1387
+ else if (name === "stocks_list_currency") {
1388
+ endpoint = `stocks/list/currency`;
1389
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1390
+ }
1391
+ else if (name === "stocks_list_sector") {
1392
+ endpoint = `stocks/list/sector`;
1393
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1394
+ }
1395
+ else if (name === "stocks_list_industry") {
1396
+ endpoint = `stocks/list/industry`;
1397
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1398
+ }
1399
+ else if (name === "stocks_list_type") {
1400
+ endpoint = `stocks/list/type`;
1401
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1402
+ }
1403
+ else if (name === "stocks_quote") {
1404
+ endpoint = `stocks/${args.ticker}/quote`;
1405
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1406
+ }
1407
+ else if (name === "stocks_prices") {
1408
+ endpoint = `stocks/${args.ticker}/prices${buildQueryString({ from: args.from, to: args.to, frame: args.frame })}`;
1409
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1410
+ }
1228
1411
 
1229
- // Forex handlers
1230
- case "forex_tickers":
1231
- endpoint = `forex/tickers${buildQueryString({
1232
- country: args.country,
1233
- exchange: args.exchange
1234
- })}`;
1235
- result = await makeApiRequest(endpoint, { method: 'GET' });
1236
- break;
1412
+ // ---------- Crypto ----------
1413
+ else if (name === "crypto_tickers") {
1414
+ endpoint = `crypto/tickers${buildQueryString({ type: args.type })}`;
1415
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1416
+ }
1417
+ else if (name === "crypto_gainers") {
1418
+ endpoint = `crypto/gainers`;
1419
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1420
+ }
1421
+ else if (name === "crypto_losers") {
1422
+ endpoint = `crypto/losers`;
1423
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1424
+ }
1425
+ else if (name === "crypto_list_category") {
1426
+ endpoint = `crypto/list/category`;
1427
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1428
+ }
1429
+ else if (name === "crypto_list_rating") {
1430
+ endpoint = `crypto/list/rating`;
1431
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1432
+ }
1433
+ else if (name === "crypto_list_type") {
1434
+ endpoint = `crypto/list/type`;
1435
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1436
+ }
1437
+ else if (name === "crypto_quote") {
1438
+ endpoint = `crypto/${args.ticker}/quote`;
1439
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1440
+ }
1441
+ else if (name === "crypto_prices") {
1442
+ endpoint = `crypto/${args.ticker}/prices${buildQueryString({ from: args.from, to: args.to, frame: args.frame })}`;
1443
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1444
+ }
1237
1445
 
1238
- case "forex_quote":
1239
- if (!args.ticker) {
1240
- throw new Error("Forex ticker symbol is required");
1241
- }
1242
- endpoint = `forex/${args.ticker}`;
1243
- result = await makeApiRequest(endpoint, { method: 'GET' });
1244
- break;
1446
+ // ---------- Forex ----------
1447
+ else if (name === "forex_tickers") {
1448
+ endpoint = `forex/tickers${buildQueryString({ country: args.country, exchange: args.exchange })}`;
1449
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1450
+ }
1451
+ else if (name === "forex_gainers") {
1452
+ endpoint = `forex/gainers`;
1453
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1454
+ }
1455
+ else if (name === "forex_losers") {
1456
+ endpoint = `forex/losers`;
1457
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1458
+ }
1459
+ else if (name === "forex_list_exchange") {
1460
+ endpoint = `forex/list/exchange`;
1461
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1462
+ }
1463
+ else if (name === "forex_list_rating") {
1464
+ endpoint = `forex/list/rating`;
1465
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1466
+ }
1467
+ else if (name === "forex_list_country") {
1468
+ endpoint = `forex/list/country`;
1469
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1470
+ }
1471
+ else if (name === "forex_quote") {
1472
+ endpoint = `forex/${args.ticker}/quote`;
1473
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1474
+ }
1475
+ else if (name === "forex_prices") {
1476
+ endpoint = `forex/${args.ticker}/prices${buildQueryString({ from: args.from, to: args.to, frame: args.frame })}`;
1477
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1478
+ }
1245
1479
 
1246
- case "forex_prices":
1247
- if (!args.ticker) {
1248
- throw new Error("Forex ticker symbol is required");
1249
- }
1250
- endpoint = `forex/${args.ticker}/prices`;
1251
- result = await makeApiRequest(endpoint, { method: 'GET' });
1252
- break;
1480
+ // ---------- Futures ----------
1481
+ else if (name === "futures_tickers") {
1482
+ endpoint = `futures/tickers${buildQueryString({ exchange: args.exchange })}`;
1483
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1484
+ }
1485
+ else if (name === "futures_gainers") {
1486
+ endpoint = `futures/gainers`;
1487
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1488
+ }
1489
+ else if (name === "futures_losers") {
1490
+ endpoint = `futures/losers`;
1491
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1492
+ }
1493
+ else if (name === "futures_list_exchange") {
1494
+ endpoint = `futures/list/exchange`;
1495
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1496
+ }
1497
+ else if (name === "futures_list_currency") {
1498
+ endpoint = `futures/list/currency`;
1499
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1500
+ }
1501
+ else if (name === "futures_list_timezone") {
1502
+ endpoint = `futures/list/timezone`;
1503
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1504
+ }
1505
+ else if (name === "futures_list_country") {
1506
+ endpoint = `futures/list/country`;
1507
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1508
+ }
1509
+ else if (name === "futures_quote") {
1510
+ endpoint = `futures/${args.ticker}/quote`;
1511
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1512
+ }
1513
+ else if (name === "futures_prices") {
1514
+ endpoint = `futures/${args.ticker}/prices${buildQueryString({ from: args.from, to: args.to, frame: args.frame })}`;
1515
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1516
+ }
1253
1517
 
1254
- // Futures handlers
1255
- case "future_tickers":
1256
- endpoint = `future/tickers${buildQueryString({
1257
- exchange: args.exchange
1258
- })}`;
1259
- result = await makeApiRequest(endpoint, { method: 'GET' });
1260
- break;
1518
+ // ---------- Indices ----------
1519
+ else if (name === "indices_tickers") {
1520
+ endpoint = `indices/tickers${buildQueryString({ exchange: args.exchange })}`;
1521
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1522
+ }
1523
+ else if (name === "indices_gainers") {
1524
+ endpoint = `indices/gainers`;
1525
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1526
+ }
1527
+ else if (name === "indices_losers") {
1528
+ endpoint = `indices/losers`;
1529
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1530
+ }
1531
+ else if (name === "indices_list_exchange") {
1532
+ endpoint = `indices/list/exchange`;
1533
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1534
+ }
1535
+ else if (name === "indices_list_timezone") {
1536
+ endpoint = `indices/list/timezone`;
1537
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1538
+ }
1539
+ else if (name === "indices_list_country") {
1540
+ endpoint = `indices/list/country`;
1541
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1542
+ }
1543
+ else if (name === "indices_quote") {
1544
+ endpoint = `indices/${args.ticker}/quote`;
1545
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1546
+ }
1547
+ else if (name === "indices_prices") {
1548
+ endpoint = `indices/${args.ticker}/prices${buildQueryString({ from: args.from, to: args.to, frame: args.frame })}`;
1549
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1550
+ }
1551
+ else if (name === "indices_components") {
1552
+ endpoint = `indices/${args.ticker}/components`;
1553
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1554
+ }
1555
+ else if (name === "indices_exposure") {
1556
+ endpoint = `indices/${args.ticker}/exposure`;
1557
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1558
+ }
1261
1559
 
1262
- case "future_quote":
1263
- if (!args.ticker) {
1264
- throw new Error("Futures ticker symbol is required");
1265
- }
1266
- endpoint = `future/${args.ticker}`;
1267
- result = await makeApiRequest(endpoint, { method: 'GET' });
1268
- break;
1560
+ // ---------- Economics ----------
1561
+ else if (name === "econ_search") {
1562
+ endpoint = `econ/search${buildQueryString({ query: args.query })}`;
1563
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1564
+ }
1565
+ else if (name === "econ_dataset") {
1566
+ endpoint = `econ/dataset/${args.id}`;
1567
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1568
+ }
1569
+ else if (name === "econ_calendar") {
1570
+ endpoint = `econ/calendar${buildQueryString({
1571
+ from: args.from,
1572
+ to: args.to,
1573
+ country: args.country,
1574
+ minImportance: args.minImportance,
1575
+ currency: args.currency,
1576
+ category: args.category,
1577
+ limit: args.limit
1578
+ })}`;
1579
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1580
+ }
1581
+ else if (name === "econ_find") {
1582
+ endpoint = `econ/find${buildQueryString({ query: args.query })}`;
1583
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1584
+ }
1269
1585
 
1270
- case "future_prices":
1271
- if (!args.ticker) {
1272
- throw new Error("Futures ticker symbol is required");
1273
- }
1274
- endpoint = `future/${args.ticker}/prices`;
1275
- result = await makeApiRequest(endpoint, { method: 'GET' });
1276
- break;
1586
+ // ---------- News ----------
1587
+ else if (name === "news_general") {
1588
+ endpoint = `news`;
1589
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1590
+ }
1591
+ else if (name === "news_ticker") {
1592
+ endpoint = `news/${args.ticker}`;
1593
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1594
+ }
1595
+ else if (name === "news_country") {
1596
+ endpoint = `news/country/${encodeURIComponent(args.country)}`;
1597
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1598
+ }
1599
+ else if (name === "news_category") {
1600
+ endpoint = `news/category/${encodeURIComponent(args.category)}`;
1601
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1602
+ }
1603
+ else if (name === "news_article") {
1604
+ endpoint = `news/article/${args.id}`;
1605
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1606
+ }
1277
1607
 
1278
- // Indices handlers
1279
- case "indices_tickers":
1280
- endpoint = `indices/tickers${buildQueryString({
1281
- exchange: args.exchange
1282
- })}`;
1283
- result = await makeApiRequest(endpoint, { method: 'GET' });
1284
- break;
1608
+ // ---------- Sentiment ----------
1609
+ else if (name === "sentiment_all") {
1610
+ endpoint = `sentiment/${args.ticker}/all`;
1611
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1612
+ }
1613
+ else if (name === "sentiment_social") {
1614
+ endpoint = `sentiment/${args.ticker}/social`;
1615
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1616
+ }
1617
+ else if (name === "sentiment_news") {
1618
+ endpoint = `sentiment/${args.ticker}/news`;
1619
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1620
+ }
1621
+ else if (name === "sentiment_analyst") {
1622
+ endpoint = `sentiment/${args.ticker}/analyst`;
1623
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1624
+ }
1285
1625
 
1286
- case "indices_quote":
1287
- if (!args.ticker) {
1288
- throw new Error("Index ticker symbol is required");
1289
- }
1290
- endpoint = `indices/${args.ticker}`;
1291
- result = await makeApiRequest(endpoint, { method: 'GET' });
1292
- break;
1626
+ // ---------- Profiles ----------
1627
+ else if (name === "profiles_profile") {
1628
+ endpoint = `profiles/${args.ticker}`;
1629
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1630
+ }
1631
+ else if (name === "profiles_recommendation") {
1632
+ endpoint = `profiles/${args.ticker}/recommendation`;
1633
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1634
+ }
1635
+ else if (name === "profiles_statistics") {
1636
+ endpoint = `profiles/${args.ticker}/statistics`;
1637
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1638
+ }
1639
+ else if (name === "profiles_summary") {
1640
+ endpoint = `profiles/${args.ticker}/summary`;
1641
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1642
+ }
1643
+ else if (name === "profiles_calendar") {
1644
+ endpoint = `profiles/${args.ticker}/calendar`;
1645
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1646
+ }
1647
+ else if (name === "profiles_info") {
1648
+ endpoint = `profiles/${args.ticker}/info`;
1649
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1650
+ }
1293
1651
 
1294
- case "indices_prices":
1295
- if (!args.ticker) {
1296
- throw new Error("Index ticker symbol is required");
1297
- }
1298
- endpoint = `indices/${args.ticker}/prices`;
1299
- result = await makeApiRequest(endpoint, { method: 'GET' });
1300
- break;
1652
+ // ---------- Earnings ----------
1653
+ else if (name === "earnings_history") {
1654
+ endpoint = `earnings/${args.ticker}/history`;
1655
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1656
+ }
1657
+ else if (name === "earnings_trend") {
1658
+ endpoint = `earnings/${args.ticker}/trend`;
1659
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1660
+ }
1661
+ else if (name === "earnings_index") {
1662
+ endpoint = `earnings/${args.ticker}/index`;
1663
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1664
+ }
1665
+ else if (name === "earnings_report") {
1666
+ endpoint = `earnings/${args.ticker}/report${buildQueryString({ year: args.year, quarter: args.quarter })}`;
1667
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1668
+ }
1669
+ else if (name === "earnings_transcript") {
1670
+ endpoint = `earnings/${args.ticker}/transcript${buildQueryString({ year: args.year, quarter: args.quarter })}`;
1671
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1672
+ }
1673
+ else if (name === "earnings_transcript_sentiment") {
1674
+ const id = btoa(JSON.stringify({ ticker: args.ticker, year: args.year, quarter: args.quarter }));
1675
+ endpoint = `earnings/transcript/sentiment${buildQueryString({ id })}`;
1676
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1677
+ }
1301
1678
 
1679
+ // ---------- Filings ----------
1680
+ else if (name === "filings_recent") {
1681
+ endpoint = `filings/${args.ticker}${buildQueryString({ limit: args.limit, form: args.form })}`;
1682
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1683
+ }
1684
+ else if (name === "filings_forms") {
1685
+ endpoint = `filings/${args.ticker}/forms/${args.formType}${buildQueryString({ year: args.year, quarter: args.quarter, limit: args.limit })}`;
1686
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1687
+ }
1688
+ else if (name === "filings_desc_forms") {
1689
+ endpoint = `filings/desc/forms`;
1690
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1691
+ }
1692
+ else if (name === "filings_search") {
1693
+ endpoint = `filings/search${buildQueryString({ year: args.year, quarter: args.quarter, form: args.form, ticker: args.ticker })}`;
1694
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1695
+ }
1696
+ else if (name === "filings_document_text") {
1697
+ endpoint = `filings/document/text${buildQueryString({ documentId: args.documentId })}`;
1698
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1699
+ }
1700
+ else if (name === "filings_document_sentiment") {
1701
+ endpoint = `filings/document/sentiment${buildQueryString({ documentId: args.documentId })}`;
1702
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1703
+ }
1302
1704
 
1303
- // Stocks handlers
1304
- case "stocks_tickers":
1305
- endpoint = `stocks/tickers${buildQueryString({
1306
- country: args.country,
1307
- exchange: args.exchange
1308
- })}`;
1309
- result = await makeApiRequest(endpoint, { method: 'GET' });
1310
- break;
1705
+ // ---------- Financials ----------
1706
+ else if (name === "financials_revenue") {
1707
+ endpoint = `financials/${args.ticker}/revenue${buildQueryString({ periods: args.periods })}`;
1708
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1709
+ }
1710
+ else if (name === "financials_net_income") {
1711
+ endpoint = `financials/${args.ticker}/netincome${buildQueryString({ periods: args.periods })}`;
1712
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1713
+ }
1714
+ else if (name === "financials_total_assets") {
1715
+ endpoint = `financials/${args.ticker}/total/assets${buildQueryString({ periods: args.periods })}`;
1716
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1717
+ }
1718
+ else if (name === "financials_total_liabilities") {
1719
+ endpoint = `financials/${args.ticker}/total/liabilities${buildQueryString({ periods: args.periods })}`;
1720
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1721
+ }
1722
+ else if (name === "financials_stockholders_equity") {
1723
+ endpoint = `financials/${args.ticker}/stockholdersequity${buildQueryString({ periods: args.periods })}`;
1724
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1725
+ }
1726
+ else if (name === "financials_current_assets") {
1727
+ endpoint = `financials/${args.ticker}/current/assets${buildQueryString({ periods: args.periods })}`;
1728
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1729
+ }
1730
+ else if (name === "financials_current_liabilities") {
1731
+ endpoint = `financials/${args.ticker}/current/liabilities${buildQueryString({ periods: args.periods })}`;
1732
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1733
+ }
1734
+ else if (name === "financials_operating_cash_flow") {
1735
+ endpoint = `financials/${args.ticker}/cashflow/operating${buildQueryString({ periods: args.periods })}`;
1736
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1737
+ }
1738
+ else if (name === "financials_capital_expenditures") {
1739
+ endpoint = `financials/${args.ticker}/capitalexpenditures${buildQueryString({ periods: args.periods })}`;
1740
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1741
+ }
1742
+ else if (name === "financials_free_cash_flow") {
1743
+ endpoint = `financials/${args.ticker}/cashflow/free${buildQueryString({ periods: args.periods })}`;
1744
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1745
+ }
1746
+ else if (name === "financials_shares_outstanding_basic") {
1747
+ endpoint = `financials/${args.ticker}/sharesoutstanding/basic${buildQueryString({ periods: args.periods })}`;
1748
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1749
+ }
1750
+ else if (name === "financials_shares_outstanding_diluted") {
1751
+ endpoint = `financials/${args.ticker}/sharesoutstanding/diluted${buildQueryString({ periods: args.periods })}`;
1752
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1753
+ }
1754
+ else if (name === "financials_metrics") {
1755
+ endpoint = `financials/${args.ticker}/metrics`;
1756
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1757
+ }
1758
+ else if (name === "financials_snapshot") {
1759
+ endpoint = `financials/${args.ticker}/snapshot`;
1760
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1761
+ }
1762
+ else if (name === "financials_balance_sheet") {
1763
+ endpoint = `financials/statements/${args.ticker}/balance${buildQueryString({ year: args.year, quarter: args.quarter })}`;
1764
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1765
+ }
1766
+ else if (name === "financials_income_statement") {
1767
+ endpoint = `financials/statements/${args.ticker}/income${buildQueryString({ year: args.year, quarter: args.quarter })}`;
1768
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1769
+ }
1770
+ else if (name === "financials_cash_flow_statement") {
1771
+ endpoint = `financials/statements/${args.ticker}/cashflow${buildQueryString({ year: args.year, quarter: args.quarter })}`;
1772
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1773
+ }
1311
1774
 
1312
- case "stocks_quote":
1313
- if (!args.ticker) {
1314
- throw new Error("Stock ticker symbol is required");
1315
- }
1316
- endpoint = `stocks/${args.ticker}`;
1317
- result = await makeApiRequest(endpoint, { method: 'GET' });
1318
- break;
1775
+ // ---------- Insiders ----------
1776
+ else if (name === "insiders_funds") {
1777
+ endpoint = `insiders/${args.ticker}/funds`;
1778
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1779
+ }
1780
+ else if (name === "insiders_individuals") {
1781
+ endpoint = `insiders/${args.ticker}/individuals`;
1782
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1783
+ }
1784
+ else if (name === "insiders_institutions") {
1785
+ endpoint = `insiders/${args.ticker}/institutions`;
1786
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1787
+ }
1788
+ else if (name === "insiders_ownership") {
1789
+ endpoint = `insiders/${args.ticker}/ownership`;
1790
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1791
+ }
1792
+ else if (name === "insiders_activity") {
1793
+ endpoint = `insiders/${args.ticker}/activity`;
1794
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1795
+ }
1796
+ else if (name === "insiders_transactions") {
1797
+ endpoint = `insiders/${args.ticker}/transactions`;
1798
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1799
+ }
1319
1800
 
1320
- case "stocks_prices":
1321
- if (!args.ticker) {
1322
- throw new Error("Stock ticker symbol is required");
1323
- }
1324
- endpoint = `stocks/${args.ticker}/prices`;
1325
- result = await makeApiRequest(endpoint, { method: 'GET' });
1326
- break;
1801
+ // ---------- Web Traffic ----------
1802
+ else if (name === "webtraffic_traffic") {
1803
+ endpoint = `webtraffic/${args.ticker}/traffic`;
1804
+ result = await makeApiRequest(endpoint, { method: 'GET' });
1805
+ }
1327
1806
 
1328
- default:
1329
- throw new Error(`Unknown tool: ${name}`);
1807
+ else {
1808
+ throw new Error(`Unknown tool: ${name}`);
1330
1809
  }
1331
1810
 
1332
1811
  return {
@@ -1356,7 +1835,7 @@ exchange: args.exchange
1356
1835
  async function main() {
1357
1836
  const transport = new StdioServerTransport();
1358
1837
  await server.connect(transport);
1359
- console.error("Axion MCP Server running on stdio");
1838
+ console.error("Axion MCP Server v2 running on stdio");
1360
1839
  }
1361
1840
 
1362
1841
  main().catch((error) => {