get-block-txs
Retrieve Bitcoin block transactions by providing a specific block hash to access transaction data from the blockchain.
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
- Core implementation of fetching block transactions via API request to endpoint `block/${hash}/txs` using the API client.async getBlockTxs({ hash }: { hash: string }): Promise<IBlockTxsResponse[] | null> { return this.client.makeRequest<IBlockTxsResponse[]>(`block/${hash}/txs`); }
- Service layer handler that retrieves block transactions from request service and formats the response using formatResponse.async getBlockTxs({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlockTxs({ hash }); return formatResponse<IBlockTxsResponse[]>("Block Txs", data); }
- src/interface/controllers/BlocksToolsController.ts:47-58 (registration)Registers the "get-block-txs" MCP tool, defines input schema (hash: 64-char string), and provides thin handler that delegates to BlocksService.getBlockTxs and returns MCP-formatted response.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 }] }; } );
- TypeScript interface defining the expected structure of individual block transaction responses (output schema).export interface IBlockTxsResponse { txid: string; status: { confirmed: boolean; block_height?: number; block_hash?: string; block_time?: number; }; vin: any[]; vout: any[]; }