Skip to main content
Glama

domain_update

Update domain configuration settings like target ports and endpoints for Railway.app infrastructure management.

Instructions

[API] Update a domain's configuration

⚡️ Best for: ✓ Changing target ports ✓ Updating domain settings ✓ Reconfiguring endpoints

⚠️ Not for: × Changing domain names (delete and recreate instead) × TCP proxy configuration

→ Prerequisites: domain_list

→ Next steps: domain_list

→ Related: service_update

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the domain to update
targetPortYesNew port number to route traffic to

Implementation Reference

  • Creates the 'domain_update' tool with description, Zod schema, and handler using createTool. This tool object is later registered to the MCP server.
    createTool( "domain_update", formatToolDescription({ type: 'API', description: "Update a domain's configuration", bestFor: [ "Changing target ports", "Updating domain settings", "Reconfiguring endpoints" ], notFor: [ "Changing domain names (delete and recreate instead)", "TCP proxy configuration" ], relations: { prerequisites: ["domain_list"], nextSteps: ["domain_list"], related: ["service_update"] } }), { id: z.string().describe("ID of the domain to update"), targetPort: z.number().describe("New port number to route traffic to") }, async ({ id, targetPort }) => { return domainService.updateServiceDomain({ id, targetPort }); } ),
  • Aggregates all tools including domainTools (containing domain_update) and registers them to the MCP server using server.tool().
    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 ); }); }
  • MCP tool handler for 'domain_update': extracts id and targetPort from args and delegates to domainService.updateServiceDomain.
    async ({ id, targetPort }) => { return domainService.updateServiceDomain({ id, targetPort }); }
  • Service layer implementation of domain update: calls Railway client API, handles success/error responses, and returns formatted CallToolResult.
    async updateServiceDomain(input: ServiceDomainUpdateInput): Promise<CallToolResult> { try { const result = await this.client.domains.serviceDomainUpdate(input); if (result) { return createSuccessResponse({ text: `Domain with ID ${input.id} updated successfully with new target port: ${input.targetPort}`, data: { success: true } }); } else { return createErrorResponse(`Failed to update domain with ID ${input.id}`); } } catch (error) { return createErrorResponse(`Error updating domain: ${formatError(error)}`); } }
  • TypeScript interface defining ServiceDomainUpdateInput used by the service layer for domain_update.
    export interface ServiceDomainUpdateInput { /** ID of the domain to update */ id: string; /** New target port for the domain */ targetPort: number; }

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