Skip to main content
Glama

trigger_auto_recovery

Automatically recover failed services by executing predefined playbooks based on specific failure types like crashes or health check failures.

Instructions

Trigger automatic recovery for a failed service using predefined playbooks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYesService that failed
failure_typeYesType of failure: 'crash', 'health_check_failed', 'deployment_failed'

Implementation Reference

  • Handler implementation for the 'trigger_auto_recovery' tool. Extracts input arguments and invokes the executeOrchestrator helper with the 'recovery/auto-recovery' operation.
    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; }
  • Input schema definition for the 'trigger_auto_recovery' tool, specifying required parameters service_name and failure_type.
    { 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"] } },
  • Shared helper function executeOrchestrator that all tools use to run external python orchestrator.py scripts, handling execution, JSON parsing, and error management.
    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() || "" }; } }
  • src/index.ts:182-184 (registration)
    Registration of the ListToolsRequestSchema handler, which returns the tools array containing 'trigger_auto_recovery'.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsablabla/lastrock-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server