coolify_project_environments
Manage project environments by listing, creating, retrieving details, or deleting them within Coolify infrastructure projects.
Instructions
Project environment management - list, create, get, and delete project environments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: list (list all environments in project), create (create new environment), get (get environment details), delete (delete environment) | |
| project_uuid | Yes | Project UUID (required for all actions) | |
| environment_name_or_uuid | No | Environment name or UUID (required for get and delete actions) | |
| name | No | Environment name (required for create action) |
Implementation Reference
- src/handlers.ts:87-111 (handler)The handler function that implements the execution logic for the coolify_project_environments tool, dispatching to API endpoints based on the action (list, create, get, delete).async projectEnvironments(action: string, args: any) { if (!args.project_uuid) throw new Error('Project UUID is required for all project environment actions'); switch (action) { case 'list': const response = await this.apiClient.get(`/projects/${args.project_uuid}/environments`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; case 'create': if (!args.name) throw new Error('Environment name is required for create action'); const createResponse = await this.apiClient.post(`/projects/${args.project_uuid}/environments`, { name: args.name, }); return { content: [{ type: 'text', text: JSON.stringify(createResponse.data, null, 2) }] }; case 'get': if (!args.environment_name_or_uuid) throw new Error('Environment name or UUID is required for get action'); const getResponse = await this.apiClient.get(`/projects/${args.project_uuid}/${args.environment_name_or_uuid}`); return { content: [{ type: 'text', text: JSON.stringify(getResponse.data, null, 2) }] }; case 'delete': if (!args.environment_name_or_uuid) throw new Error('Environment name or UUID is required for delete action'); const deleteResponse = await this.apiClient.delete(`/projects/${args.project_uuid}/environments/${args.environment_name_or_uuid}`); return { content: [{ type: 'text', text: JSON.stringify(deleteResponse.data, null, 2) }] }; default: throw new Error(`Unknown project environments action: ${action}`); } }
- src/tools.ts:78-104 (schema)The tool definition including name, description, and input schema for validation.{ name: 'coolify_project_environments', description: 'Project environment management - list, create, get, and delete project environments', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['list', 'create', 'get', 'delete'], description: 'Action to perform: list (list all environments in project), create (create new environment), get (get environment details), delete (delete environment)' }, project_uuid: { type: 'string', description: 'Project UUID (required for all actions)' }, environment_name_or_uuid: { type: 'string', description: 'Environment name or UUID (required for get and delete actions)' }, name: { type: 'string', description: 'Environment name (required for create action)' }, }, required: ['action', 'project_uuid'], }, },
- src/index.ts:98-99 (registration)The switch case in handleToolCall that registers and routes calls to the projectEnvironments handler.case 'coolify_project_environments': return await this.handlers.projectEnvironments(args.action, args);
- src/index.ts:60-63 (registration)Registers the listTools handler which returns all tools including coolify_project_environments via getTools().this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getTools(), };