Skip to main content
Glama

domain_update

Update a domain's target port and reconfigure routing settings. Specify the domain ID and new port number to change endpoint configuration.

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

  • Handler definition for the 'domain_update' tool within domain.tool.ts. Uses createTool with the name 'domain_update', accepts an object schema with 'id' (string) and 'targetPort' (number), and delegates to domainService.updateServiceDomain({ id, targetPort }).
    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 });
      }
    ),
  • Service layer method updateServiceDomain which receives a ServiceDomainUpdateInput, calls this.client.domains.serviceDomainUpdate(input) (the repository layer), and returns a success/error response.
    /**
     * Update a service domain's target port
     * @param input Update parameters including domain ID and new target port
     */
    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)}`);
      }
    }
  • Repository method serviceDomainUpdate that constructs a GraphQL mutation 'serviceDomainUpdate($input: ServiceDomainUpdateInput!)' and sends it via the API client, returning a boolean.
    async serviceDomainUpdate(input: ServiceDomainUpdateInput): Promise<boolean> {
      const query = `
        mutation serviceDomainUpdate($input: ServiceDomainUpdateInput!) {
          serviceDomainUpdate(input: $input)
        }
      `;
    
      const variables = { input };
      const response = await this.client.request<{ serviceDomainUpdate: boolean }>(query, variables);
      return response.serviceDomainUpdate;
    }
  • TypeScript interface ServiceDomainUpdateInput defining the input shape: id (string) and targetPort (number).
    /**
     * Input type for updating a service domain
     */
    export interface ServiceDomainUpdateInput {
      /** ID of the domain to update */
      id: string;
      /** New target port for the domain */
      targetPort: number;
    }
  • Zod validation schema for the domain_update tool: id (z.string()) and targetPort (z.number()).
    {
      id: z.string().describe("ID of the domain to update"),
      targetPort: z.number().describe("New port number to route traffic to")
    },
Behavior3/5

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

Without annotations, the description bears full burden but only states it updates configuration. It does not disclose side effects, reversibility, or potential impacts like downtime or deployment triggers, leaving some behavioral ambiguity.

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 highly concise and well-structured with emojis and bullet points, front-loading the purpose. Every sentence serves a distinct role (purpose, best-for, not-for, prerequisites, next steps, related) without redundancy.

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 simple update tool with two required parameters and no output schema, the description covers the core use case, prerequisites, and next steps. It lacks details on return values or effect confirmation but is adequate given the tool's simplicity.

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 coverage is 100% with clear descriptions for both id and targetPort. The description adds minimal extra meaning beyond restating that targetPort is for routing traffic from the best-for list, so it does not significantly enhance parameter understanding.

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 'Update a domain's configuration' with specific actions like changing target ports, updating settings, and reconfiguring endpoints. It effectively distinguishes from sibling tools like domain_create, domain_delete, and service_update through its 'Not for' section and related tool mention.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Not for' section explicitly excludes changing domain names (recommending delete/recreate) and TCP proxy configuration, providing clear alternatives. Prerequisites and next steps (domain_list) give flow guidance, though a broader comparison with all siblings is missing.

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/jason-tan-swe/railway-mcp'

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