Skip to main content
Glama

diagnose_dag_failure

Automatically diagnose failed Airflow DAG runs by identifying failed tasks, analyzing logs, extracting EMR application IDs, and providing root cause analysis in one step.

Instructions

One-shot diagnosis of a failed DAG run.

This tool does everything automatically:

  1. Finds the most recent failed run (today or specified date)

  2. Identifies which task(s) failed

  3. Reads the failed task logs

  4. Extracts EMR application ID from the 'initialise' task

  5. Reads the Spark driver logs (stdout) for Python app errors

  6. Returns a complete failure analysis

This replaces the need to call 5-6 tools manually.

Args: dag_id: The DAG to diagnose (e.g. 'ttdcustom_processing'). env: Target environment — 'dev', 'uat', 'test', or 'prod'. IMPORTANT: Do NOT guess or default. Ask the user which environment if not specified. date: Optional date to check (ISO format or 'yesterday'). Default: today.

Returns a comprehensive failure report with root cause analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
envNo
dateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's automated workflow (steps 1-6), including that it reads logs and extracts IDs, which clarifies its read-only, analytical nature. However, it lacks details on potential side effects, error handling, or performance characteristics like rate limits, leaving some behavioral aspects unclear.

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 efficiently structured with a clear purpose statement, a numbered list of automated steps, and separate sections for arguments and returns. Every sentence adds value, such as the sibling tool comparison and parameter warnings, with no redundant or verbose content, making it highly readable and informative.

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 diagnostic tool with 3 parameters, 0% schema coverage, no annotations, but an output schema, the description is complete. It covers the tool's purpose, usage guidelines, parameter semantics, and behavioral workflow. Since an output schema exists, it appropriately omits detailed return value explanations, focusing on the 'comprehensive failure report with root cause analysis.'

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?

Given 0% schema description coverage, the description fully compensates by explaining all three parameters: 'dag_id' is described with an example, 'env' specifies allowed values and critical usage instructions, and 'date' clarifies format and default behavior. This adds essential meaning beyond the bare schema, ensuring parameters are well-understood.

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 explicitly states the tool's purpose as 'One-shot diagnosis of a failed DAG run' and details the six specific automated steps it performs. It clearly distinguishes this from sibling tools by noting it 'replaces the need to call 5-6 tools manually,' making its comprehensive diagnostic function distinct from simpler tools like get_dag_run_details or get_task_log.

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?

The description provides explicit guidance on when to use this tool versus alternatives: it should be used for comprehensive failure analysis instead of manually calling multiple tools. It also includes important usage constraints, such as the warning not to guess or default the 'env' parameter and to ask the user if unspecified, ensuring correct application.

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/SrujanReddyKallu2024/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server