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
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | The block hash to get txids for |
Implementation Reference
- src/interface/controllers/BlocksToolsController.ts:33-45 (registration)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`); }