Skip to main content
Glama

sodax_get_user_transactions

Read-only

Retrieve transaction history for a wallet address, supporting pagination and multiple output formats to analyze user activity.

Instructions

Get intent/transaction history for a specific wallet address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userAddressYesThe wallet address to look up (e.g., '0x...')
limitNoMaximum number of transactions to return (1-100)
offsetNoNumber of transactions to skip for pagination
formatNoResponse format: 'json' for raw data or 'markdown' for formatted textmarkdown

Implementation Reference

  • MCP tool registration for sodax_get_user_transactions with input schema (zod validation for userAddress, limit, offset, format) and the async handler that calls getUserTransactions service and formats the response
    // Tool 4: Get User Transactions
    server.tool(
      "sodax_get_user_transactions",
      "Get intent/transaction history for a specific wallet address",
      {
        userAddress: z.string()
          .describe("The wallet address to look up (e.g., '0x...')"),
        limit: z.number().min(1).max(100).optional().default(20)
          .describe("Maximum number of transactions to return (1-100)"),
        offset: z.number().min(0).optional().default(0)
          .describe("Number of transactions to skip for pagination"),
        format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN)
          .describe("Response format: 'json' for raw data or 'markdown' for formatted text")
      },
      READ_ONLY,
      async ({ userAddress, limit, offset, format }) => {
        try {
          const transactions = await getUserTransactions(userAddress, { limit, offset });
          const header = `## Transactions for ${userAddress.slice(0, 10)}...${userAddress.slice(-8)}\n\n`;
          const summary = `${transactions.length} transactions found\n\n`;
          return {
            content: [{
              type: "text",
              text: header + summary + formatResponse(transactions, format)
            }]
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }],
            isError: true
          };
        }
      }
    );
  • Service function getUserTransactions that executes the actual API call to SODAX endpoint `/intent/user/${userAddress}` with optional pagination parameters (limit, offset) and returns Transaction[]
    export async function getUserTransactions(
      userAddress: string,
      options?: { chainId?: string; limit?: number; offset?: number }
    ): Promise<Transaction[]> {
      try {
        const params = new URLSearchParams();
        if (options?.limit) params.append("limit", options.limit.toString());
        if (options?.offset) params.append("offset", options.offset.toString());
    
        const queryString = params.toString();
        const url = `/intent/user/${userAddress}${queryString ? `?${queryString}` : ""}`;
        const response = await apiClient.get(url);
        // API returns { items, total, offset, limit }
        return response.data?.items || response.data?.data || [];
      } catch (error) {
        console.error("Error fetching user transactions:", error);
        throw new Error("Failed to fetch user transactions from SODAX API");
      }
    }
  • Analytics tool group mapping that categorizes sodax_get_user_transactions under the 'api' group for PostHog tracking
    sodax_get_user_transactions: "api",
  • Helper functions formatResponse and formatAsMarkdown used by the tool handler to format transaction data as JSON or markdown tables
    function formatResponse(data: unknown, format: ResponseFormat): string {
      if (format === ResponseFormat.MARKDOWN) {
        return formatAsMarkdown(data);
      }
      return JSON.stringify(data, null, 2);
    }
    
    /**
     * Format data as Markdown for better readability
     */
    function formatAsMarkdown(data: unknown): string {
      if (Array.isArray(data)) {
        if (data.length === 0) return "_No data available_";
        
        // Try to create a table for arrays of objects
        if (typeof data[0] === "object" && data[0] !== null) {
          const keys = Object.keys(data[0]).slice(0, 6); // Limit columns
          let md = `| ${keys.join(" | ")} |\n`;
          md += `| ${keys.map(() => "---").join(" | ")} |\n`;
          for (const item of data.slice(0, 20)) { // Limit rows
            const values = keys.map(k => {
              const val = (item as Record<string, unknown>)[k];
              if (val === null || val === undefined) return "-";
              if (typeof val === "object") return JSON.stringify(val).slice(0, 30);
              return String(val).slice(0, 40);
            });
            md += `| ${values.join(" | ")} |\n`;
          }
          if (data.length > 20) {
            md += `\n_... and ${data.length - 20} more items_`;
          }
          return md;
        }
        return data.map(item => `- ${String(item)}`).join("\n");
      }
      
      if (typeof data === "object" && data !== null) {
        const entries = Object.entries(data);
        return entries.map(([key, value]) => {
          if (typeof value === "object" && value !== null) {
            return `**${key}:**\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
          }
          return `**${key}:** ${value}`;
        }).join("\n\n");
      }
      
      return String(data);
    }
Behavior4/5

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

Annotations indicate read-only, open-world, and non-destructive behavior, which the description doesn't contradict. The description adds value by specifying 'history' (implying past data) and 'specific wallet address' (scoping), though it doesn't detail rate limits, auth needs, or pagination behavior beyond what the schema covers. With annotations providing safety cues, this extra context earns a good score.

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 without unnecessary words. Every part earns its place, making it highly concise and well-structured for quick understanding.

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

Completeness3/5

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

Given the tool's moderate complexity (4 parameters, 1 required), rich annotations (read-only, open-world), and no output schema, the description is adequate but incomplete. It lacks details on return values, error handling, or usage context with siblings, leaving gaps that could hinder agent effectiveness in complex scenarios.

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%, so the schema fully documents all parameters. The description doesn't add any semantic details beyond what's in the schema (e.g., it doesn't explain 'intent' in 'intent/transaction history' or clarify parameter interactions). Baseline 3 is appropriate as the schema carries the burden.

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

Purpose4/5

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

The description clearly states the verb 'Get' and the resource 'intent/transaction history for a specific wallet address', making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'sodax_get_transaction' (which might get a single transaction) or 'sodax_get_user_position' (which might get current positions rather than history), missing full sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'sodax_get_transaction' for single transactions or 'sodax_get_user_position' for positions, nor does it specify prerequisites or exclusions, leaving the agent to infer usage context.

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