Skip to main content
Glama

restart_loop_rca

Read-only

Detect crash-looping Docker containers by restart count, exit code, or OOMKilled status, then map each to a likely cause and recommended action with log tails.

Instructions

[READ] Find crash-looping containers and map each to a cause + action.

The flagship restart RCA: inspects containers for restart count + exit code, flags the crash-looping ones (restartCount >= threshold, or restarting/dead, or a non-zero exit), attaches a likely cause + recommended action from the exit code (137 OOM/SIGKILL, 143 SIGTERM, 139 segfault, 127 bad entrypoint, …), and a tail of logs. Every ranking carries its numbers. Pass 'containers' for pure analysis, or a target to pull live.

Args: restart_threshold: Restart count at/above which a container is looping (default 3). containers: Injected rows {id, name, state, restartCount, exitCode, oomKilled, error}; skips live collection. logs_by_id: Optional {containerId: [logLine, ...]} log tails to attach. target: Target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
targetNo
containersNo
logs_by_idNo
restart_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true. The description adds rich behavioral detail: it inspects restart count + exit code, flags containers by restartCount >= threshold or restarting/dead or non-zero exit, maps exit codes to causes (137 OOM/SIGKILL, 143 SIGTERM, 139 segfault, 127 bad entrypoint), attaches log tails, and notes every ranking carries its numbers. This is substantial context beyond the annotation.

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

Conciseness4/5

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

Front-loaded with [READ] and purpose, then structured with an Args section. Information is mostly useful, but the phrase 'The flagship restart RCA' is promotional fluff. The description is appropriately sized for a complex diagnostic tool, though slightly verbose.

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

Completeness5/5

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

No output schema exists, but the description explains what is returned: flagged containers, attached cause/action, log tails, and numeric rankings. Combined with full parameter descriptions and the readOnly annotation, an agent has enough to call the tool correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must carry the burden. It documents all four parameters: restart_threshold with default and meaning, containers with nested fields and note that it skips live collection, logs_by_id with shape, and target as config name with omit-for-default semantics. This fully compensates for the schema gap.

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

Purpose5/5

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

States a specific verb and resource: 'Find crash-looping containers and map each to a cause + action.' It explains the inspection inputs (restart count, exit code), the flagging logic, and the outputs (cause, action, log tail), distinguishing itself from sibling action tools like restart_container. An agent can tell this is a diagnostic RCA tool.

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

Usage Guidelines4/5

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

Explains two operational modes: pass 'containers' for pure analysis or 'target' to pull live. This gives clear context for invocation. However, it does not explicitly name alternatives (e.g., restart_container) or state when not to use it, so it falls short of a 5.

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