Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_multiple_tokens_data

Retrieve token data for multiple contracts on specified blockchain networks to support trading decisions and portfolio analysis.

Instructions

Get data for multiple tokens by their contract addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID (e.g., 'eth', 'bsc', 'polygon_pos')
addressesYesToken contract addresses, comma-separated for multiple tokens
includeNoAttributes to include: 'top_pools' (optional)

Implementation Reference

  • Main MCP tool handler: validates inputs, delegates to CoinGeckoApiService, formats response with message, data, and summary.
    async getMultipleTokensData(network, addresses, options = {}) {
      if (!network || !addresses) {
        throw new Error("Missing required parameters: network, addresses");
      }
    
      const result = await this.coinGeckoApi.getMultipleTokensData(
        network,
        addresses,
        options
      );
    
      return {
        message: "Multiple tokens data retrieved successfully",
        data: result,
        summary: `Retrieved data for ${
          addresses.split(",").length
        } token(s) on ${network}`,
        includes: options.include ? options.include.split(",") : [],
      };
    }
  • Tool schema definition in ListTools handler: input schema, description, and name registration.
    {
      name: TOOL_NAMES.GET_MULTIPLE_TOKENS_DATA,
      description: "Get data for multiple tokens by their contract addresses",
      inputSchema: {
        type: "object",
        properties: {
          network: {
            type: "string",
            description: "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')",
          },
          addresses: {
            type: "string",
            description:
              "Token contract addresses, comma-separated for multiple tokens",
          },
          include: {
            type: "string",
            description: "Attributes to include: 'top_pools' (optional)",
            enum: ["top_pools"],
          },
        },
        required: ["network", "addresses"],
      },
    },
  • src/index.js:1090-1098 (registration)
    Tool dispatch registration in CallToolRequestSchema switch statement: maps tool name to handler.
    case TOOL_NAMES.GET_MULTIPLE_TOKENS_DATA:
      result = await toolService.getMultipleTokensData(
        args.network,
        args.addresses,
        {
          include: args.include,
        }
      );
      break;
  • Core helper: Constructs CoinGecko API URL for /networks/{network}/tokens/multi/{addresses} and performs authenticated fetch request.
    async getMultipleTokensData(network, addresses, options = {}) {
      try {
        const queryParams = new URLSearchParams();
        
        if (options.include) queryParams.append('include', options.include);
    
        const url = `${this.baseUrl}/networks/${network}/tokens/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 tokens data: ${error.message}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states what the tool does but reveals nothing about behavioral traits: no information about rate limits, authentication requirements, error conditions, response format, or whether this is a read-only operation. 'Get' implies read-only, but this isn't explicitly confirmed.

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 states the core functionality without unnecessary words. It's appropriately sized for a straightforward data retrieval tool and front-loads the essential information.

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?

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'data' means in this context (prices, metadata, balances?), doesn't mention any constraints or limitations, and provides no context about the data source or freshness. The agent would need to guess about the tool's behavior and output.

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 documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain what 'data' includes, what format addresses should use beyond 'comma-separated', or clarify the relationship between parameters.

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 resource ('multiple tokens by their contract addresses'), making the purpose understandable. It distinguishes from sibling 'get_token_data' by specifying multiple tokens, but doesn't fully differentiate from other data retrieval tools like 'get_token_info' or 'get_token_price'.

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 guidance is provided about when to use this tool versus alternatives. With siblings like 'get_token_data', 'get_token_info', 'get_token_price', and 'get_portfolio_tokens', the description offers no context about which tool to choose for different token data needs.

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