get_coingecko_networks
Retrieve supported blockchain networks from CoinGecko/GeckoTerminal for crypto trading analysis and portfolio management across multiple chains.
Instructions
Get list of supported networks on CoinGecko/GeckoTerminal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (optional, default: 1) |
Implementation Reference
- src/toolService.js:156-164 (handler)Main handler function that executes the tool logic by calling the CoinGecko API service's getNetworks method and wrapping the response with standardized 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}`, }; }
- src/index.js:238-251 (schema)MCP tool schema defining the input parameters (page optional integer) and description for get_coingecko_networks.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)MCP server request handler switch case that registers and dispatches calls to the tool handler.case TOOL_NAMES.GET_COINGECKO_NETWORKS: result = await toolService.getCoinGeckoNetworks(args.page); break;
- Supporting utility in CoinGeckoApiService that makes the actual HTTP request to the CoinGecko /onchain/networks endpoint with pagination.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/constants.js:20-20 (helper)Constant defining the tool name string used throughout the codebase.GET_COINGECKO_NETWORKS: "get_coingecko_networks",