Skip to main content
Glama

domain_update

Update a domain's configuration to change target ports or modify routing settings for Railway.app infrastructure.

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

  • The handler function that executes the domain_update tool logic by calling the domain service's update method.
    async ({ id, targetPort }) => {
      return domainService.updateServiceDomain({ id, targetPort });
    }
  • Zod schema defining the input parameters for the domain_update tool: domain ID and target port.
    {
      id: z.string().describe("ID of the domain to update"),
      targetPort: z.number().describe("New port number to route traffic to")
    },
  • Function that registers all tools, including domain_update from domainTools, 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
        );
      });
    } 
  • Helper function in domain service that handles the actual API call to update service domain and formats the response.
    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 used by the service layer for domain update inputs.
    export interface ServiceDomainUpdateInput {
      /** ID of the domain to update */
      id: string;
      /** New target port for the domain */
      targetPort: number;
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by indicating this is a configuration update operation (implying mutation), mentioning specific constraints (cannot change domain names, not for TCP proxy), and providing prerequisite/next step context. It doesn't mention permissions, rate limits, or error conditions, but provides solid behavioral context.

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?

The description is perfectly structured with clear sections (API label, Best for, Not for, Prerequisites, Next steps, Related). Every sentence earns its place, and information is front-loaded with the core purpose first. No wasted words.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does very well by providing clear purpose, usage guidelines, constraints, and contextual relationships. It could mention what the update returns or error conditions, but given the good structure and guidance, it's mostly complete.

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 description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter-specific information beyond what's in the schema (id and targetPort are clearly documented there). Baseline 3 is appropriate when schema does the heavy lifting.

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 the tool's purpose with specific verbs ('Update a domain's configuration') and distinguishes it from siblings by mentioning what it's not for (changing domain names, TCP proxy configuration). It explicitly differentiates from domain_delete/recreate and tcp_proxy_* tools.

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?

The description provides excellent usage guidance with explicit 'Best for' and 'Not for' sections, naming specific alternatives (delete and recreate for domain name changes). It also includes prerequisite and next step references to domain_list, and mentions related service_update.

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

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