Skip to main content
Glama

domain_check

Check domain availability for deployment planning and validation. Use this tool to verify if a domain name is available before creating it in Railway infrastructure.

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

  • Handler function for the domain_check tool that proxies to the domain service.
    async ({ domain }) => {
      return domainService.checkDomainAvailability(domain);
    }
  • Input schema definition using Zod for the domain_check tool.
    {
      domain: z.string().describe("Domain name to check availability for")
    },
  • Tool definition and registration via createTool, including name, description, schema, and handler.
      "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);
      }
    ),
  • Registers all tools, including domain_check from domainTools, to the MCP server.
    export function registerAllTools(server: McpServer) {
      // Collect all tools
      const allTools = [
        ...databaseTools,
        ...deploymentTools,
        ...domainTools,
        ...projectTools,
        ...serviceTools,
        ...tcpProxyTools,
        ...variableTools,
        ...configTools,
        ...volumeTools,
        ...templateTools,
      ] as Tool[];
    
      // Register each tool with the server
      allTools.forEach((tool) => {
        server.tool(
          ...tool
        );
      });
    } 
  • Core helper function in DomainService that checks domain availability via the Railway client API and returns formatted MCP tool result.
    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)}`);
      }
    }

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/epitaphe360/railway-mcp'

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