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
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | 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 | Yes | Address to check: Ethereum address, participant name, "me", or "#N". |
Implementation Reference
- src/tools/messaging.ts:73-122 (handler)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 */ } } }, );