Skip to main content
Glama

getNetworkPools

Retrieve top liquidity pools for a specific blockchain network to analyze trading volumes, prices, and pool metrics.

Instructions

PRIMARY POOL FUNCTION: Get top liquidity pools on a specific network. This is the MAIN way to get pool data - there is NO global pools function. Use this instead of any "getTopPools" or "getAllPools" concepts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID from getNetworks (required) - e.g., "ethereum", "solana"
pageNoPage number for pagination
limitNoNumber of items per page (max 100)
sortNoSort orderdesc
orderByNoField to order byvolume_usd

Implementation Reference

  • The handler function for getNetworkPools tool. Fetches top liquidity pools data from DexPaprika API for a specific network and formats the response.
    async ({ network, page, limit, sort, orderBy }) => {
      const data = await fetchFromAPI(`/networks/${network}/pools?page=${page}&limit=${limit}&sort=${sort}&order_by=${orderBy}`);
      return formatMcpResponse(data);
    }
  • Input schema/validation for the getNetworkPools tool using Zod, defining parameters like network, pagination, sorting.
    {
      network: z.string().describe('Network ID from getNetworks (required) - 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 (max 100)'),
      sort: z.enum(['asc', 'desc']).optional().default('desc').describe('Sort order'),
      orderBy: z.enum(['volume_usd', 'price_usd', 'transactions', 'last_price_change_usd_24h', 'created_at']).optional().default('volume_usd').describe('Field to order by')
    },
  • src/index.js:98-112 (registration)
    Registration of the getNetworkPools tool on the MCP server using server.tool(), including name, description, schema, and handler.
    server.tool(
      'getNetworkPools',
      'PRIMARY POOL FUNCTION: Get top liquidity pools on a specific network. This is the MAIN way to get pool data - there is NO global pools function. Use this instead of any "getTopPools" or "getAllPools" concepts.',
      {
        network: z.string().describe('Network ID from getNetworks (required) - 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 (max 100)'),
        sort: z.enum(['asc', 'desc']).optional().default('desc').describe('Sort order'),
        orderBy: z.enum(['volume_usd', 'price_usd', 'transactions', 'last_price_change_usd_24h', 'created_at']).optional().default('volume_usd').describe('Field to order by')
      },
      async ({ network, page, limit, sort, orderBy }) => {
        const data = await fetchFromAPI(`/networks/${network}/pools?page=${page}&limit=${limit}&sort=${sort}&order_by=${orderBy}`);
        return formatMcpResponse(data);
      }
    );
  • Helper function to fetch data from DexPaprika API endpoints, handles errors like 410 (deprecated) and 429 (rate limit). Used by getNetworkPools handler.
    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;
      }
    }
  • Helper function to format API response data into MCP-compatible response structure. Used by getNetworkPools handler.
    function formatMcpResponse(data) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4.2/5.0
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 mentions this is for 'top liquidity pools' and the 'MAIN way to get pool data,' which gives some behavioral context about scope and importance. However, it doesn't disclose critical behavioral traits like rate limits, authentication requirements, error conditions, or what 'top' means (e.g., by volume, liquidity). The description adds value but leaves significant gaps for a tool with no annotations.

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 highly concise and front-loaded, with only two sentences that directly address purpose and usage guidelines. Every sentence earns its place by providing critical information without redundancy or fluff, making it efficient and well-structured for an AI agent.

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 moderate complexity (5 parameters, no output schema, no annotations), the description is fairly complete for its core purpose and usage. It clearly states what the tool does and when to use it, which are key for an AI agent. However, it lacks details on behavioral aspects like rate limits or error handling, and without an output schema, it doesn't describe return values, leaving some gaps in context.

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 thoroughly. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., it doesn't explain 'network' beyond being 'specific,' or clarify 'page'/'limit' usage). With high schema coverage, the baseline is 3, and the description doesn't compensate with extra insights.

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 explicitly states the verb ('Get') and resource ('top liquidity pools on a specific network'), making the purpose clear. It distinguishes this tool from sibling tools by emphasizing it's the 'MAIN way to get pool data' and explicitly mentions alternatives to avoid ('getTopPools' or 'getAllPools' concepts), providing clear differentiation.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance by stating 'This is the MAIN way to get pool data - there is NO global pools function' and instructing to 'Use this instead of any "getTopPools" or "getAllPools" concepts.' This clearly indicates when to use this tool versus alternatives, including both positive direction (use this) and exclusions (not other concepts).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.