Skip to main content
Glama

get_supported_networks

Retrieve a list of supported EVM networks through the EVM MCP Server, simplifying integration with 30+ Ethereum-compatible blockchains for token transfers, contract interactions, and ENS resolution.

Instructions

Get a list of supported EVM networks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function registered for the MCP tool 'get_supported_networks'. It calls getSupportedNetworks(), formats the result as JSON text content, and handles errors.
    async () => {
      try {
        const networks = getSupportedNetworks();
        return {
          content: [{ type: "text", text: JSON.stringify({ supportedNetworks: networks }, null, 2) }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true
        };
      }
    }
  • The input schema (empty object), description, and annotations for the 'get_supported_networks' tool.
    {
      description: "Get a list of all supported EVM networks",
      inputSchema: {},
      annotations: {
        title: "Get Supported Networks",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      }
    },
  • The server.registerTool call that registers the 'get_supported_networks' tool with its schema and handler.
    server.registerTool(
      "get_supported_networks",
      {
        description: "Get a list of all supported EVM networks",
        inputSchema: {},
        annotations: {
          title: "Get Supported Networks",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false
        }
      },
      async () => {
        try {
          const networks = getSupportedNetworks();
          return {
            content: [{ type: "text", text: JSON.stringify({ supportedNetworks: networks }, null, 2) }]
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true
          };
        }
      }
    );
  • The core utility function getSupportedNetworks() that extracts and sorts the list of supported network names from the networkNameMap, excluding short aliases like 'eth' or 'op'.
    export function getSupportedNetworks(): string[] {
      return Object.keys(networkNameMap)
        .filter(name => name.length > 2) // Filter out short aliases
        .sort();
    } 

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/mcpdotdirect/evm-mcp-server'

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