Skip to main content
Glama

sodax_get_transaction

Read-only

Retrieve transaction status, amounts, and details by providing a transaction hash. Supports JSON or markdown response formats for blockchain data analysis.

Instructions

Look up a specific transaction by its hash to see status, amounts, and details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txHashYesThe transaction hash to look up (e.g., '0x...')
formatNoResponse format: 'json' for raw data or 'markdown' for formatted textmarkdown

Implementation Reference

  • Tool registration and handler for sodax_get_transaction. Defines the input schema (txHash, format) using Zod validation, executes the getTransaction service call, and formats the response with error handling. Returns transaction details or 'not found' message.
    // 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
          };
        }
      }
    );
  • Service implementation of getTransaction function. Makes an HTTP GET request to the SODAX API endpoint '/intent/tx/{txHash}' to fetch transaction data by hash. Returns null for 404 errors, otherwise throws on failure.
    /**
     * Look up a transaction/intent by hash
     */
    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");
      }
    }
  • TypeScript interface definition for Transaction type. Defines the structure of transaction data including txHash, chainId, status, type, from/to addresses, token in/out details, timestamp, block number, and gas information.
    /**
     * Transaction record
     */
    export interface Transaction {
      txHash: string;
      chainId: string;
      status: "pending" | "completed" | "failed";
      type: "swap" | "bridge" | "deposit" | "withdraw" | "borrow" | "repay";
      fromAddress: string;
      toAddress?: string;
      tokenIn?: {
        address: string;
        symbol: string;
        amount: string;
        amountUsd?: number;
      };
      tokenOut?: {
        address: string;
        symbol: string;
        amount: string;
        amountUsd?: number;
      };
      timestamp: number;
      blockNumber?: number;
      gasUsed?: string;
      gasFee?: string;
    }
  • src/index.ts:32-46 (registration)
    Main server setup that calls registerSodaxApiTools(server) to register all SODAX API tools including sodax_get_transaction. This is the entry point where all tools are registered with the MCP server instance.
    async function createServer(): Promise<McpServer> {
      const server = new McpServer({
        name: "builders-sodax-mcp-server",
        version: "1.0.0"
      });
    
      // Wrap server.tool() so every tool call is tracked in PostHog
      // ⚠️  Must be called BEFORE registering any tools
      withAnalytics(server);
    
      registerSodaxApiTools(server);
      await registerGitBookProxyTools(server);
    
      return server;
    }
  • Analytics mapping configuration that groups sodax_get_transaction under the 'api' category for PostHog event tracking. This enables automatic usage analytics for the tool.
    const TOOL_GROUPS: Record<string, string> = {
      // SODAX API tools
      sodax_get_supported_chains: "api",
      sodax_get_swap_tokens: "api",
      sodax_get_transaction: "api",
      sodax_get_user_transactions: "api",
      sodax_get_volume: "api",
      sodax_get_orderbook: "api",
      sodax_get_money_market_assets: "api",
      sodax_get_user_position: "api",
      sodax_get_partners: "api",
      sodax_get_token_supply: "api",
      sodax_refresh_cache: "api",
    
      // GitBook SDK docs meta-tools
      docs_health: "sdk-docs",
      docs_refresh: "sdk-docs",
      docs_list_tools: "sdk-docs",
    };
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, openWorldHint=true, and destructiveHint=false, covering safety and scope. The description adds context about what information is returned (status, amounts, details) and the hash-based lookup, but doesn't mention rate limits, authentication needs, or response structure beyond format options.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('look up a specific transaction by its hash') and adds value with the scope of returned details. Every word earns its place with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, 1 required), rich annotations (read-only, open-world, non-destructive), and 100% schema coverage, the description is mostly complete. It lacks output schema details, but the description hints at return content (status, amounts, details), compensating partially for that gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters well-documented in the schema. The description doesn't add meaning beyond the schema's details for txHash or format, so it meets the baseline of 3 for high schema coverage without extra parameter insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('look up'), target resource ('specific transaction by its hash'), and scope of information returned ('status, amounts, and details'). It distinguishes from siblings like sodax_get_user_transactions (which lists multiple transactions) by focusing on a single transaction lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing details for a specific transaction hash, but doesn't explicitly state when to use this versus alternatives like sodax_get_user_transactions (for user-specific lists) or other data retrieval tools. No explicit exclusions or prerequisites are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gosodax/sodax-builders-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server