Skip to main content
Glama

get_task_instance_logs

Retrieve execution logs for a specific Airflow task instance to monitor performance, debug failures, and analyze task behavior during DAG runs.

Instructions

[Tool Role]: Retrieves logs for a specific task instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
task_idYes
try_numberNo

Implementation Reference

  • The core handler function implementing the get_task_instance_logs tool. It makes an API request to retrieve logs for a specific task instance try_number from the Airflow API. The @mcp.tool() decorator handles registration.
    async def get_task_instance_logs(dag_id: str, dag_run_id: str, task_id: str, try_number: int = 1) -> Dict[str, Any]: """[Tool Role]: Retrieves logs for a specific task instance.""" resp = await airflow_request("GET", f"/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{try_number}") resp.raise_for_status() return resp.json()

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/call518/MCP-Airflow-API'

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