Skip to main content
Glama

get_task_log

Retrieve Airflow task logs to diagnose pipeline failures and extract EMR Serverless application or job IDs for debugging.

Instructions

Read the Airflow log for a specific task attempt.

IMPORTANT for EMR debugging:

  • Read the 'initialise' (or 'ae_initialize_emr_application') task log to find the EMR application ID. Look for: 'EMR serverless application created: 00gXXXXXXXXX' or 'Created EMR application 00gXXXXXXXXX'.

  • Read the failed processing task log to find the job_run_id. Look for: 'EMR serverless job started: 00gXXXXXXXXX'.

  • Then use read_spark_driver_log(application_id, job_run_id, log_type='stdout') to get the Python app output.

Args: dag_id: The DAG identifier. dag_run_id: The run ID. task_id: The task identifier. env: Target environment — 'dev', 'uat', 'test', or 'prod'. IMPORTANT: Do NOT guess or default. Ask the user which environment if not specified. try_number: Which attempt (default 1). tail_lines: Number of lines to return from the end (default 200).

Returns the raw log text, trimmed to the last N lines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
task_idYes
envNo
try_numberNo
tail_linesNo

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 key behaviors: it's a read operation (implied by 'Read'), returns raw log text trimmed to the last N lines, and includes important constraints like not guessing the 'env' parameter. However, it doesn't mention potential errors, rate limits, or authentication needs.

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?

The description is well-structured with clear sections (purpose, important notes, args, returns) and uses bullet points for readability. While slightly longer due to detailed examples, every sentence adds value (e.g., EMR debugging steps, parameter warnings). Minor trimming could improve conciseness without losing clarity.

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?

Given the tool's complexity (6 parameters, 0% schema coverage, no annotations) and the presence of an output schema, the description is highly complete. It covers purpose, usage guidelines, parameter semantics, and behavioral aspects like output trimming. The output schema handles return values, so the description appropriately focuses on context and usage.

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?

The schema description coverage is 0%, so the description must fully compensate. It successfully adds meaning for all parameters: explains 'dag_id', 'dag_run_id', and 'task_id' as identifiers; details 'env' options and critical usage warning; clarifies 'try_number' as attempt count with default; and specifies 'tail_lines' as number of lines from the end with default. This goes well beyond the bare schema.

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 clearly states the specific action ('Read the Airflow log for a specific task attempt') and resource ('Airflow log'), distinguishing it from siblings like 'read_spark_driver_log' or 'get_dag_run_details'. It precisely defines the tool's function without tautology.

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, including specific examples for EMR debugging (e.g., to find EMR application IDs or job_run_ids). It also names an alternative tool ('read_spark_driver_log') for further steps, clearly differentiating use cases.

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