Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_multiple_pools_data

Retrieve comprehensive data for multiple DeFi liquidity pools by contract addresses to analyze trading opportunities across different networks and DEXs.

Instructions

Get data for multiple pools by their contract addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID (e.g., 'eth', 'bsc', 'polygon_pos')
addressesYesPool contract addresses, comma-separated for multiple pools
includeNoAttributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)
include_volume_breakdownNoInclude volume breakdown (optional, default: false)

Implementation Reference

  • Main handler function for the 'get_multiple_pools_data' tool. Validates input parameters and delegates to the CoinGecko API service to fetch data for multiple pools.
    async getMultiplePoolsData(network, addresses, options = {}) {
      if (!network || !addresses) {
        throw new Error("Missing required parameters: network, addresses");
      }
    
      const result = await this.coinGeckoApi.getMultiplePoolsData(
        network,
        addresses,
        options
      );
    
      return {
        message: "Multiple pools data retrieved successfully",
        data: result,
        summary: `Retrieved data for ${
          addresses.split(",").length
        } pool(s) on ${network}`,
      };
    }
  • MCP tool schema definition including input validation schema for 'get_multiple_pools_data'.
    {
      name: TOOL_NAMES.GET_MULTIPLE_POOLS_DATA,
      description: "Get data for multiple pools by their contract addresses",
      inputSchema: {
        type: "object",
        properties: {
          network: {
            type: "string",
            description: "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')",
          },
          addresses: {
            type: "string",
            description:
              "Pool contract addresses, comma-separated for multiple pools",
          },
          include: {
            type: "string",
            description:
              "Attributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)",
          },
          include_volume_breakdown: {
            type: "boolean",
            description:
              "Include volume breakdown (optional, default: false)",
          },
        },
        required: ["network", "addresses"],
      },
    },
  • src/index.js:1038-1047 (registration)
    Tool registration in the MCP CallToolRequestHandler switch statement, dispatching calls to the toolService handler.
    case TOOL_NAMES.GET_MULTIPLE_POOLS_DATA:
      result = await toolService.getMultiplePoolsData(
        args.network,
        args.addresses,
        {
          include: args.include,
          include_volume_breakdown: args.include_volume_breakdown,
        }
      );
      break;
  • Core helper function that makes the HTTP request to CoinGecko API to retrieve data for multiple pools by addresses.
    async getMultiplePoolsData(network, addresses, options = {}) {
      try {
        const queryParams = new URLSearchParams();
        
        if (options.include) queryParams.append('include', options.include);
        if (options.include_volume_breakdown) queryParams.append('include_volume_breakdown', options.include_volume_breakdown);
    
        const url = `${this.baseUrl}/networks/${network}/pools/multi/${addresses}${queryParams.toString() ? '?' + queryParams.toString() : ''}`;
        
        const response = await fetch(url, {
          headers: {
            'x-cg-demo-api-key': this.apiKey
          }
        });
        
        if (!response.ok) {
          throw new Error(`HTTP ${response.status}: ${response.statusText}`);
        }
        
        return await response.json();
      } catch (error) {
        throw new Error(`Failed to get multiple pools data: ${error.message}`);
      }
    }
  • src/constants.js:24-24 (registration)
    Tool name constant definition used for registration.
    GET_MULTIPLE_POOLS_DATA: "get_multiple_pools_data",
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it 'gets data' but doesn't disclose if this is a read-only operation, potential rate limits, authentication needs, error conditions, or what the output format looks like (e.g., JSON structure). For a tool with 4 parameters and no output schema, this is inadequate.

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 directly states the tool's function without redundancy. It's front-loaded with the core purpose and wastes no words, 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.

Completeness2/5

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

Given 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'data' encompasses beyond parameter hints, behavioral traits like safety or performance, or how results are structured. For a data-fetching tool in a complex domain (DeFi pools), this leaves significant gaps for an agent.

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 (network, addresses, include, include_volume_breakdown). The description adds no additional meaning beyond implying addresses are for pools, which is already clear from the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Get data') and target resource ('multiple pools by their contract addresses'), making the purpose unambiguous. It distinguishes from siblings like get_token_data (tokens vs pools) and get_pool_ohlcv (specific data types vs general pool data). However, it doesn't specify what 'data' includes beyond what parameters imply, preventing a perfect score.

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?

No explicit guidance on when to use this tool versus alternatives is provided. While the description implies it's for fetching pool data by addresses, it doesn't contrast with siblings like get_top_pools_by_token (which might not require addresses) or search_pools (which might use filters). The agent must infer usage from the name and parameters alone.

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/edkdev/defi-trading-mcp'

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