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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the domain to update | |
| targetPort | Yes | New port number to route traffic to |
Implementation Reference
- src/tools/domain.tool.ts:94-121 (handler)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 }); } ), - src/services/domain.service.ts:57-76 (handler)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)}`); } } - src/api/repository/domain.repo.ts:42-52 (handler)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; } - src/types.ts:254-262 (schema)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; } - src/tools/domain.tool.ts:114-117 (schema)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") },