mcp-crypto-price 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp-crypto-price-5.0.2.tgz +0 -0
- package/dist/services/coincap.js +18 -2
- package/dist/tools/asset-info.js +39 -0
- package/dist/tools/candlestick.js +35 -2
- package/dist/tools/compare.js +4 -0
- package/dist/tools/exchanges.js +3 -0
- package/dist/tools/global-metrics.js +24 -0
- package/dist/tools/historical.js +44 -0
- package/dist/tools/market.js +24 -0
- package/dist/tools/price-conversion.js +35 -0
- package/dist/tools/price.js +18 -0
- package/dist/tools/rates.js +3 -0
- package/dist/tools/search-assets.js +4 -0
- package/dist/tools/technical-analysis.js +30 -0
- package/dist/tools/top-assets.js +3 -0
- package/package.json +1 -1
- package/dist/mcp-crypto-price-5.0.0.tgz +0 -0
|
Binary file
|
package/dist/services/coincap.js
CHANGED
|
@@ -266,14 +266,30 @@ export async function getExchange(exchangeId) {
|
|
|
266
266
|
return null;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
+
const QUOTE_ID_MAP = {
|
|
270
|
+
usd: 'us-dollar',
|
|
271
|
+
eur: 'euro',
|
|
272
|
+
gbp: 'british-pound',
|
|
273
|
+
jpy: 'japanese-yen',
|
|
274
|
+
usdt: 'tether',
|
|
275
|
+
usdc: 'usd-coin',
|
|
276
|
+
btc: 'bitcoin',
|
|
277
|
+
eth: 'ethereum',
|
|
278
|
+
};
|
|
279
|
+
function normalizeQuoteId(quote) {
|
|
280
|
+
const lower = quote.toLowerCase();
|
|
281
|
+
return QUOTE_ID_MAP[lower] ?? lower;
|
|
282
|
+
}
|
|
269
283
|
export async function getCandles(exchange, baseId, quoteId, interval, start, end) {
|
|
284
|
+
const normalizedQuoteId = normalizeQuoteId(quoteId);
|
|
270
285
|
try {
|
|
271
|
-
return await makeCoinCapRequest(`/candles?exchange=${encodeURIComponent(exchange)}&baseId=${encodeURIComponent(baseId)}"eId=${encodeURIComponent(
|
|
286
|
+
return await makeCoinCapRequest(`/candles?exchange=${encodeURIComponent(exchange)}&baseId=${encodeURIComponent(baseId)}"eId=${encodeURIComponent(normalizedQuoteId)}&interval=${interval}&start=${start}&end=${end}`, CandlesResponseSchema);
|
|
272
287
|
}
|
|
273
288
|
catch (error) {
|
|
274
289
|
if (error instanceof MissingApiKeyError)
|
|
275
290
|
throw error;
|
|
276
|
-
|
|
291
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
292
|
+
console.error(`Failed to get candles for ${exchange} ${baseId}/${normalizedQuoteId}:`, detail);
|
|
277
293
|
return null;
|
|
278
294
|
}
|
|
279
295
|
}
|
package/dist/tools/asset-info.js
CHANGED
|
@@ -33,6 +33,19 @@ export async function handleGetAssetInfo(args) {
|
|
|
33
33
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
|
+
structuredContent: {
|
|
37
|
+
id: '',
|
|
38
|
+
rank: null,
|
|
39
|
+
symbol: upperSymbol,
|
|
40
|
+
name: '',
|
|
41
|
+
priceUsd: '',
|
|
42
|
+
changePercent24Hr: null,
|
|
43
|
+
marketCapUsd: null,
|
|
44
|
+
volumeUsd24Hr: null,
|
|
45
|
+
supply: null,
|
|
46
|
+
maxSupply: null,
|
|
47
|
+
vwap24Hr: null,
|
|
48
|
+
},
|
|
36
49
|
};
|
|
37
50
|
}
|
|
38
51
|
return {
|
|
@@ -62,6 +75,19 @@ export async function handleGetAssetInfo(args) {
|
|
|
62
75
|
text: `Invalid input: ${error.issues.map((e) => e.message).join(', ')}`,
|
|
63
76
|
},
|
|
64
77
|
],
|
|
78
|
+
structuredContent: {
|
|
79
|
+
id: '',
|
|
80
|
+
rank: null,
|
|
81
|
+
symbol: '',
|
|
82
|
+
name: '',
|
|
83
|
+
priceUsd: '',
|
|
84
|
+
changePercent24Hr: null,
|
|
85
|
+
marketCapUsd: null,
|
|
86
|
+
volumeUsd24Hr: null,
|
|
87
|
+
supply: null,
|
|
88
|
+
maxSupply: null,
|
|
89
|
+
vwap24Hr: null,
|
|
90
|
+
},
|
|
65
91
|
};
|
|
66
92
|
}
|
|
67
93
|
return {
|
|
@@ -73,6 +99,19 @@ export async function handleGetAssetInfo(args) {
|
|
|
73
99
|
: `Failed to retrieve asset info: ${String(error)}`,
|
|
74
100
|
},
|
|
75
101
|
],
|
|
102
|
+
structuredContent: {
|
|
103
|
+
id: '',
|
|
104
|
+
rank: null,
|
|
105
|
+
symbol: '',
|
|
106
|
+
name: '',
|
|
107
|
+
priceUsd: '',
|
|
108
|
+
changePercent24Hr: null,
|
|
109
|
+
marketCapUsd: null,
|
|
110
|
+
volumeUsd24Hr: null,
|
|
111
|
+
supply: null,
|
|
112
|
+
maxSupply: null,
|
|
113
|
+
vwap24Hr: null,
|
|
114
|
+
},
|
|
76
115
|
};
|
|
77
116
|
}
|
|
78
117
|
}
|
|
@@ -13,7 +13,7 @@ export const GetCandlestickDataSchema = z.object({
|
|
|
13
13
|
quote: z
|
|
14
14
|
.string()
|
|
15
15
|
.default('usd')
|
|
16
|
-
.describe('Quote currency
|
|
16
|
+
.describe('Quote currency code (e.g. "usd", "usdt", "btc", "eur"). Common mappings: usd→us-dollar, usdt→tether, usdc→usd-coin. Not all exchanges support all quote currencies — e.g. Binance uses "usdt" not "usd".'),
|
|
17
17
|
interval: z
|
|
18
18
|
.enum(['m5', 'm15', 'm30', 'h1', 'h2', 'h6', 'h12', 'd1'])
|
|
19
19
|
.default('h1')
|
|
@@ -51,6 +51,12 @@ export async function handleGetCandlestickData(args) {
|
|
|
51
51
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
|
+
structuredContent: {
|
|
55
|
+
name: '',
|
|
56
|
+
symbol: upperSymbol,
|
|
57
|
+
exchange,
|
|
58
|
+
candles: [],
|
|
59
|
+
},
|
|
54
60
|
};
|
|
55
61
|
}
|
|
56
62
|
const now = Date.now();
|
|
@@ -60,8 +66,17 @@ export async function handleGetCandlestickData(args) {
|
|
|
60
66
|
if (!candlesData) {
|
|
61
67
|
return {
|
|
62
68
|
content: [
|
|
63
|
-
{
|
|
69
|
+
{
|
|
70
|
+
type: 'text',
|
|
71
|
+
text: `Failed to retrieve candlestick data for ${asset.name} (${asset.symbol}) on ${exchange} with quote "${quote}". This usually means the exchange does not support this trading pair. Try a different quote currency (e.g. "usdt" for Binance) or a different exchange (e.g. "kraken" supports USD pairs).`,
|
|
72
|
+
},
|
|
64
73
|
],
|
|
74
|
+
structuredContent: {
|
|
75
|
+
name: asset.name,
|
|
76
|
+
symbol: asset.symbol,
|
|
77
|
+
exchange,
|
|
78
|
+
candles: [],
|
|
79
|
+
},
|
|
65
80
|
};
|
|
66
81
|
}
|
|
67
82
|
if (!candlesData.data.length) {
|
|
@@ -72,6 +87,12 @@ export async function handleGetCandlestickData(args) {
|
|
|
72
87
|
text: `No candlestick data available for ${asset.name} (${asset.symbol}) on ${exchange} with quote ${quote.toUpperCase()}`,
|
|
73
88
|
},
|
|
74
89
|
],
|
|
90
|
+
structuredContent: {
|
|
91
|
+
name: asset.name,
|
|
92
|
+
symbol: asset.symbol,
|
|
93
|
+
exchange,
|
|
94
|
+
candles: [],
|
|
95
|
+
},
|
|
75
96
|
};
|
|
76
97
|
}
|
|
77
98
|
return {
|
|
@@ -106,6 +127,12 @@ export async function handleGetCandlestickData(args) {
|
|
|
106
127
|
text: `Invalid input: ${error.issues.map((e) => e.message).join(', ')}`,
|
|
107
128
|
},
|
|
108
129
|
],
|
|
130
|
+
structuredContent: {
|
|
131
|
+
name: '',
|
|
132
|
+
symbol: '',
|
|
133
|
+
exchange: '',
|
|
134
|
+
candles: [],
|
|
135
|
+
},
|
|
109
136
|
};
|
|
110
137
|
}
|
|
111
138
|
return {
|
|
@@ -117,6 +144,12 @@ export async function handleGetCandlestickData(args) {
|
|
|
117
144
|
: `Failed to retrieve candlestick data: ${String(error)}`,
|
|
118
145
|
},
|
|
119
146
|
],
|
|
147
|
+
structuredContent: {
|
|
148
|
+
name: '',
|
|
149
|
+
symbol: '',
|
|
150
|
+
exchange: '',
|
|
151
|
+
candles: [],
|
|
152
|
+
},
|
|
120
153
|
};
|
|
121
154
|
}
|
|
122
155
|
}
|
package/dist/tools/compare.js
CHANGED
|
@@ -34,6 +34,7 @@ export async function handleCompareCrypto(args) {
|
|
|
34
34
|
text: 'Please provide 2-5 cryptocurrency symbols to compare (e.g. "BTC,ETH,SOL")',
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
|
+
structuredContent: { assets: [], notFound: symbolList },
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
const results = [];
|
|
@@ -55,6 +56,7 @@ export async function handleCompareCrypto(args) {
|
|
|
55
56
|
text: `Could not find any of the specified cryptocurrencies: ${symbolList.join(', ')}`,
|
|
56
57
|
},
|
|
57
58
|
],
|
|
59
|
+
structuredContent: { assets: [], notFound },
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
let output = formatComparison(results);
|
|
@@ -87,6 +89,7 @@ export async function handleCompareCrypto(args) {
|
|
|
87
89
|
text: `Invalid input: ${error.issues.map((e) => e.message).join(', ')}`,
|
|
88
90
|
},
|
|
89
91
|
],
|
|
92
|
+
structuredContent: { assets: [], notFound: [] },
|
|
90
93
|
};
|
|
91
94
|
}
|
|
92
95
|
return {
|
|
@@ -98,6 +101,7 @@ export async function handleCompareCrypto(args) {
|
|
|
98
101
|
: `Failed to compare cryptocurrencies: ${String(error)}`,
|
|
99
102
|
},
|
|
100
103
|
],
|
|
104
|
+
structuredContent: { assets: [], notFound: [] },
|
|
101
105
|
};
|
|
102
106
|
}
|
|
103
107
|
}
|
package/dist/tools/exchanges.js
CHANGED
|
@@ -39,6 +39,7 @@ export async function handleGetExchanges(args) {
|
|
|
39
39
|
text: `Could not find exchange "${exchangeId}". Try an ID like 'binance', 'coinbase', or 'kraken'.`,
|
|
40
40
|
},
|
|
41
41
|
],
|
|
42
|
+
structuredContent: { exchanges: [] },
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
return {
|
|
@@ -62,6 +63,7 @@ export async function handleGetExchanges(args) {
|
|
|
62
63
|
if (!exchanges) {
|
|
63
64
|
return {
|
|
64
65
|
content: [{ type: 'text', text: 'Failed to retrieve exchanges' }],
|
|
66
|
+
structuredContent: { exchanges: [] },
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
return {
|
|
@@ -91,6 +93,7 @@ export async function handleGetExchanges(args) {
|
|
|
91
93
|
: `Failed to retrieve exchanges: ${String(error)}`,
|
|
92
94
|
},
|
|
93
95
|
],
|
|
96
|
+
structuredContent: { exchanges: [] },
|
|
94
97
|
};
|
|
95
98
|
}
|
|
96
99
|
}
|
|
@@ -17,11 +17,23 @@ export async function handleGetGlobalMetrics(args) {
|
|
|
17
17
|
content: [
|
|
18
18
|
{ type: 'text', text: 'Failed to retrieve global market data' },
|
|
19
19
|
],
|
|
20
|
+
structuredContent: {
|
|
21
|
+
totalMarketCap: 0,
|
|
22
|
+
totalVolume: 0,
|
|
23
|
+
btcDominance: '',
|
|
24
|
+
activeCryptocurrencies: 0,
|
|
25
|
+
},
|
|
20
26
|
};
|
|
21
27
|
}
|
|
22
28
|
if (!assetsData.data.length) {
|
|
23
29
|
return {
|
|
24
30
|
content: [{ type: 'text', text: 'No market data available' }],
|
|
31
|
+
structuredContent: {
|
|
32
|
+
totalMarketCap: 0,
|
|
33
|
+
totalVolume: 0,
|
|
34
|
+
btcDominance: '',
|
|
35
|
+
activeCryptocurrencies: 0,
|
|
36
|
+
},
|
|
25
37
|
};
|
|
26
38
|
}
|
|
27
39
|
const totalMarketCap = assetsData.data.reduce((sum, a) => sum + parseFloat(a.marketCapUsd || '0'), 0);
|
|
@@ -51,6 +63,12 @@ export async function handleGetGlobalMetrics(args) {
|
|
|
51
63
|
text: `Invalid input: ${error.issues.map((e) => e.message).join(', ')}`,
|
|
52
64
|
},
|
|
53
65
|
],
|
|
66
|
+
structuredContent: {
|
|
67
|
+
totalMarketCap: 0,
|
|
68
|
+
totalVolume: 0,
|
|
69
|
+
btcDominance: '',
|
|
70
|
+
activeCryptocurrencies: 0,
|
|
71
|
+
},
|
|
54
72
|
};
|
|
55
73
|
}
|
|
56
74
|
return {
|
|
@@ -62,6 +80,12 @@ export async function handleGetGlobalMetrics(args) {
|
|
|
62
80
|
: `Failed to retrieve global market data: ${String(error)}`,
|
|
63
81
|
},
|
|
64
82
|
],
|
|
83
|
+
structuredContent: {
|
|
84
|
+
totalMarketCap: 0,
|
|
85
|
+
totalVolume: 0,
|
|
86
|
+
btcDominance: '',
|
|
87
|
+
activeCryptocurrencies: 0,
|
|
88
|
+
},
|
|
65
89
|
};
|
|
66
90
|
}
|
|
67
91
|
}
|
package/dist/tools/historical.js
CHANGED
|
@@ -41,6 +41,17 @@ export async function handleGetHistoricalAnalysis(args) {
|
|
|
41
41
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
|
+
structuredContent: {
|
|
45
|
+
name: '',
|
|
46
|
+
symbol: upperSymbol,
|
|
47
|
+
periodHigh: 0,
|
|
48
|
+
periodLow: 0,
|
|
49
|
+
priceChangePercent: '',
|
|
50
|
+
currentPrice: 0,
|
|
51
|
+
startingPrice: 0,
|
|
52
|
+
priceRange: 0,
|
|
53
|
+
rangePercentage: '',
|
|
54
|
+
},
|
|
44
55
|
};
|
|
45
56
|
}
|
|
46
57
|
// Round timestamps to the nearest minute so the cache key stays stable
|
|
@@ -52,6 +63,17 @@ export async function handleGetHistoricalAnalysis(args) {
|
|
|
52
63
|
if (!historyData) {
|
|
53
64
|
return {
|
|
54
65
|
content: [{ type: 'text', text: 'Failed to retrieve historical data' }],
|
|
66
|
+
structuredContent: {
|
|
67
|
+
name: asset.name,
|
|
68
|
+
symbol: asset.symbol,
|
|
69
|
+
periodHigh: 0,
|
|
70
|
+
periodLow: 0,
|
|
71
|
+
priceChangePercent: '',
|
|
72
|
+
currentPrice: 0,
|
|
73
|
+
startingPrice: 0,
|
|
74
|
+
priceRange: 0,
|
|
75
|
+
rangePercentage: '',
|
|
76
|
+
},
|
|
55
77
|
};
|
|
56
78
|
}
|
|
57
79
|
if (!historyData.data.length) {
|
|
@@ -62,6 +84,17 @@ export async function handleGetHistoricalAnalysis(args) {
|
|
|
62
84
|
text: 'No historical data available for the selected time period',
|
|
63
85
|
},
|
|
64
86
|
],
|
|
87
|
+
structuredContent: {
|
|
88
|
+
name: asset.name,
|
|
89
|
+
symbol: asset.symbol,
|
|
90
|
+
periodHigh: 0,
|
|
91
|
+
periodLow: 0,
|
|
92
|
+
priceChangePercent: '',
|
|
93
|
+
currentPrice: 0,
|
|
94
|
+
startingPrice: 0,
|
|
95
|
+
priceRange: 0,
|
|
96
|
+
rangePercentage: '',
|
|
97
|
+
},
|
|
65
98
|
};
|
|
66
99
|
}
|
|
67
100
|
const currentPrice = parseFloat(asset.priceUsd);
|
|
@@ -101,6 +134,17 @@ export async function handleGetHistoricalAnalysis(args) {
|
|
|
101
134
|
: `Failed to retrieve historical data: ${String(error)}`,
|
|
102
135
|
},
|
|
103
136
|
],
|
|
137
|
+
structuredContent: {
|
|
138
|
+
name: '',
|
|
139
|
+
symbol: '',
|
|
140
|
+
periodHigh: 0,
|
|
141
|
+
periodLow: 0,
|
|
142
|
+
priceChangePercent: '',
|
|
143
|
+
currentPrice: 0,
|
|
144
|
+
startingPrice: 0,
|
|
145
|
+
priceRange: 0,
|
|
146
|
+
rangePercentage: '',
|
|
147
|
+
},
|
|
104
148
|
};
|
|
105
149
|
}
|
|
106
150
|
}
|
package/dist/tools/market.js
CHANGED
|
@@ -33,12 +33,28 @@ export async function handleGetMarketAnalysis(args) {
|
|
|
33
33
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
|
+
structuredContent: {
|
|
37
|
+
name: '',
|
|
38
|
+
symbol: upperSymbol,
|
|
39
|
+
priceUsd: '',
|
|
40
|
+
volumeUsd24Hr: null,
|
|
41
|
+
vwap24Hr: null,
|
|
42
|
+
topMarkets: [],
|
|
43
|
+
},
|
|
36
44
|
};
|
|
37
45
|
}
|
|
38
46
|
const marketsData = await getMarkets(asset.id);
|
|
39
47
|
if (!marketsData) {
|
|
40
48
|
return {
|
|
41
49
|
content: [{ type: 'text', text: 'Failed to retrieve market data' }],
|
|
50
|
+
structuredContent: {
|
|
51
|
+
name: asset.name,
|
|
52
|
+
symbol: asset.symbol,
|
|
53
|
+
priceUsd: asset.priceUsd,
|
|
54
|
+
volumeUsd24Hr: asset.volumeUsd24Hr,
|
|
55
|
+
vwap24Hr: asset.vwap24Hr,
|
|
56
|
+
topMarkets: [],
|
|
57
|
+
},
|
|
42
58
|
};
|
|
43
59
|
}
|
|
44
60
|
const totalVolume = marketsData.data.reduce((sum, market) => sum + parseFloat(market.volumeUsd24Hr), 0);
|
|
@@ -76,6 +92,14 @@ export async function handleGetMarketAnalysis(args) {
|
|
|
76
92
|
: `Failed to retrieve data: ${String(error)}`,
|
|
77
93
|
},
|
|
78
94
|
],
|
|
95
|
+
structuredContent: {
|
|
96
|
+
name: '',
|
|
97
|
+
symbol: '',
|
|
98
|
+
priceUsd: '',
|
|
99
|
+
volumeUsd24Hr: null,
|
|
100
|
+
vwap24Hr: null,
|
|
101
|
+
topMarkets: [],
|
|
102
|
+
},
|
|
79
103
|
};
|
|
80
104
|
}
|
|
81
105
|
}
|
|
@@ -38,12 +38,26 @@ export async function handleGetPriceConversion(args) {
|
|
|
38
38
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
39
39
|
},
|
|
40
40
|
],
|
|
41
|
+
structuredContent: {
|
|
42
|
+
fromSymbol: upperSymbol,
|
|
43
|
+
amount,
|
|
44
|
+
toCurrency: upperCurrency,
|
|
45
|
+
conversionRate: 0,
|
|
46
|
+
convertedAmount: 0,
|
|
47
|
+
},
|
|
41
48
|
};
|
|
42
49
|
}
|
|
43
50
|
const rates = await getRates();
|
|
44
51
|
if (!rates) {
|
|
45
52
|
return {
|
|
46
53
|
content: [{ type: 'text', text: 'Failed to retrieve exchange rates' }],
|
|
54
|
+
structuredContent: {
|
|
55
|
+
fromSymbol: upperSymbol,
|
|
56
|
+
amount,
|
|
57
|
+
toCurrency: upperCurrency,
|
|
58
|
+
conversionRate: 0,
|
|
59
|
+
convertedAmount: 0,
|
|
60
|
+
},
|
|
47
61
|
};
|
|
48
62
|
}
|
|
49
63
|
const rate = rates.find((r) => r.symbol.toLowerCase() === upperCurrency);
|
|
@@ -55,6 +69,13 @@ export async function handleGetPriceConversion(args) {
|
|
|
55
69
|
text: `Could not find exchange rate for currency "${currency}". Available currencies include: usd, eur, gbp, jpy, etc.`,
|
|
56
70
|
},
|
|
57
71
|
],
|
|
72
|
+
structuredContent: {
|
|
73
|
+
fromSymbol: upperSymbol,
|
|
74
|
+
amount,
|
|
75
|
+
toCurrency: upperCurrency,
|
|
76
|
+
conversionRate: 0,
|
|
77
|
+
convertedAmount: 0,
|
|
78
|
+
},
|
|
58
79
|
};
|
|
59
80
|
}
|
|
60
81
|
const priceUsd = parseFloat(asset.priceUsd);
|
|
@@ -86,6 +107,13 @@ export async function handleGetPriceConversion(args) {
|
|
|
86
107
|
text: `Invalid input: ${error.issues.map((e) => e.message).join(', ')}`,
|
|
87
108
|
},
|
|
88
109
|
],
|
|
110
|
+
structuredContent: {
|
|
111
|
+
fromSymbol: '',
|
|
112
|
+
amount: 0,
|
|
113
|
+
toCurrency: '',
|
|
114
|
+
conversionRate: 0,
|
|
115
|
+
convertedAmount: 0,
|
|
116
|
+
},
|
|
89
117
|
};
|
|
90
118
|
}
|
|
91
119
|
return {
|
|
@@ -97,6 +125,13 @@ export async function handleGetPriceConversion(args) {
|
|
|
97
125
|
: `Failed to convert price: ${String(error)}`,
|
|
98
126
|
},
|
|
99
127
|
],
|
|
128
|
+
structuredContent: {
|
|
129
|
+
fromSymbol: '',
|
|
130
|
+
amount: 0,
|
|
131
|
+
toCurrency: '',
|
|
132
|
+
conversionRate: 0,
|
|
133
|
+
convertedAmount: 0,
|
|
134
|
+
},
|
|
100
135
|
};
|
|
101
136
|
}
|
|
102
137
|
}
|
package/dist/tools/price.js
CHANGED
|
@@ -29,6 +29,15 @@ export async function handleGetPrice(args) {
|
|
|
29
29
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
|
+
structuredContent: {
|
|
33
|
+
name: '',
|
|
34
|
+
symbol: upperSymbol,
|
|
35
|
+
priceUsd: '',
|
|
36
|
+
changePercent24Hr: null,
|
|
37
|
+
volumeUsd24Hr: null,
|
|
38
|
+
marketCapUsd: null,
|
|
39
|
+
rank: null,
|
|
40
|
+
},
|
|
32
41
|
};
|
|
33
42
|
}
|
|
34
43
|
return {
|
|
@@ -54,6 +63,15 @@ export async function handleGetPrice(args) {
|
|
|
54
63
|
: `Failed to retrieve cryptocurrency data: ${String(error)}`,
|
|
55
64
|
},
|
|
56
65
|
],
|
|
66
|
+
structuredContent: {
|
|
67
|
+
name: '',
|
|
68
|
+
symbol: '',
|
|
69
|
+
priceUsd: '',
|
|
70
|
+
changePercent24Hr: null,
|
|
71
|
+
volumeUsd24Hr: null,
|
|
72
|
+
marketCapUsd: null,
|
|
73
|
+
rank: null,
|
|
74
|
+
},
|
|
57
75
|
};
|
|
58
76
|
}
|
|
59
77
|
}
|
package/dist/tools/rates.js
CHANGED
|
@@ -29,6 +29,7 @@ export async function handleGetRates(args) {
|
|
|
29
29
|
text: `Could not find rate for slug "${slug}". Try a slug like 'us-dollar', 'euro', or 'bitcoin'.`,
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
|
+
structuredContent: { rates: [] },
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
return {
|
|
@@ -50,6 +51,7 @@ export async function handleGetRates(args) {
|
|
|
50
51
|
if (!rates) {
|
|
51
52
|
return {
|
|
52
53
|
content: [{ type: 'text', text: 'Failed to retrieve currency rates' }],
|
|
54
|
+
structuredContent: { rates: [] },
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
return {
|
|
@@ -75,6 +77,7 @@ export async function handleGetRates(args) {
|
|
|
75
77
|
: `Failed to retrieve rates: ${String(error)}`,
|
|
76
78
|
},
|
|
77
79
|
],
|
|
80
|
+
structuredContent: { rates: [] },
|
|
78
81
|
};
|
|
79
82
|
}
|
|
80
83
|
}
|
|
@@ -30,6 +30,7 @@ export async function handleSearchAssets(args) {
|
|
|
30
30
|
if (!results) {
|
|
31
31
|
return {
|
|
32
32
|
content: [{ type: 'text', text: 'Failed to search for assets' }],
|
|
33
|
+
structuredContent: { results: [] },
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
if (results.length === 0) {
|
|
@@ -40,6 +41,7 @@ export async function handleSearchAssets(args) {
|
|
|
40
41
|
text: `No cryptocurrencies found matching "${query}"`,
|
|
41
42
|
},
|
|
42
43
|
],
|
|
44
|
+
structuredContent: { results: [] },
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
return {
|
|
@@ -65,6 +67,7 @@ export async function handleSearchAssets(args) {
|
|
|
65
67
|
text: `Invalid input: ${error.issues.map((e) => e.message).join(', ')}`,
|
|
66
68
|
},
|
|
67
69
|
],
|
|
70
|
+
structuredContent: { results: [] },
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
73
|
return {
|
|
@@ -76,6 +79,7 @@ export async function handleSearchAssets(args) {
|
|
|
76
79
|
: `Failed to search for assets: ${String(error)}`,
|
|
77
80
|
},
|
|
78
81
|
],
|
|
82
|
+
structuredContent: { results: [] },
|
|
79
83
|
};
|
|
80
84
|
}
|
|
81
85
|
}
|
|
@@ -39,6 +39,16 @@ export async function handleGetTechnicalAnalysis(args) {
|
|
|
39
39
|
text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
|
|
40
40
|
},
|
|
41
41
|
],
|
|
42
|
+
structuredContent: {
|
|
43
|
+
name: '',
|
|
44
|
+
symbol: upperSymbol,
|
|
45
|
+
currentPrice: '',
|
|
46
|
+
sma: null,
|
|
47
|
+
ema: null,
|
|
48
|
+
rsi: null,
|
|
49
|
+
macd: null,
|
|
50
|
+
vwap: null,
|
|
51
|
+
},
|
|
42
52
|
};
|
|
43
53
|
}
|
|
44
54
|
const ta = await getTechnicalAnalysis(asset.id);
|
|
@@ -50,6 +60,16 @@ export async function handleGetTechnicalAnalysis(args) {
|
|
|
50
60
|
text: `Failed to retrieve technical analysis for ${asset.name} (${asset.symbol})`,
|
|
51
61
|
},
|
|
52
62
|
],
|
|
63
|
+
structuredContent: {
|
|
64
|
+
name: asset.name,
|
|
65
|
+
symbol: asset.symbol,
|
|
66
|
+
currentPrice: asset.priceUsd,
|
|
67
|
+
sma: null,
|
|
68
|
+
ema: null,
|
|
69
|
+
rsi: null,
|
|
70
|
+
macd: null,
|
|
71
|
+
vwap: null,
|
|
72
|
+
},
|
|
53
73
|
};
|
|
54
74
|
}
|
|
55
75
|
const rsiValue = ta.rsi ? parseFloat(ta.rsi.value) : null;
|
|
@@ -103,6 +123,16 @@ export async function handleGetTechnicalAnalysis(args) {
|
|
|
103
123
|
: `Failed to retrieve technical analysis: ${String(error)}`,
|
|
104
124
|
},
|
|
105
125
|
],
|
|
126
|
+
structuredContent: {
|
|
127
|
+
name: '',
|
|
128
|
+
symbol: '',
|
|
129
|
+
currentPrice: '',
|
|
130
|
+
sma: null,
|
|
131
|
+
ema: null,
|
|
132
|
+
rsi: null,
|
|
133
|
+
macd: null,
|
|
134
|
+
vwap: null,
|
|
135
|
+
},
|
|
106
136
|
};
|
|
107
137
|
}
|
|
108
138
|
}
|
package/dist/tools/top-assets.js
CHANGED
|
@@ -27,12 +27,14 @@ export async function handleGetTopAssets(args) {
|
|
|
27
27
|
if (!assetsData) {
|
|
28
28
|
return {
|
|
29
29
|
content: [{ type: 'text', text: 'Failed to retrieve assets data' }],
|
|
30
|
+
structuredContent: { assets: [] },
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
const topAssets = assetsData.data.slice(0, limit);
|
|
33
34
|
if (!topAssets.length) {
|
|
34
35
|
return {
|
|
35
36
|
content: [{ type: 'text', text: 'No assets data available' }],
|
|
37
|
+
structuredContent: { assets: [] },
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
return {
|
|
@@ -60,6 +62,7 @@ export async function handleGetTopAssets(args) {
|
|
|
60
62
|
: `Failed to retrieve assets data: ${String(error)}`,
|
|
61
63
|
},
|
|
62
64
|
],
|
|
65
|
+
structuredContent: { assets: [] },
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-crypto-price",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "A Model Context Protocol (MCP) server that provides real-time cryptocurrency data and analysis through CoinCap's API. Features include price tracking, market analysis, and historical trends.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
Binary file
|