Skip to main content
Glama

DeFi Trading Agent MCP Server

by edkdev

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

NameRequiredDescriptionDefault
addressesYesPool contract addresses, comma-separated for multiple pools
includeNoAttributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)
include_volume_breakdownNoInclude volume breakdown (optional, default: false)
networkYesNetwork 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

  • 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}`, }; }
  • 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",

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/edkdev/defi-trading-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server