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
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to check availability for |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"domain": {
"description": "Domain name to check availability for",
"type": "string"
}
},
"required": [
"domain"
],
"type": "object"
}
Implementation Reference
- src/tools/domain.tool.ts:71-92 (registration)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); } ),
- src/tools/domain.tool.ts:89-91 (handler)The executor/handler function provided to the MCP server for the domain_check tool.async ({ domain }) => { return domainService.checkDomainAvailability(domain); }
- src/tools/domain.tool.ts:86-88 (schema)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)}`); } }
- src/tools/index.ts:32-36 (registration)Generic registration of all tools, including domain_check (imported via domainTools), to the MCP server.allTools.forEach((tool) => { server.tool( ...tool ); });