coolify_services
Manage services in Coolify infrastructure: create, list, retrieve, update, or delete services using Docker Compose configurations.
Instructions
Service CRUD operations - list, create, get, update, and delete services
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: list (list all services), create (create new service), get (get service by UUID), update (update service), delete (delete service) | |
| uuid | No | Service UUID (required for get, update, delete actions) | |
| name | No | Service name (required for create, optional for update) | |
| description | No | Service description (optional for create and update) | |
| server_uuid | No | Server UUID (required for create action) | |
| project_uuid | No | Project UUID (required for create action) | |
| environment_name | No | Environment name (required for create action) | |
| docker_compose_raw | No | Docker Compose configuration (required for create, optional for update) | |
| page | No | Page number (optional for list action) | |
| per_page | No | Items per page (optional for list action) |
Implementation Reference
- src/handlers.ts:364-399 (handler)Main handler function implementing CRUD operations for services (list, create, get, update, delete) using Coolify API client.async services(action: string, args: any) { switch (action) { case 'list': const queryString = this.apiClient.buildQueryString(args); const response = await this.apiClient.get(`/services?${queryString}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; case 'create': const createResponse = await this.apiClient.post('/services', { name: args.name, description: args.description, server_uuid: args.server_uuid, project_uuid: args.project_uuid, environment_name: args.environment_name, docker_compose_raw: args.docker_compose_raw, }); return { content: [{ type: 'text', text: JSON.stringify(createResponse.data, null, 2) }] }; case 'get': if (!args.uuid) throw new Error('Service UUID is required for get action'); const getResponse = await this.apiClient.get(`/services/${args.uuid}`); return { content: [{ type: 'text', text: JSON.stringify(getResponse.data, null, 2) }] }; case 'update': if (!args.uuid) throw new Error('Service UUID is required for update action'); const updateResponse = await this.apiClient.patch(`/services/${args.uuid}`, { name: args.name, description: args.description, docker_compose_raw: args.docker_compose_raw, }); return { content: [{ type: 'text', text: JSON.stringify(updateResponse.data, null, 2) }] }; case 'delete': if (!args.uuid) throw new Error('Service UUID is required for delete action'); await this.apiClient.delete(`/services/${args.uuid}`); return { content: [{ type: 'text', text: 'Service deleted successfully' }] }; default: throw new Error(`Unknown services action: ${action}`); } }
- src/tools.ts:558-608 (schema)Tool definition including name, description, and detailed input schema for validating parameters across all CRUD actions.{ name: 'coolify_services', description: 'Service CRUD operations - list, create, get, update, and delete services', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['list', 'create', 'get', 'update', 'delete'], description: 'Action to perform: list (list all services), create (create new service), get (get service by UUID), update (update service), delete (delete service)' }, uuid: { type: 'string', description: 'Service UUID (required for get, update, delete actions)' }, name: { type: 'string', description: 'Service name (required for create, optional for update)' }, description: { type: 'string', description: 'Service description (optional for create and update)' }, server_uuid: { type: 'string', description: 'Server UUID (required for create action)' }, project_uuid: { type: 'string', description: 'Project UUID (required for create action)' }, environment_name: { type: 'string', description: 'Environment name (required for create action)' }, docker_compose_raw: { type: 'string', description: 'Docker Compose configuration (required for create, optional for update)' }, page: { type: 'number', description: 'Page number (optional for list action)' }, per_page: { type: 'number', description: 'Items per page (optional for list action)' }, }, required: ['action'], }, },
- src/index.ts:128-129 (registration)Switch case in handleToolCall that registers and dispatches 'coolify_services' tool calls to the appropriate handler method.case 'coolify_services': return await this.handlers.services(args.action, args);