coolify_service_lifecycle
Manage service states in Coolify infrastructure by starting, stopping, or restarting services using their UUID.
Instructions
Service lifecycle management - start, stop, and restart services
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: start (start service), stop (stop service), restart (restart service) | |
| uuid | Yes | Service UUID (required for all actions) |
Implementation Reference
- src/handlers.ts:402-418 (handler)The handler function that implements the core logic for the coolify_service_lifecycle tool. It takes action (start/stop/restart) and service UUID, then calls the appropriate Coolify API endpoint and returns the response.async serviceLifecycle(action: string, uuid: string) { if (!uuid) throw new Error('Service UUID is required for all lifecycle actions'); switch (action) { case 'start': const startResponse = await this.apiClient.post(`/services/${uuid}/start`); return { content: [{ type: 'text', text: JSON.stringify(startResponse.data, null, 2) }] }; case 'stop': const stopResponse = await this.apiClient.post(`/services/${uuid}/stop`); return { content: [{ type: 'text', text: JSON.stringify(stopResponse.data, null, 2) }] }; case 'restart': const restartResponse = await this.apiClient.post(`/services/${uuid}/restart`); return { content: [{ type: 'text', text: JSON.stringify(restartResponse.data, null, 2) }] }; default: throw new Error(`Unknown service lifecycle action: ${action}`); } }
- src/tools.ts:611-629 (schema)The tool definition including name, description, and input schema validation for coolify_service_lifecycle.{ name: 'coolify_service_lifecycle', description: 'Service lifecycle management - start, stop, and restart services', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['start', 'stop', 'restart'], description: 'Action to perform: start (start service), stop (stop service), restart (restart service)' }, uuid: { type: 'string', description: 'Service UUID (required for all actions)' }, }, required: ['action', 'uuid'], }, },
- src/index.ts:130-131 (registration)The switch case in the main tool dispatcher that registers and routes calls to the serviceLifecycle handler for this tool.case 'coolify_service_lifecycle': return await this.handlers.serviceLifecycle(args.action, args.uuid);