Skip to main content
Glama
generate-domain.ts•1.79 kB
import z from "zod"; import type { GenerateDomainOptions } from "../cli/domain"; import { generateRailwayDomain } from "../cli/domain"; import { createToolResponse } from "../utils"; export const generateDomainTool = { name: "generate-domain", title: "Generate Railway Domain", description: "Generate a domain for the currently linked Railway project. If a domain already exists, it will return the existing domain URL. Optionally specify a service to generate the domain for.", inputSchema: { workspacePath: z .string() .describe("The path to the workspace to generate domain for"), service: z .string() .optional() .describe( "The name of the service to generate the domain for (optional)" ), }, handler: async ({ workspacePath, service }: GenerateDomainOptions) => { try { const domain = await generateRailwayDomain({ workspacePath, service, }); return createToolResponse( `āœ… Successfully generated Railway domain${ service ? ` for service '${service}'` : "" }:\n\nšŸš€ ${domain}\n\n**Note:** This domain is now available for your Railway project.` ); } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return createToolResponse( "āŒ Failed to generate Railway domain\n\n" + `**Error:** ${errorMessage}\n\n` + "**Next Steps:**\n" + "• Ensure you have a Railway project linked\n" + "• Check that you have permissions to generate domains\n" + "• Verify the project has been deployed at least once\n" + "• Run `railway link` to ensure proper project connection" ); } }, };

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