trigger_auto_recovery
Initiate automatic recovery for failed services using predefined playbooks based on service name and failure type.
Instructions
Trigger automatic recovery for a failed service using predefined playbooks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service_name | Yes | Service that failed | |
| failure_type | Yes | Type of failure: 'crash', 'health_check_failed', 'deployment_failed' |
Implementation Reference
- src/index.ts:264-275 (handler)Handler for the trigger_auto_recovery tool. Extracts service_name and failure_type arguments and invokes executeOrchestrator with operation 'recovery/auto-recovery'.case "trigger_auto_recovery": { const { service_name, failure_type } = args as { service_name: string; failure_type: string; }; result = executeOrchestrator("recovery/auto-recovery", { service_name, failure_type }); break; }
- src/index.ts:134-147 (schema)Input schema for trigger_auto_recovery tool, defining required string properties service_name and failure_type.inputSchema: { type: "object", properties: { service_name: { type: "string", description: "Service that failed" }, failure_type: { type: "string", description: "Type of failure: 'crash', 'health_check_failed', 'deployment_failed'" } }, required: ["service_name", "failure_type"] }
- src/index.ts:131-148 (registration)Registration of the trigger_auto_recovery tool in the tools array, including name, description, and input schema.{ name: "trigger_auto_recovery", description: "Trigger automatic recovery for a failed service using predefined playbooks.", inputSchema: { type: "object", properties: { service_name: { type: "string", description: "Service that failed" }, failure_type: { type: "string", description: "Type of failure: 'crash', 'health_check_failed', 'deployment_failed'" } }, required: ["service_name", "failure_type"] } },
- src/index.ts:16-43 (helper)Shared helper function executeOrchestrator used by all tools, including trigger_auto_recovery, to run orchestrator.py with given operation and parameters.function executeOrchestrator(operation: string, params: Record<string, string> = {}): any { const paramStr = Object.entries(params) .map(([key, value]) => `${key}="${value}"`) .join(" "); const cmd = `cd ${ORCHESTRATOR_PATH} && python orchestrator.py ${operation} ${paramStr}`; try { const output = execSync(cmd, { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }); // Try to parse as JSON, fallback to plain text try { return JSON.parse(output); } catch { return { output: output.trim() }; } } catch (error: any) { return { success: false, error: error.message, stderr: error.stderr?.toString() || "", stdout: error.stdout?.toString() || "" }; } }