get-tx-outspend
Check if a Bitcoin transaction output has been spent by querying its spending transaction details using transaction ID and output index.
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)Registers the MCP tool 'get-tx-outspend' with server.tool, including tool name, description, Zod input schema (txid, vout), and async handler that delegates to TxService.getTxOutspend and returns MCP-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 }] }; } ); }
- Application service method getTxOutspend that calls the infrastructure request service and formats the response for the tool handler.async getTxOutspend({ txid, vout, }: { txid: string; vout: number; }): Promise<string> { const data = await this.requestService.getTxOutspend({ txid, vout }); return formatResponse<any>("Transaction Outspend", data); }
- Infrastructure service method that makes the actual API request to fetch outspend data for the given txid and vout via IApiClient.async getTxOutspend({ txid, vout }: { txid: string; vout: number }): Promise<any | null> { return this.client.makeRequest<any>(`tx/${txid}/outspend/${vout}`); }