get_dataset
Retrieve a dataset from a specified URI using the MCP Server for Apache Airflow, enabling efficient data access within Airflow workflows.
Instructions
Get a dataset by URI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes |
Implementation Reference
- src/airflow/dataset.py:66-70 (handler)The core handler function implementing the 'get_dataset' tool logic. It calls the Airflow DatasetApi to retrieve a dataset by URI and returns the response as formatted text content.async def get_dataset( uri: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = dataset_api.get_dataset(uri=uri) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/dataset.py:11-39 (registration)Module-level function that returns the list of tool registrations, including the specific tuple for 'get_dataset'.def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (get_datasets, "get_datasets", "List datasets", True), (get_dataset, "get_dataset", "Get a dataset by URI", True), (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), ( delete_dag_dataset_queued_event, "delete_dag_dataset_queued_event", "Delete a queued Dataset event for a DAG", False, ), ( delete_dag_dataset_queued_events, "delete_dag_dataset_queued_events", "Delete queued Dataset events for a DAG", False, ), (get_dataset_queued_events, "get_dataset_queued_events", "Get queued Dataset events for a Dataset", True), ( delete_dataset_queued_events, "delete_dataset_queued_events", "Delete queued Dataset events for a Dataset", False, ), ]
- src/main.py:95-96 (registration)The loop in main.py where tools from get_dataset_functions (including get_dataset) are registered with the MCP server using app.add_tool.for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))
- src/airflow/dataset.py:8-8 (helper)Initialization of the DatasetApi client instance used by the get_dataset handler.dataset_api = DatasetApi(api_client)
- src/main.py:30-30 (registration)Mapping of APIType.DATASET to get_dataset_functions in main.py, which leads to loading the get_dataset tool.APIType.DATASET: get_dataset_functions,