get_trending_pools
Identify trending DeFi pools across multiple networks on GeckoTerminal with customizable filters for duration, token details, and pagination to aid real-time trading decisions.
Instructions
Get trending pools across all networks on GeckoTerminal
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| duration | No | Duration for trending: '5m', '1h', '6h', '24h' (optional, default: '24h') | |
| include | No | Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated) | |
| page | No | Page number for pagination (optional, default: 1) |
Input Schema (JSON Schema)
{
"properties": {
"duration": {
"description": "Duration for trending: '5m', '1h', '6h', '24h' (optional, default: '24h')",
"enum": [
"5m",
"1h",
"6h",
"24h"
],
"type": "string"
},
"include": {
"description": "Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated)",
"type": "string"
},
"page": {
"description": "Page number for pagination (optional, default: 1)",
"type": "integer"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- Core handler that performs the HTTP fetch to CoinGecko's /onchain/networks/trending_pools endpoint with query parameters for include, page, and duration.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}`); }
- src/toolService.js:180-189 (handler)ToolService wrapper that delegates to CoinGeckoApiService and adds response formatting with message, summary, and metadata.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:1022-1028 (handler)Dispatch logic in the MCP CallToolRequestHandler switch statement that maps tool arguments to the ToolService method call.case TOOL_NAMES.GET_TRENDING_POOLS: result = await toolService.getTrendingPools({ include: args.include, page: args.page, duration: args.duration, }); break;
- src/index.js:271-293 (schema)Tool schema definition in the ListToolsRequestHandler, specifying name, description, and input validation schema.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/constants.js:22-22 (registration)Constant defining the exact tool name string used throughout the codebase.GET_TRENDING_POOLS: "get_trending_pools",