get-historical-price
Retrieve Bitcoin price data for specific dates to analyze historical market trends and track value changes over time.
Instructions
Returns the BTC price for a specific date (YYYY-MM-DD)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | The date in YYYY-MM-DD format |
Implementation Reference
- src/interface/controllers/GeneralToolsController.ts:39-51 (registration)Registers the 'get-historical-price' MCP tool with input schema (date: YYYY-MM-DD) and thin handler that delegates to GeneralService.getHistoricalPrice.private registerGetHistoricalPriceHandler(): void { this.server.tool( "get-historical-price", "Returns the BTC price for a specific date (YYYY-MM-DD)", { date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("The date in YYYY-MM-DD format") }, async ({ date }) => { const text = await this.generalService.getHistoricalPrice(date); return { content: [{ type: "text", text }] }; } ); }
- Core handler implementation: performs the API request to fetch historical BTC price for the given date.async getHistoricalPrice(date: string): Promise<any | null> { // date format: YYYY-MM-DD return this.client.makeRequest<any>(`historical-price/${date}`); }
- Application service helper that delegates to infrastructure request service and formats the response.async getHistoricalPrice(date: string): Promise<string> { const data = await this.requestService.getHistoricalPrice(date); return formatResponse<any>("Historical Price", data); }