sodax_get_transaction
Look up a transaction by hash to view its status, amounts, and details from the SODAX cross-chain API.
Instructions
Look up a specific transaction by its hash to see status, amounts, and details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txHash | Yes | The transaction hash to look up (e.g., '0x...') | |
| format | No | Response format: 'json' for raw data or 'markdown' for formatted text | markdown |
Implementation Reference
- src/services/sodaxApi.ts:112-123 (handler)The core implementation that fetches transaction data from the SODAX API endpoint /intent/tx/{txHash}. Returns Transaction or null (if 404).
export async function getTransaction(txHash: string): Promise<Transaction | null> { try { const response = await apiClient.get(`/intent/tx/${txHash}`); return response.data?.data || response.data || null; } catch (error) { if (axios.isAxiosError(error) && error.response?.status === 404) { return null; } console.error("Error fetching transaction:", error); throw new Error("Failed to fetch transaction from SODAX API"); } } - src/tools/sodaxApi.ts:167-199 (registration)Registers the 'sodax_get_transaction' tool on the MCP server with input schema (txHash, format) and handler that calls getTransaction().
// Tool 3: Get Transaction server.tool( "sodax_get_transaction", "Look up a specific transaction by its hash to see status, amounts, and details", { txHash: z.string() .describe("The transaction hash to look up (e.g., '0x...')"), format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, READ_ONLY, async ({ txHash, format }) => { try { const transaction = await getTransaction(txHash); if (!transaction) { return { content: [{ type: "text", text: `Transaction not found: ${txHash}` }] }; } return { content: [{ type: "text", text: `## Transaction Details\n\n${formatResponse(transaction, format)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }], isError: true }; } } ); - src/tools/sodaxApi.ts:169-176 (schema)Input schema for the tool: txHash (string) and optional format (ResponseFormat enum with default Markdown), validated with Zod.
"sodax_get_transaction", "Look up a specific transaction by its hash to see status, amounts, and details", { txHash: z.string() .describe("The transaction hash to look up (e.g., '0x...')"), format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, - API drift check mapping: tool 'sodax_get_transaction' corresponds to GET /intent/tx/:txHash with required param txHash and expected response fields.
"GET /intent/tx/:txHash": { tool: "sodax_get_transaction", params: ["txHash"], requiredParams: ["txHash"], responseFields: ["intentHash", "txHash", "logIndex", "chainId", "blockNumber", "open", "intent", "events"], }, - src/services/analytics.ts:39-40 (helper)Analytics mapping: sodax_get_transaction is categorized as an 'api' tool for tracking purposes.
sodax_get_transaction: "api", sodax_get_user_transactions: "api",