Skip to main content
Glama

getNetworks

Retrieve all supported blockchain networks to identify available options before accessing network-specific cryptocurrency data and analytics.

Instructions

REQUIRED FIRST STEP: Get all supported blockchain networks. Always call this first to see available networks before using any network-specific functions. Returns network IDs like "ethereum", "solana", etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.js:72-80 (registration)
    Registers the getNetworks MCP tool with empty input schema {}, description, and inline handler function.
    server.tool( 'getNetworks', 'REQUIRED FIRST STEP: Get all supported blockchain networks. Always call this first to see available networks before using any network-specific functions. Returns network IDs like "ethereum", "solana", etc.', {}, async () => { const data = await fetchFromAPI('/networks'); return formatMcpResponse(data); } );
  • Handler function that fetches network data from DexPaprika API endpoint '/networks' and formats it for MCP response.
    async () => { const data = await fetchFromAPI('/networks'); return formatMcpResponse(data); }
  • Empty input schema (no parameters required) for getNetworks tool.
    {},
  • Helper function to fetch data from DexPaprika API, handles errors including 410 (deprecated endpoints) and 429 (rate limits), called by getNetworks handler.
    async function fetchFromAPI(endpoint) { try { const response = await fetch(`${API_BASE_URL}${endpoint}`); if (!response.ok) { if (response.status === 410) { throw new Error( 'This endpoint has been permanently removed. Please use network-specific endpoints instead. ' + 'For example, use /networks/{network}/pools instead of /pools. ' + 'Get available networks first using the getNetworks function.' ); } if (response.status === 429) { throw new Error( 'Rate limit exceeded. You have reached the maximum number of requests allowed for the free tier. ' + 'To increase your rate limits and access additional features, please consider upgrading to a paid plan at https://docs.dexpaprika.com/' ); } throw new Error(`API request failed with status ${response.status}`); } return await response.json(); } catch (error) { console.error(`Error fetching from API: ${error.message}`); throw error; } }
  • Helper function to format API response data into MCP-compatible response structure, used by getNetworks handler.
    function formatMcpResponse(data) { return { content: [ { type: "text", text: JSON.stringify(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/coinpaprika/dexpaprika-mcp'

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