Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

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
NameRequiredDescriptionDefault
uriYes

Implementation Reference

  • 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()))]
  • 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))
  • 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,

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