Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block-raw

Retrieve raw hex data for a specific Bitcoin block by providing its unique hash using the Mempool MCP Server tool designed for accessing real-time blockchain information.

Instructions

Returns raw hex for a block

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe block hash to get raw hex for

Implementation Reference

  • Registers the MCP 'get-block-raw' tool with input schema for block hash and a handler that fetches raw block data via BlocksService and returns it as text content.
    private registerGetBlockRawHandler(): void { this.server.tool( "get-block-raw", "Returns raw hex for a block", { hash: z.string().length(64).describe("The block hash to get raw hex for"), }, async ({ hash }) => { const text = await this.blocksService.getBlockRaw({ hash }); return { content: [{ type: "text", text }] }; } ); }
  • Core implementation of fetching raw block hex by making an API request to the endpoint `block/${hash}/raw` using IApiClient.
    async getBlockRaw({ hash }: { hash: string }): Promise<string | null> { return this.client.makeRequest<string>(`block/${hash}/raw`); }
  • Helper service method that delegates to BlocksRequestService and adds a 'Block Raw Hex:' prefix to the raw data.
    async getBlockRaw({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlockRaw({ hash }); return `Block Raw Hex: ${data}`; }
  • Zod input schema validating the block hash as a 64-character string.
    { hash: z.string().length(64).describe("The block hash to get raw hex for"), },

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