get-block-status
Retrieve the status of a Bitcoin block by providing its hash, ensuring accurate and real-time blockchain data access via the Mempool MCP Server.
Instructions
Returns status for a block
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | The block hash to get status for |
Implementation Reference
- src/interface/controllers/BlocksToolsController.ts:61-73 (registration)Registers the MCP tool 'get-block-status' with the server, defines the input schema using Zod for the block hash parameter, and implements the tool handler as an async function that fetches the status via BlocksService and returns formatted text content.private registerGetBlockStatusHandler(): void { this.server.tool( "get-block-status", "Returns status for a block", { hash: z.string().length(64).describe("The block hash to get status for"), }, async ({ hash }) => { const text = await this.blocksService.getBlockStatus({ hash }); return { content: [{ type: "text", text }] }; } ); }
- Application service handler for getBlockStatus that retrieves raw data from the request service and formats it using formatResponse helper.async getBlockStatus({ hash }: IHashParameter): Promise<string> { const data = await this.requestService.getBlockStatus({ hash }); return formatResponse<IBlockStatusResponse>("Block Status", data); }
- Infrastructure helper that performs the actual API request to fetch block status for the given hash.async getBlockStatus({ hash }: { hash: string }): Promise<IBlockStatusResponse | null> { return this.client.makeRequest<IBlockStatusResponse>(`block/${hash}/status`); }