get_multiple_pools_data
Retrieve detailed data for multiple DeFi pools by specifying contract addresses, network, and optional attributes like tokens, dex, and volume breakdown.
Instructions
Get data for multiple pools by their contract addresses
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addresses | Yes | Pool contract addresses, comma-separated for multiple pools | |
| include | No | Attributes to include: 'base_token', 'quote_token', 'dex' (comma-separated) | |
| include_volume_breakdown | No | Include volume breakdown (optional, default: false) | |
| network | Yes | Network ID (e.g., 'eth', 'bsc', 'polygon_pos') |
Input Schema (JSON Schema)
{
"properties": {
"addresses": {
"description": "Pool contract addresses, comma-separated for multiple pools",
"type": "string"
},
"include": {
"description": "Attributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)",
"type": "string"
},
"include_volume_breakdown": {
"description": "Include volume breakdown (optional, default: false)",
"type": "boolean"
},
"network": {
"description": "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')",
"type": "string"
}
},
"required": [
"network",
"addresses"
],
"type": "object"
}
Implementation Reference
- src/toolService.js:209-227 (handler)Primary handler method in ToolService that validates inputs and delegates to CoinGecko API service for fetching multiple pools data.async getMultiplePoolsData(network, addresses, options = {}) { if (!network || !addresses) { throw new Error("Missing required parameters: network, addresses"); } const result = await this.coinGeckoApi.getMultiplePoolsData( network, addresses, options ); return { message: "Multiple pools data retrieved successfully", data: result, summary: `Retrieved data for ${ addresses.split(",").length } pool(s) on ${network}`, }; }
- src/index.js:324-352 (schema)Input schema and description for the 'get_multiple_pools_data' tool registered in the MCP ListTools handler.{ name: TOOL_NAMES.GET_MULTIPLE_POOLS_DATA, description: "Get data for multiple pools by their contract addresses", inputSchema: { type: "object", properties: { network: { type: "string", description: "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')", }, addresses: { type: "string", description: "Pool contract addresses, comma-separated for multiple pools", }, include: { type: "string", description: "Attributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)", }, include_volume_breakdown: { type: "boolean", description: "Include volume breakdown (optional, default: false)", }, }, required: ["network", "addresses"], }, },
- src/index.js:1038-1047 (registration)MCP CallToolRequestSchema dispatch case that registers and routes execution to ToolService.getMultiplePoolsData.case TOOL_NAMES.GET_MULTIPLE_POOLS_DATA: result = await toolService.getMultiplePoolsData( args.network, args.addresses, { include: args.include, include_volume_breakdown: args.include_volume_breakdown, } ); break;
- Helper service method that performs the actual HTTP request to CoinGecko API /networks/{network}/pools/multi/{addresses} endpoint.async getMultiplePoolsData(network, addresses, options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); if (options.include_volume_breakdown) queryParams.append('include_volume_breakdown', options.include_volume_breakdown); const url = `${this.baseUrl}/networks/${network}/pools/multi/${addresses}${queryParams.toString() ? '?' + queryParams.toString() : ''}`; const response = await fetch(url, { headers: { 'x-cg-demo-api-key': this.apiKey } }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { throw new Error(`Failed to get multiple pools data: ${error.message}`); } }
- src/constants.js:24-24 (registration)Constant definition mapping TOOL_NAMES.GET_MULTIPLE_POOLS_DATA to the tool name string used in MCP registration.GET_MULTIPLE_POOLS_DATA: "get_multiple_pools_data",