get-tx-status
Check Bitcoin transaction status by providing a transaction ID to verify confirmation and network state.
Instructions
Returns status for a transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txid | Yes | The txid to get status for |
Implementation Reference
- src/interface/controllers/TxToolsController.ts:34-46 (registration)Registers the MCP 'get-tx-status' tool: defines description, input schema (txid: 64-hex string), and handler lambda that delegates to TxService.getTxStatus and structures MCP response.private registerGetTxStatusHandler(): void { this.server.tool( "get-tx-status", "Returns status for a transaction", { txid: z.string().length(64).describe("The txid to get status for"), }, async ({ txid }) => { const text = await this.txService.getTxStatus({ txid }); return { content: [{ type: "text", text }] }; } ); }
- Core handler logic in TxRequestService: performs the actual API request to `/tx/${txid}/status` via IApiClient.makeRequest, typed to ITxStatusResponse.async getTxStatus({ txid }: { txid: string }): Promise<ITxStatusResponse | null> { return this.client.makeRequest<ITxStatusResponse>(`tx/${txid}/status`); }
- Intermediate service layer: calls TxRequestService.getTxStatus and formats the response into a string using formatResponse.async getTxStatus({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxStatus({ txid }); return formatResponse<ITxStatusResponse>("Transaction Status", data); }
- TypeScript interface defining the structure of the transaction status response used throughout the implementation.export interface ITxStatusResponse { confirmed: boolean; block_height?: number; block_hash?: string; block_time?: number; }
- Utility function to format response objects into readable key-value strings, used in TxService.export const formatResponse = <T extends object>( title: string, data: T | null ): string => { if (!data) { return `Failed to retrieve ${title.toLowerCase()} data.`; } let msg = `${title}:\n`; for (const [key, value] of Object.entries(data)) { msg += `${key}: ${value ?? "N/A"}\n`; } return msg.trim(); };