search_chains
Find Arbitrum chains by name, chain ID, or partial name match when you have incomplete information about the network.
Instructions
Search for Arbitrum chains by name, chain ID, or partial name match. Perfect for finding chains when you have incomplete information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (chain name like 'Xai', 'Arbitrum One', chain ID like '42161', or partial name) |
Implementation Reference
- src/index.ts:335-351 (handler)MCP tool handler that executes search_chains by calling ChainLookupService.searchChains with the provided query and formats the results as text response.case "search_chains": const searchResults = await this.chainLookupService.searchChains( args.query as string ); return { content: [ { type: "text", text: searchResults.length > 0 ? `Found chains:\n${searchResults .map((c) => `${c.name} (ID: ${c.chainId})`) .join("\n")}` : `No chains found matching "${args.query}"`, }, ], };
- src/index.ts:1048-1062 (schema)Input schema and metadata definition for the search_chains tool, specifying the required 'query' parameter.name: "search_chains", description: "Search for Arbitrum chains by name, chain ID, or partial name match. Perfect for finding chains when you have incomplete information.", inputSchema: { type: "object" as const, properties: { query: { type: "string", description: "Search query (chain name like 'Xai', 'Arbitrum One', chain ID like '42161', or partial name)", }, }, required: ["query"], }, },
- src/services/chain-lookup.ts:229-239 (helper)Core helper function implementing the chain search logic: filters cached OrbitChainData by name, slug, or exact chain ID match.async searchChains(query: string): Promise<OrbitChainData[]> { await this.ensureChainsData(); const searchQuery = query.toLowerCase().trim(); return this.chainsData.filter(chain => chain.name.toLowerCase().includes(searchQuery) || chain.slug?.toLowerCase().includes(searchQuery) || chain.chainId.toString() === searchQuery ); }