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)}`);
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool checks domain availability, implying a read-only operation, but does not disclose details like rate limits, authentication needs, error handling, or what 'available for use' entails (e.g., registration status). The description adds basic context but lacks depth for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by bullet points for usage guidelines and related tools. Every sentence earns its place by providing actionable information without redundancy, making it efficient and easy to parse for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is complete enough for basic use. It covers purpose, usage scenarios, and next steps, but lacks details on behavioral aspects like response format or error conditions. For a simple read operation, this is largely sufficient, though minor gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'domain' parameter documented as 'Domain name to check availability for.' The description does not add any parameter-specific information beyond what the schema provides, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose as 'Check if a domain is available for use,' which is a specific verb ('Check') and resource ('domain') combination. It clearly distinguishes this tool from its siblings like domain_create, domain_list, domain_update, and domain_delete by focusing solely on availability checking rather than creation, listing, updating, or deletion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines with a 'Best for' section listing specific scenarios (validating domain availability, pre-deployment checks, domain planning) and includes 'Next steps: domain_create' and 'Related: domain_list' to guide the agent on when to use this tool versus alternatives. This offers clear context and direction for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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