get_candlestick
Retrieve candlestick chart data for cryptocurrency trading analysis from the Bithumb exchange. Specify currency pairs and time intervals to access historical price patterns and market trends.
Instructions
Get Candlestick data (Public)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderCurrency | Yes | Cryptocurrency symbol (e.g. BTC, ETH) | |
| paymentCurrency | Yes | Payment currency (KRW or BTC) | |
| chartIntervals | Yes | Chart interval |
Implementation Reference
- src/bitThumb/index.ts:113-133 (handler)Core handler function that executes the get_candlestick tool logic: constructs the API endpoint, calls the public request, maps raw candlestick data to structured IGetCandlestickData array.public async GetCandlestick( orderCurrency: string, paymentCurrency: currencyType, chartIntervals: Time, ): Promise<IGetCandlestickData[]> { const endpoint = `/candlestick/${orderCurrency}_${paymentCurrency}`; const res = <IGetCandlestick>( await this.requestPublic(endpoint, chartIntervals) ); const candleData: IGetCandlestickData[] = res.data.map((candle) => ({ timestamp: candle[0], opening_price: candle[1], closing_price: candle[2], max_price: candle[3], min_price: candle[4], volume: candle[5], })); return candleData; }
- src/index.ts:312-318 (handler)MCP tool dispatch handler: extracts arguments and invokes the Bithumb API's GetCandlestick method upon tool call.case 'get_candlestick': result = await this.bithumbApi.GetCandlestick( args.orderCurrency as string, args.paymentCurrency as currencyType, // Cast to expected type args.chartIntervals as Time // Cast to expected type ); break;
- src/index.ts:113-124 (registration)Registers the 'get_candlestick' tool in the MCP server with name, description, and input schema validation.name: 'get_candlestick', description: 'Get Candlestick data (Public)', inputSchema: { type: 'object', properties: { orderCurrency: { type: 'string', description: 'Cryptocurrency symbol (e.g. BTC, ETH)' }, paymentCurrency: { type: 'string', enum: ['KRW', 'BTC'], description: 'Payment currency (KRW or BTC)' }, // Assuming KRW/BTC based on standard usage chartIntervals: { type: 'string', enum: ['1m', '3m', '5m', '10m', '30m', '1h', '6h', '12h', '24h'], description: 'Chart interval' } // Assuming standard intervals }, required: ['orderCurrency', 'paymentCurrency', 'chartIntervals'] } },
- TypeScript interface defining the raw response structure from Bithumb candlestick API (extends IBithumbResponse).import { IBithumbResponse } from './bithumb-response.interface.js'; export interface IGetCandlestick extends IBithumbResponse { /** [timestamp, opening amount, closing amount, max price, min price, volume] */ data: [number, string, string, string, string, string][]; }
- TypeScript interface for the processed candlestick data returned by the handler (one candle object).export interface IGetCandlestickData { timestamp: number; opening_price: string; closing_price: string; max_price: string; min_price: string; volume: string; }