system
Check Coolify system version and health, enable or disable API access, and list available resources using system operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Operation to perform |
Implementation Reference
- src/mcp/tools/system.ts:14-36 (handler)The systemHandler function that executes the 'system' tool logic. It dispatches operations (version, health, enable_api, disable_api, resources) by calling the corresponding generated SDK functions via safeApiCall.
export async function systemHandler(args: SystemToolArgs) { const { operation } = args; switch (operation) { case 'version': return await safeApiCall(() => version()); case 'health': return await safeApiCall(() => healthcheck()); case 'enable_api': return await safeApiCall(() => enableApi()); case 'disable_api': return await safeApiCall(() => disableApi()); case 'resources': return await safeApiCall(() => listResources()); default: throw new Error(`Unknown operation: ${operation}`); } } - src/mcp-server.ts:335-366 (registration)Registration of the 'system' tool on the MCP server using server.tool('system', ...). Defines the Zod schema for the 'operation' parameter and wires up the handler that calls systemHandler.
// Register system tool with proper Zod schema format server.tool( 'system', { operation: z.enum([ 'version', 'health', 'enable_api', 'disable_api', 'resources' ]).describe("Operation to perform") }, async ({ operation }) => { try { console.error('System tool received args:', JSON.stringify({ operation }, null, 2)); const result = await systemHandler({ operation }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/mcp/tools/system.ts:38-52 (schema)The systemTool input schema definition with the 'operation' enum and the handler property. Defines the tool's name, description, and inputSchema with allowed operations.
export const systemTool = { name: "system_tool", description: "Access system-wide operations, health checks, and API management", inputSchema: { type: "object", properties: { operation: { type: "string", description: "Operation to perform", enum: ["version", "health", "enable_api", "disable_api", "resources"] } }, required: ["operation"] }, handler: systemHandler - src/cli/commands/system.ts:5-21 (registration)CLI registration of the 'system' command via Commander, calling systemHandler for the 'info' operation.
export function registerSystemCommands(program: Command) { const system = program.command('system') .description('System operations'); // Get system info system.command('info') .description('Get system information') .action(async () => { try { const result = await systemHandler({ operation: 'info' }); console.log(chalk.green('System Information:')); console.log(JSON.stringify(result.data, null, 2)); } catch (error: any) { console.error(chalk.red('Error:'), error.message); process.exit(1); } }); - src/core/api-wrapper.ts:7-13 (helper)The safeApiCall helper that wraps API calls with error handling, used by systemHandler to safely invoke SDK functions like version(), healthcheck(), etc.
export async function safeApiCall<T>(apiCall: () => Promise<T>): Promise<T> { try { return await apiCall(); } catch (error) { return handleApiError(error); } }