get_crypto_price
Retrieve real-time cryptocurrency prices using a specific symbol and market currency. Integrates with Alpha Vantage for accurate financial data.
Instructions
Get cryptocurrency prices
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market | Yes | Market currency (e.g., USD) | |
| symbol | Yes | The crypto symbol (e.g., BTC) |
Input Schema (JSON Schema)
{
"properties": {
"market": {
"description": "Market currency (e.g., USD)",
"type": "string"
},
"symbol": {
"description": "The crypto symbol (e.g., BTC)",
"type": "string"
}
},
"required": [
"symbol",
"market"
],
"type": "object"
}
Implementation Reference
- src/index.ts:306-322 (handler)The main handler function that executes the get_crypto_price tool by calling the Alpha Vantage CRYPTO_INTRADAY API endpoint with the provided symbol and market.private async getCryptoPrice(args: any) { const response = await this.axiosInstance.get('', { params: { function: 'CRYPTO_INTRADAY', symbol: args.symbol, market: args.market, }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:176-189 (schema)Input schema defining the parameters for the get_crypto_price tool: symbol (string) and market (string).inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'The crypto symbol (e.g., BTC)', }, market: { type: 'string', description: 'Market currency (e.g., USD)', }, }, required: ['symbol', 'market'], },
- src/index.ts:173-190 (registration)Registration of the get_crypto_price tool in the ListTools response, including name, description, and input schema.{ name: 'get_crypto_price', description: 'Get cryptocurrency prices', inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'The crypto symbol (e.g., BTC)', }, market: { type: 'string', description: 'Market currency (e.g., USD)', }, }, required: ['symbol', 'market'], }, },
- src/index.ts:63-64 (registration)Dispatcher case in the CallToolRequest handler that routes requests for get_crypto_price to the handler function.case 'get_crypto_price': return await this.getCryptoPrice(request.params.arguments);