@axionquant/mcp 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -0
- package/index.js +1407 -0
- package/package.json +34 -0
package/index.js
ADDED
|
@@ -0,0 +1,1407 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
import {
|
|
6
|
+
CallToolRequestSchema,
|
|
7
|
+
ListToolsRequestSchema,
|
|
8
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
+
|
|
10
|
+
const API_BASE_URL = 'https://api.axionquant.com/';
|
|
11
|
+
const API_KEY = process.env.API_KEY;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Helper function to make API requests
|
|
15
|
+
*/
|
|
16
|
+
async function makeApiRequest(endpoint, options = {}) {
|
|
17
|
+
const url = `${API_BASE_URL}${endpoint}`;
|
|
18
|
+
const headers = {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...(API_KEY && { 'Authorization': `Bearer ${API_KEY}` }),
|
|
21
|
+
...options.headers,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const response = await fetch(url, { ...options, headers });
|
|
26
|
+
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
const errorText = await response.text();
|
|
29
|
+
throw new Error(`API request failed: ${response.status} - ${errorText}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return await response.json();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
throw new Error(`Failed to fetch from ${url}: ${error.message}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to build query strings from object
|
|
40
|
+
*/
|
|
41
|
+
function buildQueryString(params) {
|
|
42
|
+
const filtered = Object.entries(params || {})
|
|
43
|
+
.filter(([_, value]) => value !== undefined && value !== null && value !== '')
|
|
44
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`);
|
|
45
|
+
|
|
46
|
+
return filtered.length > 0 ? `?${filtered.join('&')}` : '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create the MCP server
|
|
51
|
+
*/
|
|
52
|
+
const server = new Server(
|
|
53
|
+
{
|
|
54
|
+
name: "axion-financial-data",
|
|
55
|
+
version: "1.0.0",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
capabilities: {
|
|
59
|
+
tools: {},
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* List all available tools
|
|
66
|
+
*/
|
|
67
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
68
|
+
return {
|
|
69
|
+
tools: [
|
|
70
|
+
{
|
|
71
|
+
name: "credit_search",
|
|
72
|
+
description: "Search for credit entities by name, sector, country, or state",
|
|
73
|
+
inputSchema: {
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: {
|
|
76
|
+
query: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Search query (organization name)"
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "credit_ratings",
|
|
85
|
+
description: "Get credit ratings for a specific organization by ID",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
id: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Organization ID (from search results)"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
required: ["id"]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "econ_search",
|
|
99
|
+
description: "Search for economic datasets (FRED)",
|
|
100
|
+
inputSchema: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
query: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "Search query for economic indicators"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
required: ["query"]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "econ_dataset",
|
|
113
|
+
description: "Get economic dataset time series data by ID",
|
|
114
|
+
inputSchema: {
|
|
115
|
+
type: "object",
|
|
116
|
+
properties: {
|
|
117
|
+
id: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "Dataset ID (from search results, e.g., 'PMAIZMTUSDM')"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
required: ["id"]
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
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
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "esg_data",
|
|
162
|
+
description: "Get ESG (Environmental, Social, Governance) scores for a specific ticker",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
ticker: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
required: ["ticker"]
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "etf_fund",
|
|
176
|
+
description: "Get ETF fund information including ratings, metrics, and classification",
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: "object",
|
|
179
|
+
properties: {
|
|
180
|
+
ticker: {
|
|
181
|
+
type: "string",
|
|
182
|
+
description: "ETF ticker symbol (e.g., 'SPY' for SPDR S&P 500 ETF Trust)"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
required: ["ticker"]
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "etf_weights",
|
|
190
|
+
description: "Get ETF sector and region allocation weights",
|
|
191
|
+
inputSchema: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
ticker: {
|
|
195
|
+
type: "string",
|
|
196
|
+
description: "ETF ticker symbol (e.g., 'SPY' for SPDR S&P 500 ETF Trust)"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
required: ["ticker"]
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "etf_holdings",
|
|
204
|
+
description: "Get ETF top holdings including weight, shares, and market value",
|
|
205
|
+
inputSchema: {
|
|
206
|
+
type: "object",
|
|
207
|
+
properties: {
|
|
208
|
+
ticker: {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "ETF ticker symbol (e.g., 'SPY' for SPDR S&P 500 ETF Trust)"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
required: ["ticker"]
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "etf_exposure",
|
|
218
|
+
description: "Get which other ETFs hold a specific ticker (inverse exposure)",
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
ticker: {
|
|
223
|
+
type: "string",
|
|
224
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple) to find ETFs that hold it"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
required: ["ticker"]
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
// News tools
|
|
231
|
+
{
|
|
232
|
+
name: "news_ticker",
|
|
233
|
+
description: "Get news for a specific company by ticker symbol",
|
|
234
|
+
inputSchema: {
|
|
235
|
+
type: "object",
|
|
236
|
+
properties: {
|
|
237
|
+
ticker: {
|
|
238
|
+
type: "string",
|
|
239
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
required: ["ticker"]
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "news_country",
|
|
247
|
+
description: "Get news for a specific country",
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
country: {
|
|
252
|
+
type: "string",
|
|
253
|
+
description: "Country name or code (e.g., 'US', 'United States')"
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
required: ["country"]
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: "news_category",
|
|
261
|
+
description: "Get news for a specific category",
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: "object",
|
|
264
|
+
properties: {
|
|
265
|
+
category: {
|
|
266
|
+
type: "string",
|
|
267
|
+
description: "News category (e.g., 'business', 'technology', 'politics')"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
required: ["category"]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "news_general",
|
|
275
|
+
description: "Get general news headlines",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
type: "object",
|
|
278
|
+
properties: {}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
// Sentiment analysis tools
|
|
282
|
+
{
|
|
283
|
+
name: "sentiment_social",
|
|
284
|
+
description: "Get social media sentiment for a specific ticker (from Google, Reddit, Twitter)",
|
|
285
|
+
inputSchema: {
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
ticker: {
|
|
289
|
+
type: "string",
|
|
290
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
required: ["ticker"]
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: "sentiment_news",
|
|
298
|
+
description: "Get news sentiment for a specific ticker",
|
|
299
|
+
inputSchema: {
|
|
300
|
+
type: "object",
|
|
301
|
+
properties: {
|
|
302
|
+
ticker: {
|
|
303
|
+
type: "string",
|
|
304
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
required: ["ticker"]
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "sentiment_analyst",
|
|
312
|
+
description: "Get analyst/AI sentiment for a specific ticker",
|
|
313
|
+
inputSchema: {
|
|
314
|
+
type: "object",
|
|
315
|
+
properties: {
|
|
316
|
+
ticker: {
|
|
317
|
+
type: "string",
|
|
318
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
required: ["ticker"]
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
// Supply chain tools
|
|
325
|
+
{
|
|
326
|
+
name: "supply_chain_customers",
|
|
327
|
+
description: "Get supply chain customers for a specific company by ticker symbol",
|
|
328
|
+
inputSchema: {
|
|
329
|
+
type: "object",
|
|
330
|
+
properties: {
|
|
331
|
+
ticker: {
|
|
332
|
+
type: "string",
|
|
333
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
required: ["ticker"]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: "supply_chain_peers",
|
|
341
|
+
description: "Get supply chain peers (competitors) for a specific company by ticker symbol",
|
|
342
|
+
inputSchema: {
|
|
343
|
+
type: "object",
|
|
344
|
+
properties: {
|
|
345
|
+
ticker: {
|
|
346
|
+
type: "string",
|
|
347
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
required: ["ticker"]
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "supply_chain_suppliers",
|
|
355
|
+
description: "Get supply chain suppliers for a specific company by ticker symbol",
|
|
356
|
+
inputSchema: {
|
|
357
|
+
type: "object",
|
|
358
|
+
properties: {
|
|
359
|
+
ticker: {
|
|
360
|
+
type: "string",
|
|
361
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
required: ["ticker"]
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: "profiles_asset",
|
|
369
|
+
description: "Get asset profile information for a specific ticker",
|
|
370
|
+
inputSchema: {
|
|
371
|
+
type: "object",
|
|
372
|
+
properties: {
|
|
373
|
+
ticker: {
|
|
374
|
+
type: "string",
|
|
375
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
required: ["ticker"]
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: "profiles_recommendation",
|
|
383
|
+
description: "Get recommendation trend for a specific ticker",
|
|
384
|
+
inputSchema: {
|
|
385
|
+
type: "object",
|
|
386
|
+
properties: {
|
|
387
|
+
ticker: {
|
|
388
|
+
type: "string",
|
|
389
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
required: ["ticker"]
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: "profiles_cashflow",
|
|
397
|
+
description: "Get cash flow statement history for a specific ticker",
|
|
398
|
+
inputSchema: {
|
|
399
|
+
type: "object",
|
|
400
|
+
properties: {
|
|
401
|
+
ticker: {
|
|
402
|
+
type: "string",
|
|
403
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
required: ["ticker"]
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: "profiles_trend_index",
|
|
411
|
+
description: "Get index trend information for a specific ticker",
|
|
412
|
+
inputSchema: {
|
|
413
|
+
type: "object",
|
|
414
|
+
properties: {
|
|
415
|
+
ticker: {
|
|
416
|
+
type: "string",
|
|
417
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
required: ["ticker"]
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: "profiles_statistics",
|
|
425
|
+
description: "Get default key statistics for a specific ticker",
|
|
426
|
+
inputSchema: {
|
|
427
|
+
type: "object",
|
|
428
|
+
properties: {
|
|
429
|
+
ticker: {
|
|
430
|
+
type: "string",
|
|
431
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
required: ["ticker"]
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: "profiles_income",
|
|
439
|
+
description: "Get income statement history for a specific ticker",
|
|
440
|
+
inputSchema: {
|
|
441
|
+
type: "object",
|
|
442
|
+
properties: {
|
|
443
|
+
ticker: {
|
|
444
|
+
type: "string",
|
|
445
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
required: ["ticker"]
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
name: "profiles_fund",
|
|
453
|
+
description: "Get fund ownership data for a specific ticker",
|
|
454
|
+
inputSchema: {
|
|
455
|
+
type: "object",
|
|
456
|
+
properties: {
|
|
457
|
+
ticker: {
|
|
458
|
+
type: "string",
|
|
459
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
required: ["ticker"]
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: "profiles_summary",
|
|
467
|
+
description: "Get summary detail information for a specific ticker",
|
|
468
|
+
inputSchema: {
|
|
469
|
+
type: "object",
|
|
470
|
+
properties: {
|
|
471
|
+
ticker: {
|
|
472
|
+
type: "string",
|
|
473
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
required: ["ticker"]
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "profiles_insiders",
|
|
481
|
+
description: "Get insider holders information for a specific ticker",
|
|
482
|
+
inputSchema: {
|
|
483
|
+
type: "object",
|
|
484
|
+
properties: {
|
|
485
|
+
ticker: {
|
|
486
|
+
type: "string",
|
|
487
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
required: ["ticker"]
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: "profiles_calendar",
|
|
495
|
+
description: "Get calendar events for a specific ticker",
|
|
496
|
+
inputSchema: {
|
|
497
|
+
type: "object",
|
|
498
|
+
properties: {
|
|
499
|
+
ticker: {
|
|
500
|
+
type: "string",
|
|
501
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
required: ["ticker"]
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: "profiles_balancesheet",
|
|
509
|
+
description: "Get balance sheet history for a specific ticker",
|
|
510
|
+
inputSchema: {
|
|
511
|
+
type: "object",
|
|
512
|
+
properties: {
|
|
513
|
+
ticker: {
|
|
514
|
+
type: "string",
|
|
515
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
required: ["ticker"]
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
name: "profiles_trend_earnings",
|
|
523
|
+
description: "Get earnings trend for a specific ticker",
|
|
524
|
+
inputSchema: {
|
|
525
|
+
type: "object",
|
|
526
|
+
properties: {
|
|
527
|
+
ticker: {
|
|
528
|
+
type: "string",
|
|
529
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
required: ["ticker"]
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "profiles_institution",
|
|
537
|
+
description: "Get institution ownership data for a specific ticker",
|
|
538
|
+
inputSchema: {
|
|
539
|
+
type: "object",
|
|
540
|
+
properties: {
|
|
541
|
+
ticker: {
|
|
542
|
+
type: "string",
|
|
543
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
required: ["ticker"]
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: "profiles_ownership",
|
|
551
|
+
description: "Get major holders breakdown for a specific ticker",
|
|
552
|
+
inputSchema: {
|
|
553
|
+
type: "object",
|
|
554
|
+
properties: {
|
|
555
|
+
ticker: {
|
|
556
|
+
type: "string",
|
|
557
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
required: ["ticker"]
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "profiles_earnings",
|
|
565
|
+
description: "Get earnings history for a specific ticker",
|
|
566
|
+
inputSchema: {
|
|
567
|
+
type: "object",
|
|
568
|
+
properties: {
|
|
569
|
+
ticker: {
|
|
570
|
+
type: "string",
|
|
571
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
required: ["ticker"]
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: "profiles_info",
|
|
579
|
+
description: "Get summary profile information for a specific ticker",
|
|
580
|
+
inputSchema: {
|
|
581
|
+
type: "object",
|
|
582
|
+
properties: {
|
|
583
|
+
ticker: {
|
|
584
|
+
type: "string",
|
|
585
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
required: ["ticker"]
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: "profiles_activity",
|
|
593
|
+
description: "Get net share purchase activity for a specific ticker",
|
|
594
|
+
inputSchema: {
|
|
595
|
+
type: "object",
|
|
596
|
+
properties: {
|
|
597
|
+
ticker: {
|
|
598
|
+
type: "string",
|
|
599
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
required: ["ticker"]
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
name: "profiles_transactions",
|
|
607
|
+
description: "Get insider transactions for a specific ticker",
|
|
608
|
+
inputSchema: {
|
|
609
|
+
type: "object",
|
|
610
|
+
properties: {
|
|
611
|
+
ticker: {
|
|
612
|
+
type: "string",
|
|
613
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
required: ["ticker"]
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "profiles_financials",
|
|
621
|
+
description: "Get financial data for a specific ticker",
|
|
622
|
+
inputSchema: {
|
|
623
|
+
type: "object",
|
|
624
|
+
properties: {
|
|
625
|
+
ticker: {
|
|
626
|
+
type: "string",
|
|
627
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
required: ["ticker"]
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: "profiles_traffic",
|
|
635
|
+
description: "Get website traffic data for a specific ticker",
|
|
636
|
+
inputSchema: {
|
|
637
|
+
type: "object",
|
|
638
|
+
properties: {
|
|
639
|
+
ticker: {
|
|
640
|
+
type: "string",
|
|
641
|
+
description: "Stock ticker symbol (e.g., 'AAPL' for Apple)"
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
required: ["ticker"]
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
|
|
648
|
+
{
|
|
649
|
+
name: "crypto_tickers",
|
|
650
|
+
description: "Get list of cryptocurrency tickers, optionally filtered by type",
|
|
651
|
+
inputSchema: {
|
|
652
|
+
type: "object",
|
|
653
|
+
properties: {
|
|
654
|
+
type: {
|
|
655
|
+
type: "string",
|
|
656
|
+
description: "Filter by type (e.g., 'spot')"
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: "crypto_ticker",
|
|
663
|
+
description: "Get details for a specific cryptocurrency by ticker symbol",
|
|
664
|
+
inputSchema: {
|
|
665
|
+
type: "object",
|
|
666
|
+
properties: {
|
|
667
|
+
ticker: {
|
|
668
|
+
type: "string",
|
|
669
|
+
description: "Cryptocurrency ticker symbol (e.g., 'BTC', 'ETH')"
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
required: ["ticker"]
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: "crypto_prices",
|
|
677
|
+
description: "Get historical price data for a cryptocurrency ticker",
|
|
678
|
+
inputSchema: {
|
|
679
|
+
type: "object",
|
|
680
|
+
properties: {
|
|
681
|
+
ticker: {
|
|
682
|
+
type: "string",
|
|
683
|
+
description: "Cryptocurrency ticker symbol (e.g., 'BTC', 'ETH')"
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
required: ["ticker"]
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
name: "forex_tickers",
|
|
691
|
+
description: "Get list of forex tickers with optional filtering by country or exchange",
|
|
692
|
+
inputSchema: {
|
|
693
|
+
type: "object",
|
|
694
|
+
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
|
+
}
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
name: "forex_ticker",
|
|
708
|
+
description: "Get details for a specific forex pair by ticker symbol",
|
|
709
|
+
inputSchema: {
|
|
710
|
+
type: "object",
|
|
711
|
+
properties: {
|
|
712
|
+
ticker: {
|
|
713
|
+
type: "string",
|
|
714
|
+
description: "Forex ticker symbol (e.g., 'AEDAUD', 'EURUSD')"
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
required: ["ticker"]
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: "forex_prices",
|
|
722
|
+
description: "Get historical price data for a forex ticker",
|
|
723
|
+
inputSchema: {
|
|
724
|
+
type: "object",
|
|
725
|
+
properties: {
|
|
726
|
+
ticker: {
|
|
727
|
+
type: "string",
|
|
728
|
+
description: "Forex ticker symbol (e.g., 'AEDAUD', 'EURUSD')"
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
required: ["ticker"]
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: "future_tickers",
|
|
736
|
+
description: "Get list of futures tickers with optional filtering by exchange",
|
|
737
|
+
inputSchema: {
|
|
738
|
+
type: "object",
|
|
739
|
+
properties: {
|
|
740
|
+
exchange: {
|
|
741
|
+
type: "string",
|
|
742
|
+
description: "Filter by exchange (e.g., 'CME', 'CMX')"
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
name: "future_ticker",
|
|
749
|
+
description: "Get details for a specific futures contract by ticker symbol",
|
|
750
|
+
inputSchema: {
|
|
751
|
+
type: "object",
|
|
752
|
+
properties: {
|
|
753
|
+
ticker: {
|
|
754
|
+
type: "string",
|
|
755
|
+
description: "Futures ticker symbol (e.g., 'ALI', 'M6A', 'BTC')"
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
required: ["ticker"]
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
name: "future_prices",
|
|
763
|
+
description: "Get historical price data for a futures contract",
|
|
764
|
+
inputSchema: {
|
|
765
|
+
type: "object",
|
|
766
|
+
properties: {
|
|
767
|
+
ticker: {
|
|
768
|
+
type: "string",
|
|
769
|
+
description: "Futures ticker symbol (e.g., 'ALI', 'M6A', 'BTC')"
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
required: ["ticker"]
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
name: "indices_tickers",
|
|
777
|
+
description: "Get list of index tickers with optional filtering by exchange",
|
|
778
|
+
inputSchema: {
|
|
779
|
+
type: "object",
|
|
780
|
+
properties: {
|
|
781
|
+
exchange: {
|
|
782
|
+
type: "string",
|
|
783
|
+
description: "Filter by exchange (e.g., 'ASX', 'AMS', 'VIE')"
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "indices_ticker",
|
|
790
|
+
description: "Get details for a specific index by ticker symbol",
|
|
791
|
+
inputSchema: {
|
|
792
|
+
type: "object",
|
|
793
|
+
properties: {
|
|
794
|
+
ticker: {
|
|
795
|
+
type: "string",
|
|
796
|
+
description: "Index ticker symbol (e.g., 'AXJO', 'AEX', 'ATX')"
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
required: ["ticker"]
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: "indices_prices",
|
|
804
|
+
description: "Get historical price data for an index",
|
|
805
|
+
inputSchema: {
|
|
806
|
+
type: "object",
|
|
807
|
+
properties: {
|
|
808
|
+
ticker: {
|
|
809
|
+
type: "string",
|
|
810
|
+
description: "Index ticker symbol (e.g., 'AXJO', 'AEX', 'ATX')"
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
required: ["ticker"]
|
|
814
|
+
}
|
|
815
|
+
},
|
|
816
|
+
|
|
817
|
+
{
|
|
818
|
+
name: "indices_tickers",
|
|
819
|
+
description: "Get list of index tickers with optional filtering by exchange",
|
|
820
|
+
inputSchema: {
|
|
821
|
+
type: "object",
|
|
822
|
+
properties: {
|
|
823
|
+
exchange: {
|
|
824
|
+
type: "string",
|
|
825
|
+
description: "Filter by exchange (e.g., 'ASX', 'AMS', 'VIE')"
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
name: "indices_ticker",
|
|
832
|
+
description: "Get details for a specific index by ticker symbol",
|
|
833
|
+
inputSchema: {
|
|
834
|
+
type: "object",
|
|
835
|
+
properties: {
|
|
836
|
+
ticker: {
|
|
837
|
+
type: "string",
|
|
838
|
+
description: "Index ticker symbol (e.g., 'AXJO', 'AEX', 'ATX')"
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
required: ["ticker"]
|
|
842
|
+
}
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
name: "indices_prices",
|
|
846
|
+
description: "Get historical price data for an index",
|
|
847
|
+
inputSchema: {
|
|
848
|
+
type: "object",
|
|
849
|
+
properties: {
|
|
850
|
+
ticker: {
|
|
851
|
+
type: "string",
|
|
852
|
+
description: "Index ticker symbol (e.g., 'AXJO', 'AEX', 'ATX')"
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
required: ["ticker"]
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
|
|
859
|
+
{
|
|
860
|
+
name: "stocks_tickers",
|
|
861
|
+
description: "Get list of stock tickers with optional filtering by country or exchange",
|
|
862
|
+
inputSchema: {
|
|
863
|
+
type: "object",
|
|
864
|
+
properties: {
|
|
865
|
+
country: {
|
|
866
|
+
type: "string",
|
|
867
|
+
description: "Filter by country (e.g., 'america')"
|
|
868
|
+
},
|
|
869
|
+
exchange: {
|
|
870
|
+
type: "string",
|
|
871
|
+
description: "Filter by exchange (e.g., 'NASDAQ', 'AMEX', 'OTC')"
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
name: "stocks_ticker",
|
|
878
|
+
description: "Get details for a specific stock by ticker symbol",
|
|
879
|
+
inputSchema: {
|
|
880
|
+
type: "object",
|
|
881
|
+
properties: {
|
|
882
|
+
ticker: {
|
|
883
|
+
type: "string",
|
|
884
|
+
description: "Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'TSLA')"
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
required: ["ticker"]
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
name: "stocks_prices",
|
|
892
|
+
description: "Get historical price data for a stock",
|
|
893
|
+
inputSchema: {
|
|
894
|
+
type: "object",
|
|
895
|
+
properties: {
|
|
896
|
+
ticker: {
|
|
897
|
+
type: "string",
|
|
898
|
+
description: "Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'TSLA')"
|
|
899
|
+
}
|
|
900
|
+
},
|
|
901
|
+
required: ["ticker"]
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
],
|
|
907
|
+
};
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Handle tool execution
|
|
912
|
+
*/
|
|
913
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
914
|
+
const { name, arguments: args } = request.params;
|
|
915
|
+
|
|
916
|
+
try {
|
|
917
|
+
let result;
|
|
918
|
+
let endpoint;
|
|
919
|
+
|
|
920
|
+
switch (name) {
|
|
921
|
+
case "credit_search":
|
|
922
|
+
// Build query parameters for search
|
|
923
|
+
const queryParams = buildQueryString({
|
|
924
|
+
query: args.query,
|
|
925
|
+
});
|
|
926
|
+
endpoint = `credit/search${queryParams}`;
|
|
927
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
928
|
+
break;
|
|
929
|
+
|
|
930
|
+
case "credit_ratings":
|
|
931
|
+
if (!args.id) {
|
|
932
|
+
throw new Error("Organization ID is required");
|
|
933
|
+
}
|
|
934
|
+
endpoint = `credit/ratings/${args.id}`;
|
|
935
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
936
|
+
break;
|
|
937
|
+
|
|
938
|
+
case "econ_search":
|
|
939
|
+
if (!args.query) {
|
|
940
|
+
throw new Error("Search query is required");
|
|
941
|
+
}
|
|
942
|
+
endpoint = `econ/search${buildQueryString({ query: args.query })}`;
|
|
943
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
944
|
+
break;
|
|
945
|
+
|
|
946
|
+
case "econ_dataset":
|
|
947
|
+
if (!args.id) {
|
|
948
|
+
throw new Error("Dataset ID is required");
|
|
949
|
+
}
|
|
950
|
+
endpoint = `econ/dataset/${args.id}`;
|
|
951
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
952
|
+
break;
|
|
953
|
+
|
|
954
|
+
case "econ_calendar":
|
|
955
|
+
endpoint = `econ/calendar${buildQueryString({
|
|
956
|
+
from: args.from,
|
|
957
|
+
to: args.to,
|
|
958
|
+
country: args.country,
|
|
959
|
+
minImportance: args.minImportance,
|
|
960
|
+
currency: args.currency,
|
|
961
|
+
category: args.category
|
|
962
|
+
})}`;
|
|
963
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
964
|
+
break;
|
|
965
|
+
|
|
966
|
+
case "esg_data":
|
|
967
|
+
if (!args.ticker) {
|
|
968
|
+
throw new Error("Ticker symbol is required");
|
|
969
|
+
}
|
|
970
|
+
endpoint = `esg/${args.ticker}`;
|
|
971
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
972
|
+
break;
|
|
973
|
+
|
|
974
|
+
case "etf_fund":
|
|
975
|
+
if (!args.ticker) {
|
|
976
|
+
throw new Error("ETF ticker symbol is required");
|
|
977
|
+
}
|
|
978
|
+
endpoint = `etf/${args.ticker}/fund`;
|
|
979
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
980
|
+
break;
|
|
981
|
+
|
|
982
|
+
case "etf_weights":
|
|
983
|
+
if (!args.ticker) {
|
|
984
|
+
throw new Error("ETF ticker symbol is required");
|
|
985
|
+
}
|
|
986
|
+
endpoint = `etf/${args.ticker}/weights`;
|
|
987
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
988
|
+
break;
|
|
989
|
+
|
|
990
|
+
case "etf_holdings":
|
|
991
|
+
if (!args.ticker) {
|
|
992
|
+
throw new Error("ETF ticker symbol is required");
|
|
993
|
+
}
|
|
994
|
+
endpoint = `etf/${args.ticker}/holdings`;
|
|
995
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
996
|
+
break;
|
|
997
|
+
|
|
998
|
+
case "etf_exposure":
|
|
999
|
+
if (!args.ticker) {
|
|
1000
|
+
throw new Error("Ticker symbol is required");
|
|
1001
|
+
}
|
|
1002
|
+
endpoint = `etf/${args.ticker}/exposure`;
|
|
1003
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1004
|
+
break;
|
|
1005
|
+
|
|
1006
|
+
// News handlers
|
|
1007
|
+
case "news_ticker":
|
|
1008
|
+
if (!args.ticker) {
|
|
1009
|
+
throw new Error("Ticker symbol is required");
|
|
1010
|
+
}
|
|
1011
|
+
endpoint = `news/${args.ticker}`;
|
|
1012
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1013
|
+
break;
|
|
1014
|
+
|
|
1015
|
+
case "news_country":
|
|
1016
|
+
if (!args.country) {
|
|
1017
|
+
throw new Error("Country parameter is required");
|
|
1018
|
+
}
|
|
1019
|
+
endpoint = `news/country/${encodeURIComponent(args.country)}`;
|
|
1020
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1021
|
+
break;
|
|
1022
|
+
|
|
1023
|
+
case "news_category":
|
|
1024
|
+
if (!args.category) {
|
|
1025
|
+
throw new Error("Category parameter is required");
|
|
1026
|
+
}
|
|
1027
|
+
endpoint = `news/category/${encodeURIComponent(args.category)}`;
|
|
1028
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1029
|
+
break;
|
|
1030
|
+
|
|
1031
|
+
case "news_general":
|
|
1032
|
+
endpoint = `news`;
|
|
1033
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1034
|
+
break;
|
|
1035
|
+
|
|
1036
|
+
// Sentiment analysis handlers
|
|
1037
|
+
case "sentiment_social":
|
|
1038
|
+
if (!args.ticker) {
|
|
1039
|
+
throw new Error("Ticker symbol is required");
|
|
1040
|
+
}
|
|
1041
|
+
endpoint = `sentiment/${args.ticker}/social`;
|
|
1042
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1043
|
+
break;
|
|
1044
|
+
|
|
1045
|
+
case "sentiment_news":
|
|
1046
|
+
if (!args.ticker) {
|
|
1047
|
+
throw new Error("Ticker symbol is required");
|
|
1048
|
+
}
|
|
1049
|
+
endpoint = `sentiment/${args.ticker}/news`;
|
|
1050
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1051
|
+
break;
|
|
1052
|
+
|
|
1053
|
+
case "sentiment_analyst":
|
|
1054
|
+
if (!args.ticker) {
|
|
1055
|
+
throw new Error("Ticker symbol is required");
|
|
1056
|
+
}
|
|
1057
|
+
endpoint = `sentiment/${args.ticker}/analyst`;
|
|
1058
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1059
|
+
break;
|
|
1060
|
+
|
|
1061
|
+
// Supply chain handlers
|
|
1062
|
+
case "supply_chain_customers":
|
|
1063
|
+
if (!args.ticker) {
|
|
1064
|
+
throw new Error("Ticker symbol is required");
|
|
1065
|
+
}
|
|
1066
|
+
endpoint = `supply-chain/${args.ticker}/customers`;
|
|
1067
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1068
|
+
break;
|
|
1069
|
+
|
|
1070
|
+
case "supply_chain_peers":
|
|
1071
|
+
if (!args.ticker) {
|
|
1072
|
+
throw new Error("Ticker symbol is required");
|
|
1073
|
+
}
|
|
1074
|
+
endpoint = `supply-chain/${args.ticker}/peers`;
|
|
1075
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1076
|
+
break;
|
|
1077
|
+
|
|
1078
|
+
case "supply_chain_suppliers":
|
|
1079
|
+
if (!args.ticker) {
|
|
1080
|
+
throw new Error("Ticker symbol is required");
|
|
1081
|
+
}
|
|
1082
|
+
endpoint = `supply-chain/${args.ticker}/suppliers`;
|
|
1083
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1084
|
+
break;
|
|
1085
|
+
|
|
1086
|
+
case "profiles_asset":
|
|
1087
|
+
if (!args.ticker) {
|
|
1088
|
+
throw new Error("Ticker symbol is required");
|
|
1089
|
+
}
|
|
1090
|
+
endpoint = `profiles/${args.ticker}/asset`;
|
|
1091
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1092
|
+
break;
|
|
1093
|
+
|
|
1094
|
+
case "profiles_recommendation":
|
|
1095
|
+
if (!args.ticker) {
|
|
1096
|
+
throw new Error("Ticker symbol is required");
|
|
1097
|
+
}
|
|
1098
|
+
endpoint = `profiles/${args.ticker}/recommendation`;
|
|
1099
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1100
|
+
break;
|
|
1101
|
+
|
|
1102
|
+
case "profiles_cashflow":
|
|
1103
|
+
if (!args.ticker) {
|
|
1104
|
+
throw new Error("Ticker symbol is required");
|
|
1105
|
+
}
|
|
1106
|
+
endpoint = `profiles/${args.ticker}/cashflow`;
|
|
1107
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1108
|
+
break;
|
|
1109
|
+
|
|
1110
|
+
case "profiles_trend_index":
|
|
1111
|
+
if (!args.ticker) {
|
|
1112
|
+
throw new Error("Ticker symbol is required");
|
|
1113
|
+
}
|
|
1114
|
+
endpoint = `profiles/${args.ticker}/trend/index`;
|
|
1115
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1116
|
+
break;
|
|
1117
|
+
|
|
1118
|
+
case "profiles_statistics":
|
|
1119
|
+
if (!args.ticker) {
|
|
1120
|
+
throw new Error("Ticker symbol is required");
|
|
1121
|
+
}
|
|
1122
|
+
endpoint = `profiles/${args.ticker}/statistics`;
|
|
1123
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1124
|
+
break;
|
|
1125
|
+
|
|
1126
|
+
case "profiles_income":
|
|
1127
|
+
if (!args.ticker) {
|
|
1128
|
+
throw new Error("Ticker symbol is required");
|
|
1129
|
+
}
|
|
1130
|
+
endpoint = `profiles/${args.ticker}/income`;
|
|
1131
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1132
|
+
break;
|
|
1133
|
+
|
|
1134
|
+
case "profiles_fund":
|
|
1135
|
+
if (!args.ticker) {
|
|
1136
|
+
throw new Error("Ticker symbol is required");
|
|
1137
|
+
}
|
|
1138
|
+
endpoint = `profiles/${args.ticker}/fund`;
|
|
1139
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1140
|
+
break;
|
|
1141
|
+
|
|
1142
|
+
case "profiles_summary":
|
|
1143
|
+
if (!args.ticker) {
|
|
1144
|
+
throw new Error("Ticker symbol is required");
|
|
1145
|
+
}
|
|
1146
|
+
endpoint = `profiles/${args.ticker}/summary`;
|
|
1147
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1148
|
+
break;
|
|
1149
|
+
|
|
1150
|
+
case "profiles_insiders":
|
|
1151
|
+
if (!args.ticker) {
|
|
1152
|
+
throw new Error("Ticker symbol is required");
|
|
1153
|
+
}
|
|
1154
|
+
endpoint = `profiles/${args.ticker}/insiders`;
|
|
1155
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1156
|
+
break;
|
|
1157
|
+
|
|
1158
|
+
case "profiles_calendar":
|
|
1159
|
+
if (!args.ticker) {
|
|
1160
|
+
throw new Error("Ticker symbol is required");
|
|
1161
|
+
}
|
|
1162
|
+
endpoint = `profiles/${args.ticker}/calendar`;
|
|
1163
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1164
|
+
break;
|
|
1165
|
+
|
|
1166
|
+
case "profiles_balancesheet":
|
|
1167
|
+
if (!args.ticker) {
|
|
1168
|
+
throw new Error("Ticker symbol is required");
|
|
1169
|
+
}
|
|
1170
|
+
endpoint = `profiles/${args.ticker}/balancesheet`;
|
|
1171
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1172
|
+
break;
|
|
1173
|
+
|
|
1174
|
+
case "profiles_trend_earnings":
|
|
1175
|
+
if (!args.ticker) {
|
|
1176
|
+
throw new Error("Ticker symbol is required");
|
|
1177
|
+
}
|
|
1178
|
+
endpoint = `profiles/${args.ticker}/trend/earnings`;
|
|
1179
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1180
|
+
break;
|
|
1181
|
+
|
|
1182
|
+
case "profiles_institution":
|
|
1183
|
+
if (!args.ticker) {
|
|
1184
|
+
throw new Error("Ticker symbol is required");
|
|
1185
|
+
}
|
|
1186
|
+
endpoint = `profiles/${args.ticker}/institution`;
|
|
1187
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1188
|
+
break;
|
|
1189
|
+
|
|
1190
|
+
case "profiles_ownership":
|
|
1191
|
+
if (!args.ticker) {
|
|
1192
|
+
throw new Error("Ticker symbol is required");
|
|
1193
|
+
}
|
|
1194
|
+
endpoint = `profiles/${args.ticker}/ownership`;
|
|
1195
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1196
|
+
break;
|
|
1197
|
+
|
|
1198
|
+
case "profiles_earnings":
|
|
1199
|
+
if (!args.ticker) {
|
|
1200
|
+
throw new Error("Ticker symbol is required");
|
|
1201
|
+
}
|
|
1202
|
+
endpoint = `profiles/${args.ticker}/earnings`;
|
|
1203
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1204
|
+
break;
|
|
1205
|
+
|
|
1206
|
+
case "profiles_info":
|
|
1207
|
+
if (!args.ticker) {
|
|
1208
|
+
throw new Error("Ticker symbol is required");
|
|
1209
|
+
}
|
|
1210
|
+
endpoint = `profiles/${args.ticker}/info`;
|
|
1211
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1212
|
+
break;
|
|
1213
|
+
|
|
1214
|
+
case "profiles_activity":
|
|
1215
|
+
if (!args.ticker) {
|
|
1216
|
+
throw new Error("Ticker symbol is required");
|
|
1217
|
+
}
|
|
1218
|
+
endpoint = `profiles/${args.ticker}/activity`;
|
|
1219
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1220
|
+
break;
|
|
1221
|
+
|
|
1222
|
+
case "profiles_transactions":
|
|
1223
|
+
if (!args.ticker) {
|
|
1224
|
+
throw new Error("Ticker symbol is required");
|
|
1225
|
+
}
|
|
1226
|
+
endpoint = `profiles/${args.ticker}/transactions`;
|
|
1227
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1228
|
+
break;
|
|
1229
|
+
|
|
1230
|
+
case "profiles_financials":
|
|
1231
|
+
if (!args.ticker) {
|
|
1232
|
+
throw new Error("Ticker symbol is required");
|
|
1233
|
+
}
|
|
1234
|
+
endpoint = `profiles/${args.ticker}/financials`;
|
|
1235
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1236
|
+
break;
|
|
1237
|
+
|
|
1238
|
+
case "profiles_traffic":
|
|
1239
|
+
if (!args.ticker) {
|
|
1240
|
+
throw new Error("Ticker symbol is required");
|
|
1241
|
+
}
|
|
1242
|
+
endpoint = `profiles/${args.ticker}/traffic`;
|
|
1243
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1244
|
+
break;
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
// Crypto handlers
|
|
1248
|
+
case "crypto_tickers":
|
|
1249
|
+
endpoint = `crypto/tickers${buildQueryString({
|
|
1250
|
+
type: args.type
|
|
1251
|
+
})}`;
|
|
1252
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1253
|
+
break;
|
|
1254
|
+
|
|
1255
|
+
case "crypto_ticker":
|
|
1256
|
+
if (!args.ticker) {
|
|
1257
|
+
throw new Error("Cryptocurrency ticker symbol is required");
|
|
1258
|
+
}
|
|
1259
|
+
endpoint = `crypto/${args.ticker}`;
|
|
1260
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1261
|
+
break;
|
|
1262
|
+
|
|
1263
|
+
case "crypto_prices":
|
|
1264
|
+
if (!args.ticker) {
|
|
1265
|
+
throw new Error("Cryptocurrency ticker symbol is required");
|
|
1266
|
+
}
|
|
1267
|
+
endpoint = `crypto/${args.ticker}/prices`;
|
|
1268
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1269
|
+
break;
|
|
1270
|
+
|
|
1271
|
+
// Forex handlers
|
|
1272
|
+
case "forex_tickers":
|
|
1273
|
+
endpoint = `forex/tickers${buildQueryString({
|
|
1274
|
+
country: args.country,
|
|
1275
|
+
exchange: args.exchange
|
|
1276
|
+
})}`;
|
|
1277
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1278
|
+
break;
|
|
1279
|
+
|
|
1280
|
+
case "forex_ticker":
|
|
1281
|
+
if (!args.ticker) {
|
|
1282
|
+
throw new Error("Forex ticker symbol is required");
|
|
1283
|
+
}
|
|
1284
|
+
endpoint = `forex/${args.ticker}`;
|
|
1285
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1286
|
+
break;
|
|
1287
|
+
|
|
1288
|
+
case "forex_prices":
|
|
1289
|
+
if (!args.ticker) {
|
|
1290
|
+
throw new Error("Forex ticker symbol is required");
|
|
1291
|
+
}
|
|
1292
|
+
endpoint = `forex/${args.ticker}/prices`;
|
|
1293
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1294
|
+
break;
|
|
1295
|
+
|
|
1296
|
+
// Futures handlers
|
|
1297
|
+
case "future_tickers":
|
|
1298
|
+
endpoint = `future/tickers${buildQueryString({
|
|
1299
|
+
exchange: args.exchange
|
|
1300
|
+
})}`;
|
|
1301
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1302
|
+
break;
|
|
1303
|
+
|
|
1304
|
+
case "future_ticker":
|
|
1305
|
+
if (!args.ticker) {
|
|
1306
|
+
throw new Error("Futures ticker symbol is required");
|
|
1307
|
+
}
|
|
1308
|
+
endpoint = `future/${args.ticker}`;
|
|
1309
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1310
|
+
break;
|
|
1311
|
+
|
|
1312
|
+
case "future_prices":
|
|
1313
|
+
if (!args.ticker) {
|
|
1314
|
+
throw new Error("Futures ticker symbol is required");
|
|
1315
|
+
}
|
|
1316
|
+
endpoint = `future/${args.ticker}/prices`;
|
|
1317
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1318
|
+
break;
|
|
1319
|
+
|
|
1320
|
+
// Indices handlers
|
|
1321
|
+
case "indices_tickers":
|
|
1322
|
+
endpoint = `indices/tickers${buildQueryString({
|
|
1323
|
+
exchange: args.exchange
|
|
1324
|
+
})}`;
|
|
1325
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1326
|
+
break;
|
|
1327
|
+
|
|
1328
|
+
case "indices_ticker":
|
|
1329
|
+
if (!args.ticker) {
|
|
1330
|
+
throw new Error("Index ticker symbol is required");
|
|
1331
|
+
}
|
|
1332
|
+
endpoint = `indices/${args.ticker}`;
|
|
1333
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1334
|
+
break;
|
|
1335
|
+
|
|
1336
|
+
case "indices_prices":
|
|
1337
|
+
if (!args.ticker) {
|
|
1338
|
+
throw new Error("Index ticker symbol is required");
|
|
1339
|
+
}
|
|
1340
|
+
endpoint = `indices/${args.ticker}/prices`;
|
|
1341
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1342
|
+
break;
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
// Stocks handlers
|
|
1346
|
+
case "stocks_tickers":
|
|
1347
|
+
endpoint = `stocks/tickers${buildQueryString({
|
|
1348
|
+
country: args.country,
|
|
1349
|
+
exchange: args.exchange
|
|
1350
|
+
})}`;
|
|
1351
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1352
|
+
break;
|
|
1353
|
+
|
|
1354
|
+
case "stocks_ticker":
|
|
1355
|
+
if (!args.ticker) {
|
|
1356
|
+
throw new Error("Stock ticker symbol is required");
|
|
1357
|
+
}
|
|
1358
|
+
endpoint = `stocks/${args.ticker}`;
|
|
1359
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1360
|
+
break;
|
|
1361
|
+
|
|
1362
|
+
case "stocks_prices":
|
|
1363
|
+
if (!args.ticker) {
|
|
1364
|
+
throw new Error("Stock ticker symbol is required");
|
|
1365
|
+
}
|
|
1366
|
+
endpoint = `stocks/${args.ticker}/prices`;
|
|
1367
|
+
result = await makeApiRequest(endpoint, { method: 'GET' });
|
|
1368
|
+
break;
|
|
1369
|
+
|
|
1370
|
+
default:
|
|
1371
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
return {
|
|
1375
|
+
content: [
|
|
1376
|
+
{
|
|
1377
|
+
type: "text",
|
|
1378
|
+
text: JSON.stringify(result, null, 2),
|
|
1379
|
+
},
|
|
1380
|
+
],
|
|
1381
|
+
};
|
|
1382
|
+
} catch (error) {
|
|
1383
|
+
return {
|
|
1384
|
+
content: [
|
|
1385
|
+
{
|
|
1386
|
+
type: "text",
|
|
1387
|
+
text: `Error: ${error.message}`,
|
|
1388
|
+
},
|
|
1389
|
+
],
|
|
1390
|
+
isError: true,
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Start the server
|
|
1397
|
+
*/
|
|
1398
|
+
async function main() {
|
|
1399
|
+
const transport = new StdioServerTransport();
|
|
1400
|
+
await server.connect(transport);
|
|
1401
|
+
console.error("Axion MCP Server running on stdio");
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
main().catch((error) => {
|
|
1405
|
+
console.error("Server error:", error);
|
|
1406
|
+
process.exit(1);
|
|
1407
|
+
});
|