get-tx-info
Retrieve detailed information about a Bitcoin transaction using its txid with Mempool MCP Server, enabling precise blockchain data access for analysis or verification.
Instructions
Returns details about a transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txid | Yes | The txid to get info for |
Implementation Reference
- src/interface/controllers/TxToolsController.ts:20-32 (registration)Registration of the 'get-tx-info' MCP tool including input schema (zod for txid), description, and thin handler function that calls TxService.getTxInfo and returns formatted text content.private registerGetTxHandler(): void { this.server.tool( "get-tx-info", "Returns details about a transaction", { txid: z.string().length(64).describe("The txid to get info for"), }, async ({ txid }) => { const text = await this.txService.getTxInfo({ txid }); return { content: [{ type: "text", text }] }; } ); }
- Core handler logic for fetching and formatting transaction info using request service and formatResponse helper.async getTxInfo({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxInfo({ txid }); return formatResponse<ITxResponse>("Transaction Info", data); }
- Type definition (schema) for the transaction info response data structure.export interface ITxResponse { txid: string; version: number; locktime: number; vin: any[]; vout: any[]; size: number; weight: number; fee: number; status: ITxStatusResponse; }
- Low-level helper that performs the actual API request to retrieve raw transaction info for the given txid.async getTxInfo({ txid }: { txid: string }): Promise<ITxResponse | null> { return this.client.makeRequest<ITxResponse>(`tx/${txid}`); }