Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block-txids

Retrieve transaction IDs (txids) for a specific Bitcoin block by providing its hash, enabling detailed blockchain analysis and data extraction through the Mempool MCP Server.

Instructions

Returns txids for a block

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe block hash to get txids for

Implementation Reference

  • Registers the 'get-block-txids' MCP tool, defining its name, description, input schema (hash: 64-char string), and handler function that invokes BlocksService.getBlockTxids and returns MCP-formatted text response.
    private registerGetBlockTxidsHandler(): void { this.server.tool( "get-block-txids", "Returns txids for a block", { hash: z.string().length(64).describe("The block hash to get txids for"), }, async ({ hash }) => { const text = await this.blocksService.getBlockTxids({ hash }); return { content: [{ type: "text", text }] }; } ); }
  • Helper method in BlocksService that retrieves txids data from BlocksRequestService and formats it into a string response using formatResponse.
    async getBlockTxids({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlockTxids({ hash }); return formatResponse<IBlockTxidsResponse[]>("Block Txids", data); }
  • Core helper in BlocksRequestService that performs the actual API request to fetch block txids using the endpoint `block/${hash}/txids` via IApiClient.
    async getBlockTxids({ hash }: { hash: string }): Promise<IBlockTxidsResponse[] | null> { return this.client.makeRequest<IBlockTxidsResponse[]>(`block/${hash}/txids`); }

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