get-tx-info
Retrieve transaction details from the Bitcoin blockchain by providing a transaction ID, enabling users to access specific transaction information through the Mempool MCP Server.
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)Registers the MCP tool 'get-tx-info' with input schema for txid (64-char string), description, and handler that fetches from TxService and returns 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 }] }; } ); }
- Application service layer: Retrieves transaction info via request service and formats it using formatResponse.async getTxInfo({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxInfo({ txid }); return formatResponse<ITxResponse>("Transaction Info", data); }
- Infrastructure layer handler: Performs the actual API request to fetch transaction info from `tx/${txid}` endpoint.async getTxInfo({ txid }: { txid: string }): Promise<ITxResponse | null> { return this.client.makeRequest<ITxResponse>(`tx/${txid}`); }
- src/main.ts:127-127 (registration)Instantiates TxToolsController in main application entrypoint, which triggers the registration of all its tools including 'get-tx-info'.new TxToolsController(server, txService);
- Input schema definition for the 'get-tx-info' tool using Zod: txid as 64-character string.{ txid: z.string().length(64).describe("The txid to get info for"), },