Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block

Retrieve detailed Bitcoin block information using a specific hash with the MCP server’s tool designed for accessing real-time blockchain data.

Instructions

Returns details about a block from hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe hash info to get block

Implementation Reference

  • The handler function that executes the core logic of the 'get-block' tool: fetches block data via BlockService and returns it formatted as MCP text content.
    async ({ hash }: IHashParameter) => { const text = await this.service.getBlock({ hash }); return { content: [ { type: "text", text: text, }, ], }; }
  • Input schema for the 'get-block' tool using Zod: requires a 64-character hash string.
    { hash: z.string().length(64).describe("The hash info to get block"), },
  • Registration of the 'get-block' MCP tool on the server, including description, schema, and handler.
    "get-block", "Returns details about a block from hash", { hash: z.string().length(64).describe("The hash info to get block"), }, async ({ hash }: IHashParameter) => { const text = await this.service.getBlock({ hash }); return { content: [ { type: "text", text: text, }, ], }; } );
  • Supporting service method in BlockService that fetches block data from BlockRequestService and formats the response.
    async getBlock({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlock({ hash }); return formatResponse<IBlockResponse>("Details about a block.", data); }

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