Skip to main content
Glama
domain.ts1.07 kB
import { checkRailwayCliStatus, runRailwayJsonCommand } from "./core"; import { analyzeRailwayError } from "./error-handling"; import { getLinkedProjectInfo } from "./projects"; export type GenerateDomainOptions = { workspacePath: string; service?: string; }; export const generateRailwayDomain = async ({ workspacePath, service, }: GenerateDomainOptions): Promise<string> => { try { await checkRailwayCliStatus(); const projectResult = await getLinkedProjectInfo({ workspacePath }); if (!projectResult.success) { throw new Error(projectResult.error); } // Build the railway domain command with options let command = "railway domain --json"; if (service) { command += ` --service ${service}`; } const domainResult = await runRailwayJsonCommand(command, workspacePath); if (domainResult.domain) { return domainResult.domain; } throw new Error("No domain found in Railway CLI JSON response"); } catch (error: unknown) { return analyzeRailwayError(error, "railway domain --json"); } };

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

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