Skip to main content
Glama

azeth_check_reachability

Verify if an Ethereum address can receive XMTP messages on the XMTP network before sending communications.

Instructions

Check if an Ethereum address is reachable on the XMTP messaging network.

Use this when: You want to verify a participant can receive XMTP messages before sending. This is a read-like operation and safe to retry.

The "address" field accepts: an Ethereum address, a participant name, "me", or "#N" (account index).

Returns: The address and whether it is reachable (boolean).

Note: Reachability is cached for 5 minutes. An address is reachable if it has an active XMTP identity. The checking account is determined by the AZETH_PRIVATE_KEY environment variable.

Example: { "address": "Alice" } or { "address": "0x1234567890abcdef1234567890abcdef12345678" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoTarget chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").
addressYesAddress to check: Ethereum address, participant name, "me", or "#N".

Implementation Reference

  • The implementation of the `azeth_check_reachability` tool, including tool registration, schema definition, and the handler function that checks if an address is reachable on the XMTP network.
    server.registerTool(
      'azeth_check_reachability',
      {
        description: [
          'Check if an Ethereum address is reachable on the XMTP messaging network.',
          '',
          'Use this when: You want to verify a participant can receive XMTP messages before sending.',
          'This is a read-like operation and safe to retry.',
          '',
          'The "address" field accepts: an Ethereum address, a participant name, "me", or "#N" (account index).',
          '',
          'Returns: The address and whether it is reachable (boolean).',
          '',
          'Note: Reachability is cached for 5 minutes. An address is reachable if it has an active XMTP identity.',
          'The checking account is determined by the AZETH_PRIVATE_KEY environment variable.',
          '',
          'Example: { "address": "Alice" } or { "address": "0x1234567890abcdef1234567890abcdef12345678" }',
        ].join('\n'),
        inputSchema: z.object({
          chain: z.string().optional().describe('Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").'),
          address: z.string().describe('Address to check: Ethereum address, participant name, "me", or "#N".'),
        }),
      },
      async (args) => {
        let client;
        try {
          client = await createClient(args.chain);
    
          // Resolve address: address, name, "me", "#N"
          let resolved;
          try {
            resolved = await resolveAddress(args.address, client);
          } catch (resolveErr) {
            return handleError(resolveErr);
          }
    
          const reachable = await client.canReach(resolved.address);
    
          return success({
            address: resolved.address,
            ...(resolved.resolvedFrom ? { resolvedFrom: `"${resolved.resolvedFrom}" → ${resolved.address}` } : {}),
            reachable,
          });
        } catch (err) {
          return handleError(err);
        } finally {
          try { await client?.destroy(); } catch { /* M-10: prevent destroy from masking the original error */ }
        }
      },
    );

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/azeth-protocol/mcp-azeth'

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