coolify_database_lifecycle
Manage database states by starting, stopping, or restarting databases using their unique identifiers within the Coolify infrastructure platform.
Instructions
Database lifecycle management - start, stop, and restart databases
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: start (start database), stop (stop database), restart (restart database) | |
| uuid | Yes | Database UUID (required for all actions) |
Implementation Reference
- src/handlers.ts:276-292 (handler)The handler function that executes the tool logic for starting, stopping, or restarting a database using Coolify API endpoints.async databaseLifecycle(action: string, uuid: string) { if (!uuid) throw new Error('Database UUID is required for all lifecycle actions'); switch (action) { case 'start': const startResponse = await this.apiClient.post(`/databases/${uuid}/start`); return { content: [{ type: 'text', text: JSON.stringify(startResponse.data, null, 2) }] }; case 'stop': const stopResponse = await this.apiClient.post(`/databases/${uuid}/stop`); return { content: [{ type: 'text', text: JSON.stringify(stopResponse.data, null, 2) }] }; case 'restart': const restartResponse = await this.apiClient.post(`/databases/${uuid}/restart`); return { content: [{ type: 'text', text: JSON.stringify(restartResponse.data, null, 2) }] }; default: throw new Error(`Unknown database lifecycle action: ${action}`); } }
- src/tools.ts:408-426 (schema)Input schema defining the parameters for the coolify_database_lifecycle tool: action (start/stop/restart) and uuid.{ name: 'coolify_database_lifecycle', description: 'Database lifecycle management - start, stop, and restart databases', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['start', 'stop', 'restart'], description: 'Action to perform: start (start database), stop (stop database), restart (restart database)' }, uuid: { type: 'string', description: 'Database UUID (required for all actions)' }, }, required: ['action', 'uuid'], }, },
- src/index.ts:116-117 (registration)The switch case that registers and dispatches to the databaseLifecycle handler for this tool.case 'coolify_database_lifecycle': return await this.handlers.databaseLifecycle(args.action, args.uuid);