get-tx-merkleblock-proof
Generate a merkleblock proof for a Bitcoin transaction to verify its inclusion in a block. Input a transaction ID (txid) to retrieve the proof, ensuring transaction validity within the blockchain.
Instructions
Returns the merkleblock proof for a transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txid | Yes | The txid to get merkleblock proof for |
Implementation Reference
- src/interface/controllers/TxToolsController.ts:62-74 (registration)Registers the MCP tool 'get-tx-merkleblock-proof' including schema (zod validation for txid), description, and handler lambda that delegates to TxServiceprivate registerGetTxMerkleblockProofHandler(): void { this.server.tool( "get-tx-merkleblock-proof", "Returns the merkleblock proof for a transaction", { txid: z.string().length(64).describe("The txid to get merkleblock proof for"), }, async ({ txid }) => { const text = await this.txService.getTxMerkleblockProof({ txid }); return { content: [{ type: "text", text }] }; } ); }
- Zod schema for tool input: txid as 64-char string{ txid: z.string().length(64).describe("The txid to get merkleblock proof for"),
- Core handler logic: makes API request to `/tx/${txid}/merkleblock-proof` via IApiClientasync getTxMerkleblockProof({ txid }: { txid: string }): Promise<string | null> { return this.client.makeRequest<string>(`tx/${txid}/merkleblock-proof`); }
- Helper wrapper in TxService that calls TxRequestService and adds prefix to responseasync getTxMerkleblockProof({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxMerkleblockProof({ txid }); return `Transaction Merkleblock Proof: ${data}`; }