Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block-txs

Retrieve all transactions for a specific Bitcoin block using its hash, providing detailed blockchain data for analysis and insights through the Mempool MCP Server.

Instructions

Returns transactions for a block

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe block hash to get txs for

Implementation Reference

  • Registers the MCP tool 'get-block-txs' with Zod input schema (block hash) and handler function that delegates to BlocksService.getBlockTxs and formats response as text content.
    private registerGetBlockTxsHandler(): void { this.server.tool( "get-block-txs", "Returns transactions for a block", { hash: z.string().length(64).describe("The block hash to get txs for"), }, async ({ hash }) => { const text = await this.blocksService.getBlockTxs({ hash }); return { content: [{ type: "text", text }] }; } );
  • BlocksService.getBlockTxs fetches transactions from BlocksRequestService and formats the response using formatResponse utility.
    async getBlockTxs({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlockTxs({ hash }); return formatResponse<IBlockTxsResponse[]>("Block Txs", data); }
  • BlocksRequestService.getBlockTxs performs the core API request to retrieve transactions for the given block hash via IApiClient.makeRequest.
    async getBlockTxs({ hash }: { hash: string }): Promise<IBlockTxsResponse[] | null> { return this.client.makeRequest<IBlockTxsResponse[]>(`block/${hash}/txs`); }
  • Zod schema for input parameter 'hash' of the get-block-txs tool.
    { hash: z.string().length(64).describe("The block hash to get txs 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