getPoolDetails
Retrieve comprehensive details about a specific liquidity pool by providing the network ID and pool address. Use this tool to analyze pool data, including price ratios and other metrics, directly through the DexPaprika (CoinPaprika) MCP server.
Instructions
Get detailed information about a specific pool. Requires network ID from getNetworks and a pool address.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inversed | No | Whether to invert the price ratio | |
| network | Yes | Network ID from getNetworks (e.g., "ethereum", "solana") | |
| poolAddress | Yes | Pool address or identifier |
Implementation Reference
- src/index.js:147-150 (handler)Handler function that fetches detailed pool information from the DexPaprika API using the provided network and pool address, optionally inverting the price ratio, and formats the response for MCP.async ({ network, poolAddress, inversed }) => { const data = await fetchFromAPI(`/networks/${network}/pools/${poolAddress}?inversed=${inversed}`); return formatMcpResponse(data); }
- src/index.js:142-146 (schema)Zod input schema defining parameters: network (required string), poolAddress (required string), inversed (optional boolean, defaults to false).{ network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'), poolAddress: z.string().describe('Pool address or identifier'), inversed: z.boolean().optional().default(false).describe('Whether to invert the price ratio') },
- src/index.js:139-151 (registration)MCP server.tool registration for 'getPoolDetails' tool, including name, description, schema, and inline handler.server.tool( 'getPoolDetails', 'Get detailed information about a specific pool. Requires network ID from getNetworks and a pool address.', { network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'), poolAddress: z.string().describe('Pool address or identifier'), inversed: z.boolean().optional().default(false).describe('Whether to invert the price ratio') }, async ({ network, poolAddress, inversed }) => { const data = await fetchFromAPI(`/networks/${network}/pools/${poolAddress}?inversed=${inversed}`); return formatMcpResponse(data); } );
- src/index.js:10-34 (helper)Shared helper function to fetch data from DexPaprika API endpoints with comprehensive error handling for common issues like 410 (deprecated) and 429 (rate limit).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; } }
- src/index.js:37-46 (helper)Shared helper function to format API response data into the standard MCP response format with JSON stringified content.function formatMcpResponse(data) { return { content: [ { type: "text", text: JSON.stringify(data) } ] }; }