create_dataset_event
Generate dataset events in Apache Airflow to trigger DAGs based on data availability, enabling automated workflow execution.
Instructions
Create dataset event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_uri | Yes | ||
| extra | No |
Implementation Reference
- src/airflow/dataset.py:106-117 (handler)The main handler function for the 'create_dataset_event' tool. It takes a dataset_uri and optional extra dict, constructs an event request, calls the Airflow dataset_api to create the event, and returns the response as text content.async def create_dataset_event( dataset_uri: str, extra: Optional[Dict[str, Any]] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: event_request = { "dataset_uri": dataset_uri, } if extra is not None: event_request["extra"] = extra response = dataset_api.create_dataset_event(create_dataset_event=event_request) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/dataset.py:16-19 (registration)Registration entry for the 'create_dataset_event' tool within the get_all_functions() list, specifying the function, name, description, and read-only status (False). This list is imported and used in src/main.py to add the tools to the MCP server.(get_dataset_events, "get_dataset_events", "Get dataset events", True), (create_dataset_event, "create_dataset_event", "Create dataset event", False), (get_dag_dataset_queued_event, "get_dag_dataset_queued_event", "Get a queued Dataset event for a DAG", True), (get_dag_dataset_queued_events, "get_dag_dataset_queued_events", "Get queued Dataset events for a DAG", True),