chain_info
Retrieve chain-specific data for Arbitrum networks including contract addresses, chain IDs, RPC URLs, and native token details to support development and monitoring tasks.
Instructions
Get comprehensive chain information including rollup contract address, bridge addresses, chain ID, RPC URL, explorer URL, native token details, and all bridge contract addresses. Use this for questions about rollup addresses, bridge contracts, chain IDs, or any chain-specific data for Arbitrum chains like Xai, Arbitrum One, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | Yes | Chain name to look up (e.g., 'Xai', 'Arbitrum One', 'Nova', 'Stylus') |
Implementation Reference
- src/index.ts:353-374 (handler)Executes the chain_info tool by invoking ChainLookupService.findChainByName(chainName) and returning the chain information as JSON text content or error if not found.case "chain_info": const chainInfo = await this.chainLookupService.findChainByName( args.chainName as string ); if (!chainInfo) { return { content: [ { type: "text", text: `Chain "${args.chainName}" not found`, }, ], }; } return { content: [ { type: "text", text: JSON.stringify(chainInfo, null, 2), }, ], };
- src/index.ts:1063-1078 (registration)Registers the chain_info tool in the list of available tools, including its description and input schema requiring 'chainName'.{ name: "chain_info", description: "Get comprehensive chain information including rollup contract address, bridge addresses, chain ID, RPC URL, explorer URL, native token details, and all bridge contract addresses. Use this for questions about rollup addresses, bridge contracts, chain IDs, or any chain-specific data for Arbitrum chains like Xai, Arbitrum One, etc.", inputSchema: { type: "object" as const, properties: { chainName: { type: "string", description: "Chain name to look up (e.g., 'Xai', 'Arbitrum One', 'Nova', 'Stylus')", }, }, required: ["chainName"], }, },
- src/services/chain-lookup.ts:4-57 (schema)Defines the OrbitChainData interface which structures the output data returned by the chain_info tool.export interface OrbitChainData { chainId: number; name: string; slug: string; parentChainId: number; rpcUrl: string; explorerUrl?: string; nativeCurrency: { name: string; symbol: string; decimals: number; }; isArbitrum: boolean; isMainnet: boolean; isCustom?: boolean; isTestnet?: boolean; // Ethereum Bridge Contract Addresses (nested under ethBridge) ethBridge?: { bridge: string; inbox: string; outbox: string; rollup: string; sequencerInbox: string; }; // Legacy flat structure for backward compatibility bridge?: string; inbox?: string; outbox?: string; rollup?: string; sequencerInbox?: string; // Token Bridge Contract Addresses parentCustomGateway?: string; parentErc20Gateway?: string; parentGatewayRouter?: string; childCustomGateway?: string; childErc20Gateway?: string; childGatewayRouter?: string; // UI Configuration color?: string; description?: string; logo?: string; // Native Token (for custom tokens) nativeToken?: { name: string; symbol: string; decimals: number; address?: string; }; }
- src/services/chain-lookup.ts:184-210 (helper)Core helper function that performs fuzzy matching on chain names (exact, slug, partial) to retrieve OrbitChainData from cached chains list.async findChainByName(name: string): Promise<OrbitChainData | null> { await this.ensureChainsData(); const searchName = name.toLowerCase().trim(); // Try exact name match first let chain = this.chainsData.find(chain => chain.name.toLowerCase() === searchName ); if (!chain) { // Try slug match chain = this.chainsData.find(chain => chain.slug?.toLowerCase() === searchName ); } if (!chain) { // Try partial name match chain = this.chainsData.find(chain => chain.name.toLowerCase().includes(searchName) || searchName.includes(chain.name.toLowerCase()) ); } return chain || null; }