Skip to main content
Glama

get-chain-list

Retrieve comprehensive blockchain network information to identify available chains for MetaMask wallet interactions.

Instructions

Get a list of all chains information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute handler fetches the chain list from chainlist.org/rpcs.json, parses it, and returns the JSON string in a structured content response.
    execute: async () => {
      const url = "https://chainlist.org/rpcs.json";
      const response = await fetch(url);
      if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
      }
    
      const data = await response.json();
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data),
          },
        ],
      };
    },
  • Zod schema defining empty input parameters for the tool.
    parameters: z.object({}),
  • Registers the 'get-chain-list' tool on the FastMCP server instance.
    export function registerChainlistTools(server: FastMCP): void {
      server.addTool({
        name: "get-chain-list",
        description: "Get a list of all chains information.",
        parameters: z.object({}),
        execute: async () => {
          const url = "https://chainlist.org/rpcs.json";
          const response = await fetch(url);
          if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
          }
    
          const data = await response.json();
    
          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/Xiawpohr/metamask-mcp'

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