Skip to main content
Glama
astronomer

astro-airflow-mcp

Official
by astronomer

get_task_logs

Retrieve logs for a specific task execution. View stdout, stderr, error messages, and timing info to debug failures. Specify DAG, run, task, try number, and map index.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It describes the return values (stdout/stderr, errors, timing), giving good behavioral insight. It does not explicitly state no side effects or authorization needs, but for a read-only log tool this is acceptable.

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 a clear lead sentence, bulleted usage examples, and an Args list. It is slightly verbose with the example queries, but remains clear and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters (3 required) and no annotations, the description covers all necessary aspects: what the tool returns, parameter semantics, and usage context. It does not discuss potential errors or performance, but is complete enough for typical log retrieval.

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?

Schema description coverage is 0%, but the description provides detailed, example-rich explanations for all 5 parameters (e.g., try_number: '1-indexed, use higher numbers for retries'). This adds significant value 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 tool's verb ('Get logs') and resource ('task instance execution'). It differentiates from siblings like get_task_instance by focusing on logs, and provides user query examples that match the tool's function.

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

Usage Guidelines4/5

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

The description explicitly lists when to use the tool with specific user queries (e.g., 'Show me the logs for task X'). It does not state when not to use it or mention alternatives, but the context (sibling tools) and the examples implicitly provide guidance.

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

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