Skip to main content
Glama

Diagnose an incident

get_incident_diagnosis
Read-onlyIdempotent

Diagnose a monitor incident by reading what changed around the failure—state, reason, per-region baseline and findings—before fetching raw checks or incident details.

Instructions

Read what changed around a monitor incident, computed from the checks Fettle already holds. Start here for a DOWN monitor's open incident (its id from list_incidents with monitor_id and status "open") or a pasted alert, before get_incident or list_check_results. Returns incident_id, state, reason, summary (one line) and diagnosis (window, per-region baseline and state, layer, platform and findings, each with kind, rank, regions and facts) and agent (layer, window with last_good_at, first_bad_at and onset_at, repro: a shell command that repeats the probe from the current config, plus check_target with the type, target and non-secret config to send to check_target; and next_calls: up to three tool calls with ready arguments, to follow in order). The command hides header values (), the body (read from body.txt), the target's userinfo, token-like path segments and the values of query parameters named like key, token, secret, sig, password, pass, auth, credential or session (), and drops the fragment; check_target leaves the userinfo and those query values out, so for such a target take the full one from get_monitor. check_target and check_now need the write scope. agent is null when the monitor was deleted; repro is null when no command fits (a TCP monitor without a port). A deploy recorded with record_deploy for this monitor up to 2 h before the onset is the finding DEPLOY_BEFORE_ONSET (minutes_before_onset); on RECOVERY, one between the outage start and the first green check is DEPLOY_DURING_OUTAGE; its ref and compare_url are in diagnosis.context.suspect_deploy and next_calls then offers verify_deploy. A deploy close in time is not proof it caused the failure. These are observations, not proven causes: say what was seen, not why. state READY has summary, diagnosis and agent (see above); PENDING means it is still being computed (ask again in a minute); a READY RECOVERY answer with refinement_pending true has no verdict yet on slower responses (RECOVERED_SLOWER needs the 10 minutes after the first green check and lands about 12 minutes after the resolve; ask again then, and a minute later while refinement_pending is still true); UNAVAILABLE has a reason: NOT_APPLICABLE (a heartbeat has no probes), NOT_COMPUTED (none will come) or NOT_RESOLVED (RECOVERY asked of an open incident). Ignore finding kinds and fields you do not know. HTTP detail depends on diagnosis.detail_level: BASIC has no redirect, final-URL, TLS or header-change findings; the edge-block and PLATFORM_ERROR findings need only the first failed check's details. platform and PLATFORM_ERROR are hints from response headers, not causes. For raw checks use list_check_results, for the incident row and alerts get_incident.

Input Schema

NameRequiredDescriptionDefault
phaseNoOPEN (default): what changed when it failed. RECOVERY: what changed when it came back (how each region recovered, slower responses, a new DNS answer or certificate, a deploy during the outage); PENDING for a few minutes after the resolve. Anything else is a 422.
incident_idYesThe incident's uuid from list_incidents. An id that is not an incident of this organization is a 404.

Output Schema

NameRequiredDescriptionDefault
agentNo
stateYesKnown values: READY, PENDING, UNAVAILABLE.
reasonNo
summaryNo
diagnosisNo
incident_idYes
refinement_pendingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the read-only annotations, the description discloses that results are observations rather than proven causes, explains READY/PENDING/UNAVAILABLE states, nullability for agent and repro, redaction behavior, write scope needed by suggested calls, deploy findings, and detail_level effects. This is unusually rich behavioral context with no contradiction of annotations.

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

Conciseness3/5

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

The opening sentence and routing are front-loaded and useful, but the description becomes a long, dense paragraph with many nested parenthetical details. The information is relevant, yet the structure would be much easier to scan as short sections or bullets.

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?

For a complex diagnosis tool, the description covers the important output states, nullable fields, redaction behavior, suggested next calls, deploy-related findings, and detail-level limitations. Together with the output schema and annotations, an agent has enough context to call and interpret it correctly.

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%, and the description adds only modest parameter-specific context by clarifying that incident_id comes from an open DOWN monitor incident in list_incidents. The phase semantics are already largely documented in the schema, so the baseline 3 is appropriate.

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?

The description states a specific verb and resource: read what changed around a monitor incident, computed from existing checks. It distinguishes itself from siblings by naming get_incident and list_check_results and telling the agent to start here for an open DOWN incident or pasted alert.

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

Usage Guidelines5/5

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

It gives explicit when-to-use guidance: use this first for a DOWN monitor's open incident or a pasted alert, before get_incident or list_check_results. It also routes the agent elsewhere for raw checks and for the incident row and alerts, leaving little ambiguity.

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