coolify_application_envs
Manage application environment variables in Coolify by listing, creating, updating in bulk, or deleting them to configure application settings.
Instructions
Application environment variables management - list, create, bulk update, and delete environment variables
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: list (list environment variables), create (create environment variable), bulk_update (bulk update environment variables), delete (delete environment variable) | |
| uuid | Yes | Application UUID (required for all actions) | |
| key | No | Environment variable key (required for create action) | |
| value | No | Environment variable value (required for create action) | |
| env_uuid | No | Environment variable UUID (required for delete action) | |
| envs | No | Array of environment variables (required for bulk_update action) |
Implementation Reference
- src/handlers.ts:177-204 (handler)The main handler function that implements the logic for the 'coolify_application_envs' tool. It handles actions: list, create, bulk_update, delete by making API calls to manage application environment variables.async applicationEnvs(action: string, args: any) { if (!args.uuid) throw new Error('Application UUID is required for all environment variable actions'); switch (action) { case 'list': const response = await this.apiClient.get(`/applications/${args.uuid}/envs`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; case 'create': if (!args.key || !args.value) throw new Error('Key and value are required for create action'); const createResponse = await this.apiClient.post(`/applications/${args.uuid}/envs`, { key: args.key, value: args.value, }); return { content: [{ type: 'text', text: JSON.stringify(createResponse.data, null, 2) }] }; case 'bulk_update': if (!args.envs) throw new Error('Environment variables array is required for bulk_update action'); const bulkResponse = await this.apiClient.patch(`/applications/${args.uuid}/envs/bulk`, { envs: args.envs, }); return { content: [{ type: 'text', text: JSON.stringify(bulkResponse.data, null, 2) }] }; case 'delete': if (!args.env_uuid) throw new Error('Environment variable UUID is required for delete action'); await this.apiClient.delete(`/applications/${args.uuid}/envs/${args.env_uuid}`); return { content: [{ type: 'text', text: 'Environment variable deleted successfully' }] }; default: throw new Error(`Unknown application environment variables action: ${action}`); } }
- src/tools.ts:247-289 (schema)Defines the Tool object including name, description, and inputSchema for the 'coolify_application_envs' tool, used for tool listing and validation.{ name: 'coolify_application_envs', description: 'Application environment variables management - list, create, bulk update, and delete environment variables', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['list', 'create', 'bulk_update', 'delete'], description: 'Action to perform: list (list environment variables), create (create environment variable), bulk_update (bulk update environment variables), delete (delete environment variable)' }, uuid: { type: 'string', description: 'Application UUID (required for all actions)' }, key: { type: 'string', description: 'Environment variable key (required for create action)' }, value: { type: 'string', description: 'Environment variable value (required for create action)' }, env_uuid: { type: 'string', description: 'Environment variable UUID (required for delete action)' }, envs: { type: 'array', description: 'Array of environment variables (required for bulk_update action)', items: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' }, }, required: ['key', 'value'], }, }, }, required: ['action', 'uuid'], }, },
- src/index.ts:106-107 (registration)Switch case in handleToolCall that dispatches calls to the 'coolify_application_envs' tool to the appropriate handler method.case 'coolify_application_envs': return await this.handlers.applicationEnvs(args.action, args);