Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_tasks

Retrieve tasks from an Apache Airflow DAG to manage workflow execution and monitor task status.

Instructions

Get tasks for DAG

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
order_byNo

Implementation Reference

  • The async handler function implementing the 'get_tasks' MCP tool. It accepts a dag_id (required) and optional order_by, calls the Airflow DAGApi.get_tasks, and returns the response as TextContent.
    async def get_tasks( dag_id: str, order_by: Optional[str] = None ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: kwargs = {} if order_by is not None: kwargs["order_by"] = order_by response = dag_api.get_tasks(dag_id=dag_id, **kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The registration tuple for the 'get_tasks' tool within the get_all_functions() list returned from dag.py. This tuple (function, name, description, read_only) is used by src/main.py to register the tool with the MCP server.
    (get_tasks, "get_tasks", "Get tasks for DAG", True),
  • src/main.py:86-97 (registration)
    The code in main.py that imports get_all_functions from dag.py (via line 8), calls it for APIType.DAG, and registers each tool (including get_tasks) with the FastMCP app using Tool.from_function and app.add_tool.
    try: functions = get_function() except NotImplementedError: continue # Filter functions for read-only mode if requested if read_only: functions = filter_functions_for_read_only(functions) for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))

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/yangkyeongmo/mcp-server-apache-airflow'

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