Skip to main content
Glama

getNetworks

Retrieve all supported blockchain networks to identify available options before using network-specific cryptocurrency data functions.

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

  • Handler function for the getNetworks tool. Fetches network data from the DexPaprika API endpoint '/networks' and formats it using formatMcpResponse.
    async () => {
      const data = await fetchFromAPI('/networks');
      return formatMcpResponse(data);
    }
  • Input schema for getNetworks tool: empty object indicating no input parameters are required.
    {},
  • src/index.js:72-80 (registration)
    Registration of the getNetworks tool using McpServer's tool() method, including name, description, schema, and 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);
      }
    );
  • Helper function that formats the raw API response data into the MCP protocol response format, used by getNetworks and other tools.
    function formatMcpResponse(data) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    }
  • Helper function to perform HTTP fetches to the DexPaprika API base URL, with error handling for rate limits and other issues, 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;
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates that this is a read operation (no destructive implications), provides context about the return format ('Returns network IDs like "ethereum", "solana", etc.'), and establishes its role as a prerequisite step. However, it doesn't mention potential limitations like rate limits or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise and front-loaded: the first sentence establishes the core purpose, the second provides critical usage guidance, and the third clarifies the return format. Every sentence earns its place with zero wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description provides excellent contextual completeness. It explains what the tool does, when to use it, and what it returns. The only minor gap is the lack of output schema, but the description compensates by describing the return format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline would be 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on the tool's purpose and usage context, which adds value beyond the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb ('Get') and resource ('all supported blockchain networks'), and distinguishes it from siblings by explaining it's a prerequisite for network-specific functions. It provides explicit differentiation from tools like getNetworkDexes or getNetworkPools that require network IDs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage instructions: 'REQUIRED FIRST STEP' and 'Always call this first to see available networks before using any network-specific functions.' It clearly indicates when to use this tool versus alternatives (network-specific functions) and establishes a clear prerequisite relationship.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.