Skip to main content
Glama

domain_check

Verify domain availability for pre-deployment checks. Ensure your domain is free before creating it.

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

  • The `checkDomainAvailability` method in DomainService class is the core logic that executes the domain_check tool. It calls the Railway API client's `serviceDomainAvailable` method and returns a formatted success or error response depending on availability.
    /**
     * Check if a service domain is available
     * @param domain Domain to check
     */
    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)}`);
      }
    }
  • The Zod input schema for the domain_check tool requires a single string parameter 'domain' with a description of the domain name to check availability for.
    {
      domain: z.string().describe("Domain name to check availability for")
    },
  • The domain_check tool is registered via `createTool()`, with tool name 'domain_check', a formatToolDescription() for its metadata, a Zod schema for inputs, and an async handler that delegates to `domainService.checkDomainAvailability(domain)`.
    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);
      }
    ),
  • BaseService provides the `client` property (RailwayApiClient) used by DomainService to access `this.client.domains.serviceDomainAvailable()`.
    import { RailwayApiClient, railwayClient } from '@/api/api-client.js';
    
    export class BaseService {
      protected client: RailwayApiClient;
    
      constructor() {
        this.client = railwayClient;
      }
Behavior4/5

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

The description labels it as an '[API]' call, implying a network operation, but doesn't detail side effects or authentication requirements. However, for a simple check tool, this is sufficient. Without annotations, it carries the burden but still scores high as no contradictions.

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?

Extremely concise: two sentences plus bullet points. Front-loaded with '[API]'. Every sentence is useful and earns its place.

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

Completeness5/5

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

Given the tool's simplicity (one required param, no output schema, no annotations), the description fully covers its purpose, use cases, and related tools. No 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?

Schema coverage is 100% (the 'domain' parameter is described). The description reinforces the parameter's purpose but adds minimal additional meaning beyond 'Domain name to check availability for'. Baseline of 3 applies.

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 clearly states 'Check if a domain is available for use' with a specific verb and resource. The 'Best for' section further clarifies its purpose and distinguishes it from siblings like domain_create and domain_list.

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?

Provides explicit guidance on when to use ('Validating domain availability, Pre-deployment checks, Domain planning') and what to do next ('Next steps: domain_create'). Also lists a related tool (domain_list), giving clear context for 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/jason-tan-swe/railway-mcp'

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