Skip to main content
Glama

sodax_get_volume

Read-only

Retrieve solver volume data for token pairs with filtering by chain, solver, time, or block range. Supports pagination and formatted output.

Instructions

Get solver volume data showing filled intents with filtering and pagination. Requires inputToken and outputToken. Optional filters: chain, solver, block range OR time range (don't mix both).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputTokenYesREQUIRED: Input token address
outputTokenYesREQUIRED: Output token address
chainIdNoFilter by chain ID (e.g., 146 for Sonic)
solverNoFilter by solver address (0x0...0 for default solver)
fromBlockNoStart block number (don't mix with since/until)
toBlockNoEnd block number (don't mix with since/until)
sinceNoStart time ISO format (don't mix with fromBlock/toBlock)
untilNoEnd time ISO format (don't mix with fromBlock/toBlock)
sortNoSort order by block numberdesc
limitNoMaximum number of filled intents to return (1-100)
includeDataNoInclude raw intent data in response
cursorNoPagination cursor from previous response's nextCursor
formatNoResponse format: 'json' for raw data or 'markdown' for formatted textmarkdown

Implementation Reference

  • Main MCP tool handler for sodax_get_volume. Defines the tool registration with schema validation, executes getVolume API call, formats response with pagination info, and handles errors.
    server.tool(
      "sodax_get_volume",
      "Get solver volume data showing filled intents with filtering and pagination. Requires inputToken and outputToken. Optional filters: chain, solver, block range OR time range (don't mix both).",
      {
        inputToken: z.string()
          .describe("REQUIRED: Input token address"),
        outputToken: z.string()
          .describe("REQUIRED: Output token address"),
        chainId: z.number().optional()
          .describe("Filter by chain ID (e.g., 146 for Sonic)"),
        solver: z.string().optional()
          .describe("Filter by solver address (0x0...0 for default solver)"),
        fromBlock: z.number().optional()
          .describe("Start block number (don't mix with since/until)"),
        toBlock: z.number().optional()
          .describe("End block number (don't mix with since/until)"),
        since: z.string().optional()
          .describe("Start time ISO format (don't mix with fromBlock/toBlock)"),
        until: z.string().optional()
          .describe("End time ISO format (don't mix with fromBlock/toBlock)"),
        sort: z.enum(["asc", "desc"]).optional().default("desc")
          .describe("Sort order by block number"),
        limit: z.number().min(1).max(100).optional().default(50)
          .describe("Maximum number of filled intents to return (1-100)"),
        includeData: z.boolean().optional().default(false)
          .describe("Include raw intent data in response"),
        cursor: z.string().optional()
          .describe("Pagination cursor from previous response's nextCursor"),
        format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN)
          .describe("Response format: 'json' for raw data or 'markdown' for formatted text")
      },
      READ_ONLY,
      async ({ inputToken, outputToken, chainId, solver, fromBlock, toBlock, since, until, sort, limit, includeData, cursor, format }) => {
        try {
          const volume = await getVolume({ 
            chainId, inputToken, outputToken, solver, 
            fromBlock, toBlock, since, until, 
            sort, limit, includeData, cursor 
          });
          const header = `## SODAX Filled Intents\n\n`;
          const pagination = volume.hasMore && volume.nextCursor 
            ? `\n\n*Has more results. Use cursor: \`${volume.nextCursor.substring(0, 30)}...\`*`
            : "\n\n*No more results.*";
          return {
            content: [{
              type: "text",
              text: header + formatResponse(volume.items, format) + pagination
            }]
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }],
            isError: true
          };
        }
      }
    );
  • Core getVolume service function that builds API request parameters, implements caching, calls the SODAX API endpoint (/solver/volume), and returns VolumeData with filled intents.
    export async function getVolume(options: {
      inputToken: string;
      outputToken: string;
      chainId?: number;
      solver?: string;
      fromBlock?: number;
      toBlock?: number;
      since?: string;
      until?: string;
      sort?: "asc" | "desc";
      limit?: number;
      includeData?: boolean;
      cursor?: string;
    }): Promise<VolumeData> {
      // Build cache key from significant params
      const cacheKey = `volume-${options.inputToken}-${options.outputToken}-${options.chainId || "all"}-${options.limit || 50}-${options.cursor || "start"}`;
      const cached = getCached<VolumeData>(cacheKey);
      if (cached) return cached;
    
      try {
        const params = new URLSearchParams();
        params.append("inputToken", options.inputToken);
        params.append("outputToken", options.outputToken);
        params.append("includeData", (options.includeData ?? false).toString());
        if (options.chainId) params.append("chainId", options.chainId.toString());
        if (options.solver) params.append("solver", options.solver);
        if (options.fromBlock) params.append("fromBlock", options.fromBlock.toString());
        if (options.toBlock) params.append("toBlock", options.toBlock.toString());
        if (options.since) params.append("since", options.since);
        if (options.until) params.append("until", options.until);
        if (options.sort) params.append("sort", options.sort);
        if (options.limit) params.append("limit", options.limit.toString());
        if (options.cursor) params.append("cursor", options.cursor);
    
        const queryString = params.toString();
        const url = `/solver/volume${queryString ? `?${queryString}` : ""}`;
        const response = await apiClient.get(url);
        const volumeData = response.data;
        setCache(cacheKey, volumeData);
        return volumeData;
      } catch (error) {
        console.error("Error fetching volume:", error);
        throw new Error("Failed to fetch volume data from SODAX API");
      }
    }
  • Zod schema defining all input parameters for sodax_get_volume: required inputToken/outputToken, optional filters (chainId, solver, fromBlock/toBlock or since/until), sorting, pagination, and response format options.
    {
      inputToken: z.string()
        .describe("REQUIRED: Input token address"),
      outputToken: z.string()
        .describe("REQUIRED: Output token address"),
      chainId: z.number().optional()
        .describe("Filter by chain ID (e.g., 146 for Sonic)"),
      solver: z.string().optional()
        .describe("Filter by solver address (0x0...0 for default solver)"),
      fromBlock: z.number().optional()
        .describe("Start block number (don't mix with since/until)"),
      toBlock: z.number().optional()
        .describe("End block number (don't mix with since/until)"),
      since: z.string().optional()
        .describe("Start time ISO format (don't mix with fromBlock/toBlock)"),
      until: z.string().optional()
        .describe("End time ISO format (don't mix with fromBlock/toBlock)"),
      sort: z.enum(["asc", "desc"]).optional().default("desc")
        .describe("Sort order by block number"),
      limit: z.number().min(1).max(100).optional().default(50)
        .describe("Maximum number of filled intents to return (1-100)"),
      includeData: z.boolean().optional().default(false)
        .describe("Include raw intent data in response"),
      cursor: z.string().optional()
        .describe("Pagination cursor from previous response's nextCursor"),
      format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN)
        .describe("Response format: 'json' for raw data or 'markdown' for formatted text")
    },
  • Type definitions for VolumeData (paginated response with items, nextCursor, hasMore) and FilledIntent (intent data structure with hash, solver, tokens, amounts, chain, block, timestamp).
    export interface FilledIntent {
      intentHash: string;
      solver: string;
      inputToken: string;
      outputToken: string;
      amount: string;
      chainId: number;
      blockNumber: number;
      txHash: string;
      logIndex: number;
      timestamp: string;
      data?: string;
    }
    
    /**
     * Paginated response for solver volume (filled intents)
     */
    export interface VolumeData {
      items: FilledIntent[];
      nextCursor?: string;
      hasMore: boolean;
    }
  • src/index.ts:198-198 (registration)
    Tool registration listing sodax_get_volume in the API tools array for server metadata endpoint.
    "sodax_get_volume",
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, so the agent knows this is a safe, read-only operation with open-world data. The description adds useful context about filtering capabilities and pagination behavior, but doesn't mention rate limits, authentication needs, or what 'filled intents' specifically entails beyond what annotations provide.

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 perfectly concise and front-loaded: two sentences that efficiently convey the core functionality, requirements, and key constraints. Every word earns its place with zero redundancy or unnecessary elaboration, making it easy for an agent to parse quickly.

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 complexity (13 parameters, filtering, pagination) and rich schema coverage (100%), the description is reasonably complete. It covers the core purpose, requirements, and filtering logic. However, without an output schema, it doesn't explain what 'solver volume data' or 'filled intents' look like in the response, leaving some ambiguity about the return format.

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 already fully documents all 13 parameters with descriptions, enums, defaults, and constraints. The description adds minimal value beyond the schema by mentioning that inputToken and outputToken are required and that block/time ranges shouldn't be mixed, but doesn't provide additional semantic context or examples beyond what's in the structured schema.

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 tool's purpose: 'Get solver volume data showing filled intents with filtering and pagination.' It specifies the verb ('Get'), resource ('solver volume data'), and scope ('filled intents'), distinguishing it from siblings like sodax_get_orderbook or sodax_get_transaction which handle different data types.

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

Usage Guidelines4/5

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

The description provides clear context for usage: 'Requires inputToken and outputToken. Optional filters: chain, solver, block range OR time range (don't mix both).' This gives practical guidance on required vs. optional parameters and constraint rules. However, it doesn't explicitly state when to use this tool versus alternatives like sodax_get_user_transactions or provide exclusion criteria.

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