Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-historical-price

Retrieve the Bitcoin price for a specific date in YYYY-MM-DD format using this tool from the Mempool MCP Server, designed for accessing historical BTC price data.

Instructions

Returns the BTC price for a specific date (YYYY-MM-DD)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesThe date in YYYY-MM-DD format

Implementation Reference

  • Registers the MCP tool 'get-historical-price' with description, input schema (date: YYYY-MM-DD Zod validator), and handler function that delegates to GeneralService.getHistoricalPrice and formats response as MCP content.
    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 }] }; } ); }
  • Application layer service method: fetches data from infrastructure request service and formats it using formatResponse helper.
    async getHistoricalPrice(date: string): Promise<string> { const data = await this.requestService.getHistoricalPrice(date); return formatResponse<any>("Historical Price", data); }
  • Infrastructure layer: executes the core logic by making an API request to the mempool.space endpoint `/api/historical-price/{date}` via IApiClient.
    async getHistoricalPrice(date: string): Promise<any | null> { // date format: YYYY-MM-DD return this.client.makeRequest<any>(`historical-price/${date}`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexandresanlim/mempool-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server