Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_supported_dexes

Retrieve supported decentralized exchanges (DEXes) for a specific blockchain network to enable trading operations and liquidity analysis.

Instructions

Get list of supported DEXes on a specific network

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID (e.g., 'eth', 'bsc', 'polygon_pos')
pageNoPage number for pagination (optional, default: 1)

Implementation Reference

  • Main execution logic for the get_supported_dexes tool: validates network parameter, calls CoinGecko API service, and formats response.
    async getSupportedDexes(network, page = 1) {
      if (!network) {
        throw new Error("network is required");
      }
    
      const result = await this.coinGeckoApi.getSupportedDexes(network, page);
    
      return {
        message: `Supported DEXes for ${network} retrieved successfully`,
        data: result,
        summary: `Found ${result.data?.length || 0} DEXes on ${network} network`,
      };
    }
  • Input schema defining parameters: network (required string), page (optional integer). Used in MCP tool registration.
      name: TOOL_NAMES.GET_SUPPORTED_DEXES,
      description: "Get list of supported DEXes on a specific network",
      inputSchema: {
        type: "object",
        properties: {
          network: {
            type: "string",
            description: "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')",
          },
          page: {
            type: "integer",
            description: "Page number for pagination (optional, default: 1)",
          },
        },
        required: ["network"],
      },
    },
  • src/index.js:1018-1020 (registration)
    Switch case in tool request handler that dispatches to toolService.getSupportedDexes with parsed arguments.
    case TOOL_NAMES.GET_SUPPORTED_DEXES:
      result = await toolService.getSupportedDexes(args.network, args.page);
      break;
  • Core API call to CoinGecko /networks/{network}/dexes endpoint to fetch supported DEXes list.
    async getSupportedDexes(network, page = 1) {
      try {
        const queryParams = new URLSearchParams();
        if (page) queryParams.append('page', page);
    
        const url = `${this.baseUrl}/networks/${network}/dexes${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 supported DEXes: ${error.message}`);
      }
    }
  • src/constants.js:21-21 (registration)
    Constant definition for the tool name used in registration and dispatch.
    GET_SUPPORTED_DEXES: "get_supported_dexes",
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 mentions 'Get list' but doesn't disclose behavioral traits like whether this is a read-only operation, if it requires authentication, rate limits, pagination details beyond the schema, or error handling. The description is minimal and doesn't add context beyond the basic action.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place without redundancy.

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 no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't explain what 'supported DEXes' entails, the return format (e.g., list of names, IDs, metadata), or how pagination works in practice. For a tool with 2 parameters and potential complexity in DEX data, more context is needed.

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 both parameters ('network' and 'page') with descriptions. The description adds no additional meaning beyond implying the 'network' parameter is used to filter DEXes, which is already clear from the schema. Baseline 3 is appropriate when 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 verb ('Get') and resource ('list of supported DEXes on a specific network'), making the purpose immediately understandable. It distinguishes from siblings by focusing on DEX support rather than tokens, pools, swaps, or other operations. However, it doesn't specify what 'supported' means (e.g., integrated, available for swaps) or the format of the returned list.

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 on when to use this tool versus alternatives. While siblings include network-related tools like 'get_supported_chains' and 'get_gasless_chains', the description doesn't clarify if this is for checking DEX availability before swaps or for general reference. It also lacks prerequisites or exclusions.

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