delete_environment
Remove a development or deployment environment from a Coolify project. Use this tool to clean up unused resources and manage project infrastructure.
Instructions
Delete an environment. When COOLIFY_REQUIRE_CONFIRM=true, requires confirm: true parameter.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_uuid | Yes | Project UUID | |
| environment_name_or_uuid | Yes | Environment name or UUID | |
| confirm | No | Confirm the dangerous operation (required when COOLIFY_REQUIRE_CONFIRM=true) |
Implementation Reference
- src/tools/handlers.ts:130-133 (handler)The handler case in the main switch statement that implements the delete_environment tool by calling the CoolifyClient.delete method on the appropriate API endpoint.case 'delete_environment': requireParam(args, 'project_uuid'); requireParam(args, 'environment_name_or_uuid'); return client.delete(`/projects/${args.project_uuid}/environments/${args.environment_name_or_uuid}`);
- src/tools/definitions.ts:832-844 (schema)The input schema definition for the delete_environment tool, specifying required parameters project_uuid and environment_name_or_uuid, and optional confirm flag.{ name: 'delete_environment', description: 'Delete an environment. When COOLIFY_REQUIRE_CONFIRM=true, requires confirm: true parameter.', inputSchema: { type: 'object', properties: { project_uuid: { type: 'string', description: 'Project UUID' }, environment_name_or_uuid: { type: 'string', description: 'Environment name or UUID' }, confirm: { type: 'boolean', description: 'Confirm the dangerous operation (required when COOLIFY_REQUIRE_CONFIRM=true)' } }, required: ['project_uuid', 'environment_name_or_uuid'] } },
- src/tools/handlers.ts:11-30 (helper)The checkConfirmation helper function used before tool execution to enforce confirmation for dangerous operations like delete_environment.function checkConfirmation(name: string, args: ToolArgs): { confirmed: boolean; response?: object } { if (!isConfirmRequired() || !isDangerousOperation(name)) { return { confirmed: true }; } if (args.confirm === true) { return { confirmed: true }; } return { confirmed: false, response: { confirmation_required: true, action: name, warning: getDangerWarning(name), message: `This is a dangerous operation. To proceed, call again with confirm: true`, example: { ...args, confirm: true } } }; }
- src/tools/definitions.ts:45-64 (helper)DANGEROUS_OPERATIONS array listing delete_environment as a dangerous operation requiring confirmation.export const DANGEROUS_OPERATIONS = [ 'stop_application', 'restart_application', 'stop_service', 'restart_service', 'stop_database', 'restart_database', 'deploy_application', 'deploy', 'execute_command', 'delete_server', 'delete_project', 'delete_environment', 'delete_application', 'delete_service', 'delete_database', 'delete_private_key', 'delete_github_app', 'cancel_deployment' ];
- src/tools/definitions.ts:67-86 (helper)DANGER_WARNINGS object providing specific warning message for delete_environment tool.export const DANGER_WARNINGS: Record<string, string> = { stop_application: 'This will stop the application and make it unavailable until restarted.', restart_application: 'This will restart the application, causing brief downtime.', stop_service: 'This will stop the service and make it unavailable until restarted.', restart_service: 'This will restart the service, causing brief downtime.', stop_database: 'This will stop the database and make it unavailable until restarted.', restart_database: 'This will restart the database, causing brief downtime.', deploy_application: 'This will deploy a new version of the application, which may cause downtime.', deploy: 'This will deploy resources by UUID or tag, which may cause downtime.', execute_command: 'This will execute a command inside the application container.', delete_server: 'This will permanently delete the server and all its resources.', delete_project: 'This will permanently delete the project and all its resources.', delete_environment: 'This will permanently delete the environment and all its resources.', delete_application: 'This will permanently delete the application and all its data.', delete_service: 'This will permanently delete the service and all its data.', delete_database: 'This will permanently delete the database and all its data.', delete_private_key: 'This will permanently delete the private key. Make sure no servers are using it.', delete_github_app: 'This will permanently delete the GitHub App configuration. Applications using it will lose access.', cancel_deployment: 'This will cancel the deployment in progress.' };