get_coingecko_networks
Retrieve supported blockchain networks from CoinGecko/GeckoTerminal for real-time market analysis and DeFi trading across multiple platforms.
Instructions
Get list of supported networks on CoinGecko/GeckoTerminal
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (optional, default: 1) |
Input Schema (JSON Schema)
{
"properties": {
"page": {
"description": "Page number for pagination (optional, default: 1)",
"type": "integer"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- src/toolService.js:156-164 (handler)The main handler function in ToolService that executes the get_coingecko_networks tool logic. It calls the CoinGeckoApiService.getNetworks method and wraps the result with a standardized response format including message, data, and summary.async getCoinGeckoNetworks(page = 1) { const result = await this.coinGeckoApi.getNetworks(page); return { message: "CoinGecko networks retrieved successfully", data: result, summary: `Found ${result.data?.length || 0} networks on page ${page}`, }; }
- Supporting utility in CoinGeckoApiService that performs the actual HTTP fetch to CoinGecko's /onchain/networks endpoint with pagination support and API key authentication.async getNetworks(page = 1) { try { const queryParams = new URLSearchParams(); if (page) queryParams.append('page', page); const url = `${this.baseUrl}/networks${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 networks: ${error.message}`); } }
- src/index.js:237-251 (schema)The input schema and tool metadata definition registered in the MCP server's ListTools handler, specifying the optional 'page' parameter.{ name: TOOL_NAMES.GET_COINGECKO_NETWORKS, description: "Get list of supported networks on CoinGecko/GeckoTerminal", inputSchema: { type: "object", properties: { page: { type: "integer", description: "Page number for pagination (optional, default: 1)", }, }, required: [], }, },
- src/index.js:1014-1016 (registration)The dispatch registration in the MCP server's CallToolRequestHandler switch statement that routes calls to 'get_coingecko_networks' to the appropriate ToolService method.case TOOL_NAMES.GET_COINGECKO_NETWORKS: result = await toolService.getCoinGeckoNetworks(args.page); break;
- src/constants.js:20-20 (registration)The constant definition mapping the symbolic name TOOL_NAMES.GET_COINGECKO_NETWORKS to the string tool name 'get_coingecko_networks' used throughout the codebase.GET_COINGECKO_NETWORKS: "get_coingecko_networks",