get_dataset
Retrieve details for a specific dataset in Apache Airflow using the v1 API. Provide the dataset URI to access its information directly.
Instructions
[Tool Role]: Gets details of a specific dataset (v1 API only - v2 uses Assets).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_uri | Yes |
Implementation Reference
- The main handler function for the 'get_dataset' tool, decorated with @mcp.tool() which registers it. Fetches specific dataset details via Airflow API v1 endpoint /datasets/{uri}, with v2 compatibility check.async def get_dataset(dataset_uri: str) -> Dict[str, Any]: """[Tool Role]: Gets details of a specific dataset (v1 API only - v2 uses Assets).""" from ..functions import get_api_version api_version = get_api_version() if api_version == "v2": return { "error": "Dataset API is not available in Airflow 3.x (API v2)", "available_in": "v1 only", "v2_alternative": "Use Assets API for Airflow 3.x data-aware scheduling" } # URL encode the URI to handle special characters import urllib.parse encoded_uri = urllib.parse.quote(dataset_uri, safe='') resp = await airflow_request("GET", f"/datasets/{encoded_uri}") resp.raise_for_status() return resp.json()
- src/mcp_airflow_api/tools/v1_tools.py:23-23 (registration)Calls register_common_tools(mcp) which defines and registers the get_dataset tool among others for v1 API.common_tools.register_common_tools(mcp)
- src/mcp_airflow_api/tools/v2_tools.py:24-24 (registration)Calls register_common_tools(mcp) which defines and registers the get_dataset tool among others for v2 API (though tool returns error for v2).common_tools.register_common_tools(mcp)