Skip to main content
Glama

project_delete

Remove a Railway project and all associated resources permanently using this API tool. Ideal for cleaning up unused or test projects. Requires project ID as input.

Instructions

[API] Delete a Railway project and all its resources

⚡️ Best for: ✓ Removing unused projects ✓ Cleaning up test projects

⚠️ Not for: × Temporary project deactivation × Service-level cleanup (use service_delete)

→ Prerequisites: project_list, project_info

→ Alternatives: service_delete

→ Related: project_create

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesID of the project to delete

Implementation Reference

  • The handler function for the 'project_delete' MCP tool, which calls projectService.deleteProject(projectId).
    async ({ projectId }) => {
      return projectService.deleteProject(projectId);
    }
  • Zod schema defining the input parameter 'projectId' for the project_delete tool.
    {
      projectId: z.string().describe("ID of the project to delete")
    },
  • Registration of all tools including 'project_delete' (imported via projectTools from project.tool.ts) to the MCP server.
    export function registerAllTools(server: McpServer) {
      // Collect all tools
      const allTools = [
        ...databaseTools,
        ...deploymentTools,
        ...domainTools,
        ...projectTools,
        ...serviceTools,
        ...tcpProxyTools,
        ...variableTools,
        ...configTools,
        ...volumeTools,
        ...templateTools,
      ] as Tool[];
    
      // Register each tool with the server
      allTools.forEach((tool) => {
        server.tool(
          ...tool
        );
      });
    } 
  • projectService.deleteProject method invoked by the tool handler, which performs the actual deletion via the API client.
    async deleteProject(projectId: string): Promise<CallToolResult> {
      try {
        await this.client.projects.deleteProject(projectId);
        return createSuccessResponse({
          text: "Project deleted successfully"
        });
      } catch (error) {
        return createErrorResponse(`Error deleting project: ${formatError(error)}`);
      }
    }
  • GraphQL mutation implementation in project repository that executes the project deletion.
    async deleteProject(projectId: string): Promise<void> {
      await this.client.request<{ projectDelete: boolean }>(`
        mutation projectDelete($projectId: String!) {
          projectDelete(id: $projectId)
        }
      `, { projectId });
    }

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