Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-blocks

Retrieve recent Bitcoin blockchain data to monitor network activity and analyze transaction patterns using real-time mempool information.

Instructions

Returns the latest blocks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the MCP tool 'get-blocks' with empty input schema. The inline handler fetches latest blocks using BlocksService.getBlocks() and returns the formatted text as MCP 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 }] }; } ); }
  • BlocksService.getBlocks(): Delegates to BlocksRequestService.getBlocks() and formats the response using formatResponse for JSON string output.
    async getBlocks(): Promise<string> { const data = await this.requestService.getBlocks(); return formatResponse<IBlocksResponse[]>("Blocks", data); }
  • Core implementation: Makes an API request to the 'blocks' endpoint using IApiClient.makeRequest to fetch the latest blocks data.
    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