list-databases
Retrieve a comprehensive list of all databases managed by Coolify, offering an organized overview of active database instances for streamlined management.
Instructions
Fetch a list of all databases managed by Coolify. This provides an overview of all database instances.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:234-242 (handler)Handler for the list-databases tool. Fetches the list of databases from the Coolify API endpoint '/databases' and returns the result as formatted JSON text.case "list-databases": { const databases = await coolifyApiCall('/databases'); return { content: [{ type: "text", text: JSON.stringify(databases, null, 2) }] }; }
- src/index.ts:118-122 (registration)Registration of the list-databases tool in the ListTools response. Defines the tool name, description, and empty input schema (no parameters required).{ name: "list-databases", description: "Fetch a list of all databases managed by Coolify. This provides an overview of all database instances.", inputSchema: zodToJsonSchema(z.object({})), },
- src/index.ts:121-121 (schema)Input schema for list-databases tool: empty object (no input parameters).inputSchema: zodToJsonSchema(z.object({})),
- src/index.ts:24-47 (helper)Shared helper function used by the list-databases handler (and others) to make authenticated HTTP requests to the Coolify API.async function coolifyApiCall(endpoint: string, method: string = 'GET', body?: any): Promise<any> { const baseUrl = process.env.COOLIFY_BASE_URL?.replace(/\/$/, '') || 'https://coolify.stuartmason.co.uk'; const url = `${baseUrl}/api/v1${endpoint}`; const response = await fetch(url, { method, headers: { 'Authorization': `Bearer ${process.env.COOLIFY_ACCESS_TOKEN}`, 'Content-Type': 'application/json', }, body: body ? JSON.stringify(body) : undefined, }); if (!response.ok) { const errorBody = await response.json().catch(() => ({})); throw new Error(JSON.stringify({ error: `Coolify API error: ${response.status} ${response.statusText}`, status: response.status, details: errorBody })); } return await response.json(); }