get_crypto_price
Retrieve current cryptocurrency prices in specified markets to monitor digital asset values and support financial analysis.
Instructions
Get cryptocurrency prices
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The crypto symbol (e.g., BTC) | |
| market | Yes | Market currency (e.g., USD) |
Implementation Reference
- src/index.ts:306-322 (handler)The main handler function that executes the 'get_crypto_price' tool by querying the Alpha Vantage API with the CRYPTO_INTRADAY function and returning the JSON response.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:173-190 (registration)Registers the 'get_crypto_price' tool in the ListTools response, including its 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:176-189 (schema)Defines the input schema for the 'get_crypto_price' tool, specifying required 'symbol' and 'market' string parameters.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 (handler)Switch case in the CallTool request handler that dispatches 'get_crypto_price' calls to the getCryptoPrice method.case 'get_crypto_price': return await this.getCryptoPrice(request.params.arguments);