check_alternative_tlds
Check domain availability across multiple TLDs to find available alternatives when your preferred domain is already taken.
Instructions
Check domain availability across multiple TLDs. Useful for finding available alternatives when the primary TLD is taken.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The domain name without TLD (e.g., 'example') | |
| tlds | No | List of TLDs to check. If not provided, checks popular TLDs. | |
| category | No | Category of TLDs to check if 'tlds' not provided. Default: general |
Implementation Reference
- src/index.ts:162-199 (handler)MCP tool handler for 'check_alternative_tlds' - processes input arguments, calls the implementation function, and formats the response by separating available and taken domains into a structured summary.case "check_alternative_tlds": { const domainName = args?.name as string; if (!domainName) { throw new Error("Domain name is required"); } let tlds: string[]; if (args?.tlds && Array.isArray(args.tlds)) { tlds = args.tlds as string[]; } else { const category = (args?.category as string) || "general"; tlds = getSuggestedTlds(category as "general" | "tech" | "country" | "all"); } const results = await checkAlternativeTlds(domainName, tlds); // Separate available and taken const available = results.results.filter((r) => r.available); const taken = results.results.filter((r) => !r.available); const summary = { originalDomain: results.originalDomain, totalChecked: results.results.length, availableCount: available.length, takenCount: taken.length, available, taken, }; return { content: [ { type: "text", text: JSON.stringify(summary, null, 2), }, ], }; }
- src/domain-checker.ts:281-309 (handler)Core implementation of checkAlternativeTlds function - checks domain availability across multiple TLDs using batch processing with configurable concurrency and delay to avoid rate limits.export async function checkAlternativeTlds( domainName: string, tlds: string[] = POPULAR_TLDS, options: { concurrency?: number; batchDelay?: number } = {} ): Promise<AlternativeTldResult> { const { concurrency = DEFAULT_CONCURRENCY, batchDelay = BATCH_DELAY_MS } = options; const name = domainName.includes(".") ? parseDomain(domainName).name : domainName; const results: DomainCheckResult[] = []; // Process in batches to avoid overwhelming servers for (let i = 0; i < tlds.length; i += concurrency) { const batch = tlds.slice(i, i + concurrency); const batchResults = await Promise.all( batch.map((tld) => checkDomain(`${name}.${tld}`)) ); results.push(...batchResults); // Add delay between batches (except after the last batch) if (i + concurrency < tlds.length) { await sleep(batchDelay); } } return { originalDomain: name, results, }; }
- src/index.ts:38-64 (registration)Tool registration for 'check_alternative_tlds' - defines the input schema with parameters for name, tlds array, and category enum, with descriptions for each field.{ name: "check_alternative_tlds", description: "Check domain availability across multiple TLDs. Useful for finding available alternatives when the primary TLD is taken.", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "The domain name without TLD (e.g., 'example')", }, tlds: { type: "array", items: { type: "string" }, description: "List of TLDs to check. If not provided, checks popular TLDs.", }, category: { type: "string", enum: ["general", "tech", "country", "all"], description: "Category of TLDs to check if 'tlds' not provided. Default: general", }, }, required: ["name"], }, },
- src/domain-checker.ts:17-30 (schema)Type definitions for AlternativeTldResult and DomainCheckResult interfaces - defines the structure for domain check results including domain, tld, availability status, method, confidence, and optional details/errors.export interface DomainCheckResult { domain: string; tld: string; available: boolean; method: "dns" | "whois" | "both"; confidence: "high" | "medium" | "low"; details?: string; error?: string; } export interface AlternativeTldResult { originalDomain: string; results: DomainCheckResult[]; }
- src/domain-checker.ts:314-328 (helper)Helper function getSuggestedTlds - returns appropriate TLD lists based on category (general, tech, country, all), used by the handler to determine which TLDs to check when not explicitly provided.export function getSuggestedTlds( purpose: "general" | "tech" | "country" | "all" = "general" ): string[] { switch (purpose) { case "tech": return TECH_TLDS; case "country": return COUNTRY_TLDS; case "all": return [...new Set([...POPULAR_TLDS, ...TECH_TLDS, ...COUNTRY_TLDS])]; case "general": default: return POPULAR_TLDS; } }