Skip to main content
Glama
cfenzo
by cfenzo

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
NameRequiredDescriptionDefault
nameYesThe domain name without TLD (e.g., 'example')
tldsNoList of TLDs to check. If not provided, checks popular TLDs.
categoryNoCategory of TLDs to check if 'tlds' not provided. Default: general

Implementation Reference

  • 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), }, ], }; }
  • 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"], }, },
  • 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[]; }
  • 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; } }

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/cfenzo/domain-mcp'

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