create_service_env
Add environment variables to services in Coolify to configure application settings and deployment behavior, supporting preview deployments and multiline values.
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)Handler implementation for the 'create_service_env' tool. Validates required parameters 'uuid' and 'key', then makes a POST request to the Coolify API endpoint `/services/{uuid}/envs` with the provided arguments.case 'create_service_env': requireParam(args, 'uuid'); requireParam(args, 'key'); return client.post(`/services/${args.uuid}/envs`, args);
- src/tools/definitions.ts:993-1008 (schema)Tool definition including name, description, and input schema for 'create_service_env'. Defines parameters like service UUID, env key, value, and optional flags for preview, literal, and multiline values.{ 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'] } },
- src/index.ts:36-37 (registration)Registration of tool list handler in MCP server, which provides all tool definitions including 'create_service_env' via getToolDefinitions().this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions()
- src/tools/handlers.ts:339-341 (helper)Uses requireParam helper to validate required arguments before API call.requireParam(args, 'uuid'); requireParam(args, 'key'); return client.post(`/services/${args.uuid}/envs`, args);