Skip to main content
Glama
warengonzaga

Relay Protocol MCP Server

by warengonzaga

relay_get_chains

Get details of all supported chains for cross-chain operations, including RPC URLs, explorers, currencies, and tokens. Optionally filter by specific chain IDs.

Instructions

Get all supported chains for cross-chain operations. Returns detailed information about each chain including RPC URLs, explorers, currencies, and supported tokens.

Common Chain IDs: • Ethereum: 1 • Optimism: 10 • Polygon: 137 • Arbitrum: 42161 • Base: 8453 • BNB Chain: 56

Optional: Use includeChains parameter to filter specific chains (comma-separated chain IDs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeChainsNoComma-separated list of chain IDs to include

Implementation Reference

  • Handler function for the relay_get_chains tool. Validates args using Zod schema (getChainsSchema), then calls client.getChains(includeChains) to fetch chain data from the API.
    handler: async (args: unknown) => {
      const { includeChains } = getChainsSchema.parse(args);
      return await client.getChains(includeChains);
    },
  • Zod schema (getChainsSchema) for validating the relay_get_chains tool's input. Accepts an optional 'includeChains' string parameter for filtering by comma-separated chain IDs.
    const getChainsSchema = z.object({
      includeChains: z.string().optional().describe('Comma-separated list of chain IDs to include'),
    });
  • Tool object registration for 'relay_get_chains' with name, description, JSON inputSchema, and the handler function, exported via createChainTools().
    relay_get_chains: {
      name: 'relay_get_chains',
      description: 'Get all supported chains for cross-chain operations. Returns detailed information about each chain including RPC URLs, explorers, currencies, and supported tokens.\n\nCommon Chain IDs:\n• Ethereum: 1\n• Optimism: 10\n• Polygon: 137\n• Arbitrum: 42161\n• Base: 8453\n• BNB Chain: 56\n\nOptional: Use includeChains parameter to filter specific chains (comma-separated chain IDs).',
      inputSchema: {
        type: 'object',
        properties: {
          includeChains: {
            type: 'string',
            description: 'Comma-separated list of chain IDs to include'
          }
        },
        additionalProperties: false
      },
      /**
       * Handler function for the relay_get_chains tool.
       * 
       * @param {unknown} args - Raw arguments from MCP client
       * @returns {Promise<ChainsResponse>} Chain information data
       * @throws {ZodError} When arguments don't match the expected schema
       */
      handler: async (args: unknown) => {
        const { includeChains } = getChainsSchema.parse(args);
        return await client.getChains(includeChains);
      },
    },
  • Top-level registration: createAllTools() aggregates all tools including relay_get_chains by spreading createChainTools(client) into the registry.
    export function createAllTools(client: RelayClient): Record<string, Tool> {
      return {
        ...createChainTools(client),
        ...createPriceTools(client),
        ...createQuoteTools(client),
        ...createRequestTools(client),
        ...createTransactionTools(client),
        ...createCurrencyTools(client),
        ...createSwapTools(client),
      };
    }
  • The getChains() method on RelayClient that actually makes the HTTP GET request to '/chains' endpoint, returning a ChainsResponse.
    async getChains(includeChains?: string): Promise<ChainsResponse> {
      const params = includeChains ? { includeChains } : {};
      const response = await this.client.get<ChainsResponse>('/chains', { params });
      return response.data;
    }
Behavior3/5

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

No annotations are provided, so the description must disclose behavior. It indicates a read-only operation returning detailed information, but doesn't mention response size, rate limits, or potential errors.

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 succinct and front-loaded with the main purpose, followed by useful context (common IDs) and parameter usage. No extra fluff.

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 single optional parameter and no output schema, the description provides sufficient context: return content, common IDs, and filtering. Could benefit from mention of response size or limits, but adequate.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description adds minimal extra value beyond the schema's parameter description, just restating the optional nature and format.

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 tool retrieves all supported chains with details like RPC URLs and explorers. It distinguishes itself from siblings like relay_get_currencies and provides a list of common chain IDs.

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

Usage Guidelines4/5

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

The description explains the optional filter parameter and provides common chain IDs, aiding usage. However, it doesn't explicitly state when to use this tool versus alternatives or when not to use it, though the distinct purpose is clear.

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/warengonzaga/relay-protocol-mcp-server'

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