create_service_env
Add environment variables to a service in Coolify to configure application settings, manage deployment previews, and control runtime behavior.
Instructions
Create an environment variable for a service
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | Service UUID | |
| key | Yes | Environment variable key | |
| value | No | Environment variable value | |
| is_preview | No | Use in preview deployments | |
| is_literal | No | Is literal value | |
| is_multiline | No | Is multiline value |
Implementation Reference
- src/tools/handlers.ts:338-341 (handler)The core handler logic for the 'create_service_env' tool. It validates required parameters 'uuid' (service ID) and 'key' (env var name), then sends a POST request to the Coolify API endpoint `/services/{uuid}/envs` to create the environment variable.case 'create_service_env': requireParam(args, 'uuid'); requireParam(args, 'key'); return client.post(`/services/${args.uuid}/envs`, args);
- src/tools/definitions.ts:993-1007 (schema)The input schema and description for the 'create_service_env' tool, defining the expected parameters, types, descriptions, and required fields used for validation and tool documentation.{ name: 'create_service_env', description: 'Create an environment variable for a service', inputSchema: { type: 'object', properties: { uuid: { type: 'string', description: 'Service UUID' }, key: { type: 'string', description: 'Environment variable key' }, value: { type: 'string', description: 'Environment variable value' }, is_preview: { type: 'boolean', description: 'Use in preview deployments', default: false }, is_literal: { type: 'boolean', description: 'Is literal value', default: false }, is_multiline: { type: 'boolean', description: 'Is multiline value', default: false } }, required: ['uuid', 'key'] }