Skip to main content
Glama

service_delete

Remove unused or test services from a project in Railway-MCP. Use this tool to delete services permanently during project reorganization. Requires project and service IDs for operation.

Instructions

[API] Delete a service from a project

⚡️ Best for: ✓ Removing unused services ✓ Cleaning up test services ✓ Project reorganization

⚠️ Not for: × Temporary service stoppage (use service_restart) × Updating service configuration (use service_update)

→ Prerequisites: service_list, service_info

→ Alternatives: service_restart

→ Related: project_delete

Input Schema

NameRequiredDescriptionDefault
projectIdYesID of the project containing the service
serviceIdYesID of the service to delete

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "projectId": { "description": "ID of the project containing the service", "type": "string" }, "serviceId": { "description": "ID of the service to delete", "type": "string" } }, "required": [ "projectId", "serviceId" ], "type": "object" }

Implementation Reference

  • The handler function that executes the service_delete tool logic by calling the serviceService.deleteService method with projectId and serviceId.
    async ({ projectId, serviceId }) => { return serviceService.deleteService(projectId, serviceId); }
  • Input schema using Zod for the service_delete tool, defining required string parameters projectId and serviceId.
    { projectId: z.string().describe("ID of the project containing the service"), serviceId: z.string().describe("ID of the service to delete") },
  • Registration of the service_delete tool via createTool, including formatted description, input schema, and handler function. Added to the serviceTools export array.
    createTool( "service_delete", formatToolDescription({ type: 'API', description: "Delete a service from a project", bestFor: [ "Removing unused services", "Cleaning up test services", "Project reorganization" ], notFor: [ "Temporary service stoppage (use service_restart)", "Updating service configuration (use service_update)" ], relations: { prerequisites: ["service_list", "service_info"], alternatives: ["service_restart"], related: ["project_delete"] } }), { projectId: z.string().describe("ID of the project containing the service"), serviceId: z.string().describe("ID of the service to delete") }, async ({ projectId, serviceId }) => { return serviceService.deleteService(projectId, serviceId); } ),
  • Supporting service layer method deleteService called by the tool handler. Performs the deletion via client.services.deleteService and handles response/error formatting.
    async deleteService(projectId: string, serviceId: string) { try { await this.client.services.deleteService(serviceId); return createSuccessResponse({ text: `Service deleted successfully` }); } catch (error) { return createErrorResponse(`Error deleting service: ${formatError(error)}`); } }
  • Repository method implementing service deletion via GraphQL mutation serviceDelete(id: $serviceId). Called indirectly by the tool.
    async deleteService(serviceId: string): Promise<void> { await this.client.request<{ serviceDelete: boolean }>(` mutation serviceDelete($serviceId: String!) { serviceDelete(id: $serviceId) } `, { serviceId }); }

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