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;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It implies a destructive action ('Delete') but doesn't specify if deletion is permanent, requires specific permissions, or has rate limits. It adds some context (e.g., not for temporary disabling) but lacks details on behavioral traits like error handling or confirmation prompts.

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 well-structured with bullet points (⚡️ Best for, ⚠️ Not for) and arrows for prerequisites/alternatives, making it front-loaded and efficient. Every sentence adds value without redundancy, fitting the tool's complexity appropriately.

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 destructive tool with no annotations and no output schema, the description does well by covering purpose, usage guidelines, and context. However, it lacks details on return values or error cases, which could be important for deletion operations. Given the tool's complexity, it's mostly complete but has minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage (parameter 'id' is documented), so the baseline is 3. The description adds value by implicitly clarifying that 'id' refers to a domain ID (from context like 'domain_list'), though it doesn't explicitly explain parameter semantics beyond the schema. Given the single parameter and high schema coverage, a score of 4 reflects adequate compensation.

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 specific action ('Delete a domain from a service') with the resource ('domain'), distinguishing it from siblings like domain_update (for updates) and domain_list (for listing). It avoids tautology by not just restating the name.

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?

It provides explicit guidance with 'Best for' (removing unused domains, cleaning up configurations) and 'Not for' (temporary domain disabling, port updates), plus mentions prerequisites (domain_list) and alternatives (domain_update), clearly defining when to use this tool versus others.

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