Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_dataset_events

Retrieve dataset events in Apache Airflow by specifying filters like dataset ID, DAG, task, or run details. Supports pagination and sorting for efficient data extraction.

Instructions

Get dataset events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_idNo
limitNo
offsetNo
order_byNo
source_dag_idNo
source_map_indexNo
source_run_idNo
source_task_idNo

Implementation Reference

  • The async handler function implementing the core logic of the 'get_dataset_events' tool. It accepts optional parameters, builds a kwargs dict, calls the Airflow DatasetApi.get_dataset_events, and returns the response serialized as TextContent.
    async def get_dataset_events( limit: Optional[int] = None, offset: Optional[int] = None, order_by: Optional[str] = None, dataset_id: Optional[int] = None, source_dag_id: Optional[str] = None, source_task_id: Optional[str] = None, source_run_id: Optional[str] = None, source_map_index: Optional[int] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: # Build parameters dictionary kwargs: Dict[str, Any] = {} if limit is not None: kwargs["limit"] = limit if offset is not None: kwargs["offset"] = offset if order_by is not None: kwargs["order_by"] = order_by if dataset_id is not None: kwargs["dataset_id"] = dataset_id if source_dag_id is not None: kwargs["source_dag_id"] = source_dag_id if source_task_id is not None: kwargs["source_task_id"] = source_task_id if source_run_id is not None: kwargs["source_run_id"] = source_run_id if source_map_index is not None: kwargs["source_map_index"] = source_map_index response = dataset_api.get_dataset_events(**kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Tuple defining the tool for registration: (function, name, description, is_read_only).
    (get_dataset_events, "get_dataset_events", "Get dataset events", True),
  • src/main.py:95-96 (registration)
    Registers the tool with the MCP server using app.add_tool after collecting functions from dataset module.
    for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))
  • src/main.py:11-11 (registration)
    Imports the get_all_functions from dataset.py to collect the tool definitions.
    from src.airflow.dataset import get_all_functions as get_dataset_functions

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