Skip to main content
Glama

get_incident

Read-onlyIdempotent

Retrieve the full evidence behind one incident from a completed patrol to explain why a partition was auto-fixed or escalated and show the user what to review.

Instructions

Return the full evidence behind one incident from a patrol that has already run.

Use this after a patrol tool (patrol_duckdb, patrol_files, patrol_snowflake, patrol_dbt) or run_demo, when you need to explain why a partition was
auto-fixed or escalated, or to show the user what to review. A patrol records at most one incident per
partition, so the folder plus the partition date identifies it. Do not call it before a patrol.

Behavior: read-only. It reads audit.jsonl in out_dir and changes nothing; no network calls, returns
immediately, and the result is one record of a few kilobytes. Fails with a readable error if the
folder has no audit.jsonl (run a patrol first) or no incident exists for that partition.

Returns one record with: partition, detectors (the problems found), decision, context (row counts and
amounts for the day and for each segment, next to the source's control totals), candidates (every fix
that was tried, with whether it kept the invariants and the residual gap it left) and chosen (the
best-supported candidate).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "out_dir": "<out_dir>",
      "partition": "<partition>"
    },
    "name": "get_incident"
  }
}

Input Schema

NameRequiredDescriptionDefault
out_dirYesThe outputs.folder value returned by a patrol tool or run_demo.
partitionYesWhich incident: the partition date as YYYY-MM-DD, copied from an incident's 'partition' field, or 'table-level' for a problem with the whole table such as a schema change.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • changedInput schema / properties / out_dir / description
      Previous value: -"The outputs.folder value returned by patrol_duckdb, patrol_files or run_demo."New value: +"The outputs.folder value returned by a patrol tool or run_demo."
  2. Changed3 schema fields changedv0.4.2
    • addedInput schema / properties / out_dir / description
      Added value: +"The outputs.folder value returned by patrol_duckdb, patrol_files or run_demo."
    • addedInput schema / properties / partition / description
      Added value: +"Which incident: the partition date as YYYY-MM-DD, copied from an incident's 'partition' field, or 'table-level' for a problem with the whole table such as a schema change."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "get_incidentDictOutput",
      +  "type": "object"
      +}
  3. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: it discloses that the tool reads audit.jsonl in out_dir, touches nothing else, makes no network calls, returns immediately, and produces a few-kilobyte record. It also documents failure modes ('fails with a readable error if the folder has no audit.jsonl... or no incident exists for that partition'), which annotations cannot convey.

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 core action, then usage, then behavior, then return shape — a sensible order with no filler sentences. Minor deduction for a line break splitting a sentence ('why a partition was / auto-fixed') and for a return-value paragraph that partly duplicates the existing output schema.

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 two-parameter read tool, the description covers prerequisites, key uniqueness, failure conditions, and the contents of the returned record. Even though an output schema exists, the summary of fields (detectors, decision, context, candidates, chosen) helps the agent explain the evidence to a user.

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 100%, so the baseline is 3, but the description adds a genuine constraint: a patrol records at most one incident per partition, so 'the folder plus the partition date identifies it.' That explains the key's uniqueness, which the schema does not say. It does not restate the 'table-level' sentinel, which the schema already covers.

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: 'Return the full evidence behind one incident from a patrol that has already run.' The scoping phrase 'from a patrol that has already run' immediately separates it from the patrol_* siblings, which produce the artifacts this tool consumes.

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?

Explicitly names the preceding tools (patrol_duckdb, patrol_files, patrol_snowflake, patrol_dbt, run_demo), the situations that call for it (explaining an auto-fix or escalation, showing the user what to review), and a hard exclusion: 'Do not call it before a patrol.' Both when and when-not are covered.

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