Skip to main content
Glama

getTokenPools

Find liquidity pools containing a specific token on any blockchain network. Use this tool to discover where tokens are traded across decentralized exchanges.

Instructions

Get liquidity pools containing a specific token on a network. Great for finding where a token is traded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID from getNetworks (e.g., "ethereum", "solana")
tokenAddressYesToken address or identifier
pageNoPage number for pagination
limitNoNumber of items per page (max 100)
sortNoSort orderdesc
orderByNoField to order byvolume_usd
reorderNoIf true, reorders the pool so that the specified token becomes the primary token for all metrics
addressNoFilter pools that contain this additional token address

Implementation Reference

  • The handler function for the 'getTokenPools' tool. It constructs the API endpoint based on input parameters and fetches the data from DexPaprika API using the shared fetchFromAPI helper, then formats the response.
    async ({ network, tokenAddress, page, limit, sort, orderBy, reorder, address }) => {
      let endpoint = `/networks/${network}/tokens/${tokenAddress}/pools?page=${page}&limit=${limit}&sort=${sort}&order_by=${orderBy}`;
      if (reorder !== undefined) {
        endpoint += `&reorder=${reorder}`;
      }
      if (address) {
        endpoint += `&address=${encodeURIComponent(address)}`;
      }
      const data = await fetchFromAPI(endpoint);
      return formatMcpResponse(data);
    }
  • Zod schema defining the input parameters and validation for the getTokenPools tool.
    {
      network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
      tokenAddress: z.string().describe('Token address or identifier'),
      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'),
      reorder: z.boolean().optional().describe('If true, reorders the pool so that the specified token becomes the primary token for all metrics'),
      address: z.string().optional().describe('Filter pools that contain this additional token address')
    },
  • src/index.js:162-186 (registration)
    The registration of the 'getTokenPools' tool using server.tool(), including name, description, input schema, and handler function.
    server.tool(
      'getTokenPools',
      'Get liquidity pools containing a specific token on a network. Great for finding where a token is traded.',
      {
        network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
        tokenAddress: z.string().describe('Token address or identifier'),
        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'),
        reorder: z.boolean().optional().describe('If true, reorders the pool so that the specified token becomes the primary token for all metrics'),
        address: z.string().optional().describe('Filter pools that contain this additional token address')
      },
      async ({ network, tokenAddress, page, limit, sort, orderBy, reorder, address }) => {
        let endpoint = `/networks/${network}/tokens/${tokenAddress}/pools?page=${page}&limit=${limit}&sort=${sort}&order_by=${orderBy}`;
        if (reorder !== undefined) {
          endpoint += `&reorder=${reorder}`;
        }
        if (address) {
          endpoint += `&address=${encodeURIComponent(address)}`;
        }
        const data = await fetchFromAPI(endpoint);
        return formatMcpResponse(data);
      }
    );
  • Shared helper function used by getTokenPools (and other tools) to make API requests to DexPaprika and handle errors.
    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;
      }
    }
  • Shared helper function used by getTokenPools (and other tools) to format API responses in MCP-compatible format.
    function formatMcpResponse(data) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(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 only states the basic purpose. It doesn't disclose behavioral traits like whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior beyond parameters, or what the response format looks like. Significant gaps exist for an 8-parameter tool.

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?

Two concise sentences that are front-loaded with the core purpose. The second sentence adds practical context without redundancy. Every sentence earns its place with zero waste or unnecessary elaboration.

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 complex tool with 8 parameters, no annotations, and no output schema, the description is incomplete. It states the basic purpose but lacks behavioral context, response format details, error handling information, or usage boundaries that would help an agent invoke it correctly.

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%, providing detailed documentation for all 8 parameters. The description adds no parameter-specific information beyond what's already in the schema, so it meets the baseline of 3 when schema does the heavy lifting but doesn't compensate with additional semantic context.

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 clearly states the verb 'Get' and resource 'liquidity pools containing a specific token on a network', with the specific purpose 'finding where a token is traded'. It distinguishes from siblings like getDexPools (general pools), getNetworkPools (network-level pools), and getTokenDetails (token metadata).

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

Usage Guidelines3/5

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

The description implies usage context ('Great for finding where a token is traded') but doesn't explicitly state when to use this tool versus alternatives like getDexPools or getNetworkPools. No explicit exclusions or prerequisites are mentioned, leaving usage guidance at an implied level.

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