Skip to main content
Glama

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
NameRequiredDescriptionDefault
service_nameYesService that failed
failure_typeYesType of failure: 'crash', 'health_check_failed', 'deployment_failed'

Implementation Reference

  • 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;
    }
  • 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"]
      }
    },
  • 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() || ""
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'automatic recovery' and 'predefined playbooks,' but does not disclose critical behavioral traits such as whether this is a read-only or destructive operation, what permissions are required, potential side effects, or how recovery is executed. This is inadequate for a tool that likely involves system changes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('trigger automatic recovery') without unnecessary words. Every part earns its place by specifying the target and mechanism concisely.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a recovery tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects like safety, permissions, or what happens post-recovery, which are crucial for an agent to use this tool correctly in an infrastructure context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the two parameters. The description does not add any meaning beyond the schema, such as explaining how 'service_name' and 'failure_type' interact with playbooks. Baseline 3 is appropriate as the schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('trigger automatic recovery') and target ('for a failed service'), specifying the mechanism ('using predefined playbooks'). It distinguishes from siblings like 'restart_service' by emphasizing automation and playbooks, though it could be more specific about what 'automatic recovery' entails compared to manual alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a service has failed, based on 'failed service,' but does not explicitly state when to use this tool versus alternatives like 'restart_service' or 'check_services_health.' No exclusions or prerequisites are mentioned, leaving usage context somewhat vague.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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