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;
      }
    }
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 describes the tool's behavior as a read-only operation that returns network IDs, though it lacks details on response format, pagination, or error handling. The 'REQUIRED FIRST STEP' emphasis adds useful context about its role in the workflow.

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 highly concise and well-structured, using only two sentences that front-load critical information ('REQUIRED FIRST STEP') and avoid any wasted words. Every sentence adds value by explaining the tool's purpose and its strategic use in the workflow.

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 output schema, no annotations), the description is nearly complete. It clearly explains what the tool does and when to use it, though it could enhance completeness by specifying the exact return format (e.g., list structure) or error scenarios, which are minor gaps.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on the tool's purpose and usage without redundant parameter details, earning a baseline score above 3 for clarity in a parameterless context.

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 action ('Get all supported blockchain networks') and resource ('blockchain networks'), distinguishing it from siblings like getNetworkDexes or getNetworkPools that focus on specific network data. It explicitly identifies what it returns ('network IDs like "ethereum", "solana", etc.'), making the purpose unambiguous.

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 guidance on when to use this tool ('Always call this first to see available networks before using any network-specific functions') and why ('to see available networks'), effectively distinguishing it from siblings that require network IDs. It implicitly excludes usage for other purposes by framing it as a prerequisite step.

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

Install Server

Other Tools

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/infinity-smithpl/dexpaprika-mcp'

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