get-block-txids
Retrieve transaction IDs for a specific Bitcoin block by providing its hash. This tool accesses blockchain data to list all transaction identifiers within a given block.
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, including description, input schema (hash: 64-char string), and handler that delegates to BlocksService and formats response as text.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 }] }; } ); }
- Application service method that retrieves block txids via request service and formats the response using formatResponse.async getBlockTxids({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlockTxids({ hash }); return formatResponse<IBlockTxidsResponse[]>("Block Txids", data); }
- Infrastructure service method implementing the core logic: API request to `/block/{hash}/txids` via IApiClient.async getBlockTxids({ hash }: { hash: string }): Promise<IBlockTxidsResponse[] | null> { return this.client.makeRequest<IBlockTxidsResponse[]>(`block/${hash}/txids`); }