get_trending_pools
Retrieve trending liquidity pools from GeckoTerminal across multiple networks to identify trading opportunities in DeFi markets.
Instructions
Get trending pools across all networks on GeckoTerminal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated) | |
| page | No | Page number for pagination (optional, default: 1) | |
| duration | No | Duration for trending: '5m', '1h', '6h', '24h' (optional, default: '24h') |
Implementation Reference
- src/toolService.js:180-189 (handler)The primary handler function for the 'get_trending_pools' tool. It calls the CoinGecko API service to fetch trending pools data across all networks and formats the response with a message, data, summary, and duration.async getTrendingPools(options = {}) { const result = await this.coinGeckoApi.getTrendingPools(options); return { message: "Trending pools retrieved successfully", data: result, summary: `Found ${result.data?.length || 0} trending pools`, duration: options.duration || "24h", }; }
- src/index.js:271-293 (schema)The input schema definition for the 'get_trending_pools' tool, specifying optional parameters like include, page, and duration.name: TOOL_NAMES.GET_TRENDING_POOLS, description: "Get trending pools across all networks on GeckoTerminal", inputSchema: { type: "object", properties: { include: { type: "string", description: "Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated)", }, page: { type: "integer", description: "Page number for pagination (optional, default: 1)", }, duration: { type: "string", description: "Duration for trending: '5m', '1h', '6h', '24h' (optional, default: '24h')", enum: ["5m", "1h", "6h", "24h"], }, }, required: [], },
- src/index.js:1022-1028 (registration)The tool registration and dispatching logic in the MCP CallToolRequestSchema handler switch statement, which routes calls to the toolService.getTrendingPools method.case TOOL_NAMES.GET_TRENDING_POOLS: result = await toolService.getTrendingPools({ include: args.include, page: args.page, duration: args.duration, }); break;
- src/constants.js:22-22 (helper)Constant definition mapping the tool name 'get_trending_pools' used throughout the codebase for registration and dispatching.GET_TRENDING_POOLS: "get_trending_pools",
- Supporting utility method in CoinGeckoApiService that performs the actual HTTP fetch to the CoinGecko API endpoint for trending pools.async getTrendingPools(options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); if (options.page) queryParams.append('page', options.page); if (options.duration) queryParams.append('duration', options.duration); const url = `${this.baseUrl}/networks/trending_pools${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 trending pools: ${error.message}`); } }