list-resources
Retrieve a detailed list of all resources managed by Coolify, including applications, services, databases, and deployments, using the MCP server for streamlined resource management.
Instructions
Retrieve a comprehensive list of all resources managed by Coolify. This includes applications, services, databases, and deployments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:149-157 (handler)The handler for the 'list-resources' tool. It calls the Coolify API endpoint '/resources' using the coolifyApiCall helper function and returns the JSON-formatted response as text content.case "list-resources": { const resources = await coolifyApiCall('/resources'); return { content: [{ type: "text", text: JSON.stringify(resources, null, 2) }] }; }
- src/index.ts:83-87 (registration)Registration of the 'list-resources' tool within the ListTools response handler. Defines the tool name, description, and empty input schema (no parameters required).{ name: "list-resources", description: "Retrieve a comprehensive list of all resources managed by Coolify. This includes applications, services, databases, and deployments.", inputSchema: zodToJsonSchema(z.object({})), },
- src/index.ts:86-86 (schema)Input schema for the 'list-resources' tool: an empty object schema (z.object({})), indicating no input parameters are required.inputSchema: zodToJsonSchema(z.object({})),
- src/index.ts:24-47 (helper)Helper function 'coolifyApiCall' used by the 'list-resources' handler (and other tools) 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(); }