Skip to main content
Glama

getNetworkPools

Retrieve top liquidity pools for a specific blockchain network to analyze trading volumes, prices, and transaction data for decentralized exchange operations.

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
limitNoNumber of items per page (max 100)
networkYesNetwork ID from getNetworks (required) - e.g., "ethereum", "solana"
orderByNoField to order byvolume_usd
pageNoPage number for pagination
sortNoSort orderdesc

Implementation Reference

  • Handler function for the getNetworkPools tool. Fetches top liquidity pools data from the DexPaprika API for a specific network using provided parameters and formats the response for MCP.
    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 for getNetworkPools tool defined using Zod, including required network and optional pagination/sorting parameters.
    { 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, including name, description, input schema, and handler function.
    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 used by getNetworkPools to fetch data from DexPaprika API, handles errors like 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; } }
  • Helper function used by getNetworkPools to format the API response into MCP-compatible structure.
    function formatMcpResponse(data) { return { content: [ { type: "text", text: JSON.stringify(data) } ] }; }

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