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
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | The block hash to get txs for |
Implementation Reference
- src/interface/controllers/BlocksToolsController.ts:47-58 (registration)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"), },