list_event_logs
Retrieve Airflow event logs to monitor DAG executions and task performance. Filter by DAG ID and paginate results for focused troubleshooting.
Instructions
[Tool Role]: Lists event logs from Airflow.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | No | ||
| limit | No | ||
| offset | No |
Implementation Reference
- The core handler function implementing the list_event_logs tool. Queries the Airflow eventLogs API endpoint with optional dag_id filter and pagination (limit/offset). Returns JSON response from the API.async def list_event_logs(dag_id: Optional[str] = None, limit: int = 20, offset: int = 0) -> Dict[str, Any]: """[Tool Role]: Lists event logs from Airflow.""" params = {'limit': limit, 'offset': offset} if dag_id: params['dag_id'] = dag_id query_string = "&".join([f"{k}={v}" for k, v in params.items()]) resp = await airflow_request("GET", f"/eventLogs?{query_string}") resp.raise_for_status() return resp.json()
- src/mcp_airflow_api/tools/v1_tools.py:13-28 (registration)Registration entry point for v1 API tools. Sets v1-specific airflow_request function and calls register_common_tools(mcp), which registers list_event_logs among other common tools.def register_tools(mcp): """Register v1 tools by importing common tools with v1 request function.""" logger.info("Initializing MCP server for Airflow API v1") logger.info("Loading Airflow API v1 tools (Airflow 2.x)") # Set the global request function to v1 common_tools.airflow_request = airflow_request_v1 # Register all 56 common tools (includes management tools) common_tools.register_common_tools(mcp) # V1 has no exclusive tools - all tools are shared with v2 logger.info("Registered all Airflow API v1 tools (56 tools: 43 core + 13 management tools)")
- src/mcp_airflow_api/tools/v2_tools.py:14-25 (registration)Registration entry point for v2 API tools. Sets v2-specific airflow_request function and calls register_common_tools(mcp), which registers list_event_logs among other common tools.def register_tools(mcp): """Register v2 tools: common tools + v2-exclusive asset tools.""" logger.info("Initializing MCP server for Airflow API v2") logger.info("Loading Airflow API v2 tools (Airflow 3.0+)") # Set the global request function to v2 common_tools.airflow_request = airflow_request_v2 # Register all 43 common tools common_tools.register_common_tools(mcp)