system
Manage Coolify deployments by checking system health, controlling API access, viewing resources, and retrieving version information through programmatic operations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Operation to perform |
Implementation Reference
- src/mcp/tools/system.ts:14-36 (handler)The core handler function for the 'system' tool that performs different system operations by calling generated API functions wrapped in 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)Registers the MCP tool named 'system' with input schema using Zod for the 'operation' parameter and a wrapper that calls systemHandler, formats output as MCP content.// 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:10-12 (schema)TypeScript interface defining the input arguments for the systemHandler, matching the operations used in the switch statement.interface SystemToolArgs { operation: string; }
- src/cli/commands/system.ts:5-22 (registration)Registers CLI commands under 'system' that use the systemHandler (note: uses 'info' operation which may not match MCP enums). Called from src/cli/index.ts.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); } }); }