Skip to main content
Glama

list_tasks

Retrieve all tasks from a specific Apache Airflow DAG to inspect workflow components and monitor task execution status.

Instructions

[Tool Role]: Lists all tasks within the specified DAG.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes

Implementation Reference

  • The core handler function for the 'list_tasks' tool. Decorated with @mcp.tool(), it fetches and returns all tasks for the specified DAG ID using the Airflow REST API endpoint /dags/{dag_id}/tasks.
    @mcp.tool() async def list_tasks(dag_id: str) -> Dict[str, Any]: """[Tool Role]: Lists all tasks within the specified DAG.""" if not dag_id: raise ValueError("dag_id must not be empty") resp = await airflow_request("GET", f"/dags/{dag_id}/tasks") resp.raise_for_status() return resp.json()
  • v1 API version registration: configures the airflow_request function for v1 API and invokes register_common_tools(mcp), which executes the code defining the @mcp.tool()-decorated list_tasks handler.
    # 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)
  • v2 API version registration: configures the airflow_request function for v2 API and invokes register_common_tools(mcp), which executes the code defining the @mcp.tool()-decorated list_tasks handler.
    # 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)

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