Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-blocks

Retrieve the latest Bitcoin blocks in real-time using the Mempool MCP Server, enabling access to up-to-date blockchain data for AI and analytics applications.

Instructions

Returns the latest blocks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the MCP 'get-blocks' tool on the server with no input parameters and an async handler that fetches blocks via BlocksService and returns formatted text content.
    private registerGetBlocksHandler(): void { this.server.tool( "get-blocks", "Returns the latest blocks", {}, async () => { const text = await this.blocksService.getBlocks(); return { content: [{ type: "text", text }] }; } ); }
  • Handler method in BlocksService that retrieves blocks data from the request service and formats it using formatResponse.
    async getBlocks(): Promise<string> { const data = await this.requestService.getBlocks(); return formatResponse<IBlocksResponse[]>("Blocks", data); }
  • Core handler implementation in BlocksRequestService that performs the actual API request to the 'blocks' endpoint using IApiClient.
    async getBlocks(): Promise<IBlocksResponse[] | null> { return this.client.makeRequest<IBlocksResponse[]>(`blocks`); }

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