Skip to main content
Glama

domain_check

Validate domain availability for pre-deployment checks or planning. Use the API to confirm if a domain is free before proceeding with creation or management.

Instructions

[API] Check if a domain is available for use

⚡️ Best for: ✓ Validating domain availability ✓ Pre-deployment checks ✓ Domain planning

→ Next steps: domain_create

→ Related: domain_list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name to check availability for

Implementation Reference

  • Full tool definition using createTool, including name, formatted description, input schema, and handler function for the 'domain_check' tool.
    createTool(
      "domain_check",
      formatToolDescription({
        type: 'API',
        description: "Check if a domain is available for use",
        bestFor: [
          "Validating domain availability",
          "Pre-deployment checks",
          "Domain planning"
        ],
        relations: {
          nextSteps: ["domain_create"],
          related: ["domain_list"]
        }
      }),
      {
        domain: z.string().describe("Domain name to check availability for")
      },
      async ({ domain }) => {
        return domainService.checkDomainAvailability(domain);
      }
    ),
  • The executor/handler function provided to the MCP server for the domain_check tool.
    async ({ domain }) => {
      return domainService.checkDomainAvailability(domain);
    }
  • Input schema validation using Zod for the domain_check tool.
    {
      domain: z.string().describe("Domain name to check availability for")
    },
  • Supporting service method that performs the actual domain availability check via the Railway client API and handles response formatting.
    async checkDomainAvailability(domain: string): Promise<CallToolResult> {
      try {
        const result = await this.client.domains.serviceDomainAvailable(domain);
        
        if (result.available) {
          return createSuccessResponse({
            text: `Domain ${domain} is available`,
            data: result
          });
        } else {
          return createSuccessResponse({
            text: `Domain ${domain} is not available: ${result.message}`,
            data: result
          });
        }
      } catch (error) {
        return createErrorResponse(`Error checking domain availability: ${formatError(error)}`);
      }
    }
  • Generic registration of all tools, including domain_check (imported via domainTools), to the MCP server.
    allTools.forEach((tool) => {
      server.tool(
        ...tool
      );
    });

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/jason-tan-swe/railway-mcp'

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