get-tx-outspend
Retrieve outspend details for a specific Bitcoin transaction output by providing the transaction ID (txid) and output index (vout), enabling precise tracking of spent UTXOs.
Instructions
Returns outspend info for a transaction output
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txid | Yes | The txid to get outspend for | |
| vout | Yes | The vout index to get outspend for |
Implementation Reference
- src/interface/controllers/TxToolsController.ts:76-89 (registration)Full registration of the 'get-tx-outspend' tool, including description, Zod input schema (txid and vout), and handler function that calls TxService.getTxOutspend and returns formatted text content.private registerGetTxOutspendHandler(): void { this.server.tool( "get-tx-outspend", "Returns outspend info for a transaction output", { txid: z.string().length(64).describe("The txid to get outspend for"), vout: z.number().int().describe("The vout index to get outspend for"), }, async ({ txid, vout }) => { const text = await this.txService.getTxOutspend({ txid, vout }); return { content: [{ type: "text", text }] }; } ); }
- TxService.getTxOutspend: Delegates to TxRequestService and formats the outspend response using formatResponse.async getTxOutspend({ txid, vout, }: { txid: string; vout: number; }): Promise<string> { const data = await this.requestService.getTxOutspend({ txid, vout }); return formatResponse<any>("Transaction Outspend", data); }
- Core implementation logic: Makes API request to `/tx/{txid}/outspend/{vout}` via IApiClient to fetch the outspend data.async getTxOutspend({ txid, vout }: { txid: string; vout: number }): Promise<any | null> { return this.client.makeRequest<any>(`tx/${txid}/outspend/${vout}`); }