Skip to main content
Glama

getNetworkDexes

Retrieve available decentralized exchanges (DEXes) for a specific blockchain network to analyze trading platforms and liquidity sources.

Instructions

Get available DEXes on a specific network. First call getNetworks to see valid network IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID from getNetworks (e.g., "ethereum", "solana")
pageNoPage number for pagination
limitNoNumber of items per page

Implementation Reference

  • Handler function that fetches DEXes data from DexPaprika API for the specified network with optional pagination and formats the response for MCP.
    async ({ network, page, limit }) => {
      const data = await fetchFromAPI(`/networks/${network}/dexes?page=${page}&limit=${limit}`);
      return formatMcpResponse(data);
    }
  • Zod schema defining input parameters: network (required string), page and limit (optional numbers with defaults).
    {
      network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
      page: z.number().optional().default(0).describe('Page number for pagination'),
      limit: z.number().optional().default(10).describe('Number of items per page')
    },
  • src/index.js:83-95 (registration)
    Complete registration of the getNetworkDexes tool using McpServer.tool method, including name, description, input schema, and handler function.
    server.tool(
      'getNetworkDexes',
      'Get available DEXes on a specific network. First call getNetworks to see valid network IDs.',
      {
        network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
        page: z.number().optional().default(0).describe('Page number for pagination'),
        limit: z.number().optional().default(10).describe('Number of items per page')
      },
      async ({ network, page, limit }) => {
        const data = await fetchFromAPI(`/networks/${network}/dexes?page=${page}&limit=${limit}`);
        return formatMcpResponse(data);
      }
    );
  • Helper function used by getNetworkDexes (and other tools) to format API response data into MCP-standard content structure.
    function formatMcpResponse(data) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    }
  • Core helper function used by getNetworkDexes handler to make HTTP requests to DexPaprika API, handle errors including rate limits and deprecated endpoints.
    async function fetchFromAPI(endpoint) {
      try {
        const response = await fetch(`${API_BASE_URL}${endpoint}`);
        if (!response.ok) {
          if (response.status === 410) {
            throw new Error(
              'This endpoint has been permanently removed. Please use network-specific endpoints instead. ' +
              'For example, use /networks/{network}/pools instead of /pools. ' +
              'Get available networks first using the getNetworks function.'
            );
          }
          if (response.status === 429) {
            throw new Error(
              'Rate limit exceeded. You have reached the maximum number of requests allowed for the free tier. ' +
              'To increase your rate limits and access additional features, please consider upgrading to a paid plan at https://docs.dexpaprika.com/'
            );
          }
          throw new Error(`API request failed with status ${response.status}`);
        }
        return await response.json();
      } catch (error) {
        console.error(`Error fetching from API: ${error.message}`);
        throw error;
      }
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool requires a network ID from getNetworks, which is useful context. However, it doesn't describe behavioral traits like whether it's read-only, potential rate limits, error handling, or the format of returned DEX data. The description adds some value but lacks comprehensive behavioral details.

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 appropriately sized and front-loaded: the first sentence states the core purpose, and the second provides essential usage guidance. Every sentence earns its place with no wasted words, making it efficient and easy to understand.

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 (3 parameters, 1 required), no annotations, and no output schema, the description is somewhat complete but has gaps. It covers purpose and prerequisites but lacks details on return values, error cases, or behavioral constraints. It's adequate as a minimum viable description but could be more comprehensive for a tool with pagination and network dependencies.

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 parameters (network, page, limit) with descriptions and defaults. The description adds no additional parameter semantics beyond what the schema provides, such as examples of DEX types or pagination behavior. Baseline 3 is appropriate as the schema handles 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 tool's purpose: 'Get available DEXes on a specific network.' It specifies the verb ('Get') and resource ('DEXes'), and distinguishes it from siblings like getNetworks (which provides network IDs) and getDexPools (which focuses on pools within DEXes). However, it doesn't explicitly contrast with all siblings, such as getNetworkPools, which might overlap in network focus.

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: 'First call getNetworks to see valid network IDs.' This gives a prerequisite and distinguishes it from getNetworks. It implies when to use this tool (after obtaining network IDs) but doesn't explicitly state when not to use it or mention alternatives like getNetworkPools for pools instead of DEXes.

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/infinity-smithpl/dexpaprika-mcp'

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