Skip to main content
Glama

domain_delete

Remove a domain from a Railway service to clean up unused configurations or manage domain assignments. This tool permanently deletes domains, not temporarily disable them.

Instructions

[API] Delete a domain from a service

⚡️ Best for: ✓ Removing unused domains ✓ Cleaning up configurations ✓ Domain management

⚠️ Not for: × Temporary domain disabling × Port updates (use domain_update)

→ Prerequisites: domain_list

→ Alternatives: domain_update

→ Related: service_update

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the domain to delete

Implementation Reference

  • Registration of the 'domain_delete' MCP tool using createTool, including detailed description, input schema (id: string), and handler that delegates to domainService.deleteServiceDomain(id)
    createTool(
      "domain_delete",
      formatToolDescription({
        type: 'API',
        description: "Delete a domain from a service",
        bestFor: [
          "Removing unused domains",
          "Cleaning up configurations",
          "Domain management"
        ],
        notFor: [
          "Temporary domain disabling",
          "Port updates (use domain_update)"
        ],
        relations: {
          prerequisites: ["domain_list"],
          alternatives: ["domain_update"],
          related: ["service_update"]
        }
      }),
      {
        id: z.string().describe("ID of the domain to delete")
      },
      async ({ id }) => {
        return domainService.deleteServiceDomain(id);
      }
    )
  • domainService.deleteServiceDomain(id) method: service layer implementation that calls the repository's serviceDomainDelete and wraps response in success/error format
    async deleteServiceDomain(id: string): Promise<CallToolResult> {
      try {
        const result = await this.client.domains.serviceDomainDelete(id);
        
        if (result) {
          return createSuccessResponse({
            text: `Domain with ID ${id} deleted successfully`,
            data: { success: true }
          });
        } else {
          return createErrorResponse(`Failed to delete domain with ID ${id}`);
        }
      } catch (error) {
        return createErrorResponse(`Error deleting domain: ${formatError(error)}`);
      }
    }
  • Repository method serviceDomainDelete(id): executes GraphQL mutation to delete the service domain via Railway API
    async serviceDomainDelete(id: string): Promise<boolean> {
      const query = `
        mutation serviceDomainDelete($id: String!) {
          serviceDomainDelete(id: $id)
        }
      `;
    
      const variables = { id };
      const response = await this.client.request<{ serviceDomainDelete: boolean }>(query, variables);
      return response.serviceDomainDelete;
    }

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