Skip to main content
Glama
astronomer

astro-airflow-mcp

Official
by astronomer

get_task_logs

Retrieve execution logs for specific Airflow tasks to debug failures, view output, and analyze performance during workflow runs.

Instructions

Get logs for a specific task instance execution.

Use this tool when the user asks about:

  • "Show me the logs for task X" or "Get logs for task Y"

  • "What did task Z output?" or "Show me task execution logs"

  • "Why did task A fail?" (to see error messages in logs)

  • "What happened during task B execution?"

  • "Show me the stdout/stderr for task C"

  • "Debug task D" or "Troubleshoot task E"

Returns the actual log output from the task execution, which includes:

  • Task execution output (stdout/stderr)

  • Error messages and stack traces (if task failed)

  • Timing information

  • Any logged messages from the task code

This is essential for debugging failed tasks or understanding what happened during task execution.

Args: dag_id: The ID of the DAG (e.g., "example_dag") dag_run_id: The ID of the DAG run (e.g., "manual__2024-01-01T00:00:00+00:00") task_id: The ID of the task within the DAG (e.g., "extract_data") try_number: The task try/attempt number, 1-indexed (default: 1). Use higher numbers to get logs from retry attempts. map_index: For mapped tasks, which map index to get logs for. Use -1 for non-mapped tasks (default: -1).

Returns: JSON with the task logs content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
task_idYes
try_numberNo
map_indexNo

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/astronomer/astro-airflow-mcp'

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