Skip to main content
Glama

error_rate_rca

Read-only

Rank services by 5xx share versus the fleet baseline, flag elevated error rates, and map dominant status codes to causes and remediation actions.

Instructions

[READ] Rank services by 5xx share vs the fleet baseline, cause + action.

The flagship error RCA: reads per-service status-code counters (traefik /metrics, haproxy stats), flags services whose 5xx rate crosses the threshold with enough traffic, and maps the dominant code to a cause (503 no-upstream / 502 conn-fail / 504 timeout / 500 app error). Every entry carries its numbers and its multiple vs the fleet baseline. Pass 'counters' for pure analysis. caddy targets return the support matrix's teaching note (no per-route counters).

Args: error_rate_pct: 5xx %% at/above which a service is flagged (default 5.0). min_requests: Minimum requests before a service can be flagged (default 30). counters: Injected rows {service, total, codes:{...}} and/or classes:{"5xx": n}; skips the live pull. target: Proxy target name from config; omit for the default.

Returns dict: {servicesEvaluated, flaggedCount, fleetErrorRatePct, thresholds, flagged:[{service, requestsTotal, errors5xx, errorRatePct, dominantCode, vsBaselineX, severity, cause, action}], note}.

Input Schema

NameRequiredDescriptionDefault
targetNo
countersNo
min_requestsNo
error_rate_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.2/5.0
Behavior4/5

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

readOnlyHint already covers the safety profile, but the description adds real behavioral context: it reads traefik/haproxy counters, applies threshold+traffic gating, maps dominant codes to causes, and warns that caddy targets return only a teaching note. No return format gaps remain unexplained.

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 the read tag and one-line summary, then Args and Returns blocks. Some prose is dense but each section earns its place; nothing is redundant filler.

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?

With no output schema, the description fully specifies the return dict (servicesEvaluated, flaggedCount, fleetErrorRatePct, thresholds, flagged entries with cause/action/severity). Threshold defaults, injection mode, and the caddy limitation are all covered.

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

Parameters4/5

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

Schema coverage is 0%, so the description carries the burden and does so well: it documents error_rate_pct (default 5.0), min_requests (default 30), counters (injected rows with codes/classes), and target (proxy target from config). Semantics of each param are clear.

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 precise verb and resource ('Rank services by 5xx share vs the fleet baseline'), plus the diagnostic outputs (cause + action). The [READ] tag and 'flagship error RCA' framing make it easy to distinguish from raw-counter tools like error_counters.

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?

Provides the counters-injection path ('Pass counters for pure analysis') and the caddy caveat, but never states when to prefer this over sibling RCA tools such as backend_health_rca or error_counters. Usage is implied rather than explicit.

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