get-block
Retrieve detailed Bitcoin block information by providing the block hash, enabling access to blockchain data for analysis and verification purposes.
Instructions
Returns details about a block from hash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | The hash info to get block |
Implementation Reference
- src/interface/controllers/BlockToolsController.ts:17-37 (registration)Registers the 'get-block' MCP tool, defining its schema (hash: string length 64), description, and handler function that delegates to BlockService.getBlock and returns formatted text content.private registerGetRecommendedFeesHandler(): void { this.server.tool( "get-block", "Returns details about a block from hash", { hash: z.string().length(64).describe("The hash info to get block"), }, async ({ hash }: IHashParameter) => { const text = await this.service.getBlock({ hash }); return { content: [ { type: "text", text: text, }, ], }; } ); }
- Handler in BlockService that fetches block data from BlockRequestService and formats the response using formatResponse.async getBlock({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlock({ hash }); return formatResponse<IBlockResponse>("Details about a block.", data); }
- Core handler in BlockRequestService that performs the API request to retrieve block details using the hash.async getBlock({ hash }: IHashParameter): Promise<IBlockResponse | null> { return this.client.makeRequest<IBlockResponse>(`block/${hash}`); }
- TypeScript interface defining the input parameter structure for the get-block tool (hash: string). Note: Zod schema in controller adds length(64) validation.export interface IHashParameter { hash: string; }