Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_dataset

Retrieve datasets from Apache Airflow by URI to access and manage data within workflow pipelines.

Instructions

Get a dataset by URI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYes

Implementation Reference

  • The handler function implementing the 'get_dataset' tool. It takes a dataset URI, calls the Airflow DatasetApi.get_dataset, converts the response to dict string, and returns it wrapped in MCP TextContent.
    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()))]
  • Registration entry for the 'get_dataset' tool in the list returned by get_all_functions, specifying the handler, tool name, description, and read-only flag.
    (get_dataset, "get_dataset", "Get a dataset by URI", True),
  • Helper function that returns the list of dataset-related tools for registration, including '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:24-40 (registration)
    Mapping of API types to their get_all_functions, including DATASET to get_dataset_functions, used to load tools for registration.
    APITYPE_TO_FUNCTIONS = {
        APIType.CONFIG: get_config_functions,
        APIType.CONNECTION: get_connection_functions,
        APIType.DAG: get_dag_functions,
        APIType.DAGRUN: get_dagrun_functions,
        APIType.DAGSTATS: get_dagstats_functions,
        APIType.DATASET: get_dataset_functions,
        APIType.EVENTLOG: get_eventlog_functions,
        APIType.IMPORTERROR: get_importerror_functions,
        APIType.MONITORING: get_monitoring_functions,
        APIType.PLUGIN: get_plugin_functions,
        APIType.POOL: get_pool_functions,
        APIType.PROVIDER: get_provider_functions,
        APIType.TASKINSTANCE: get_taskinstance_functions,
        APIType.VARIABLE: get_variable_functions,
        APIType.XCOM: get_xcom_functions,
    }
  • src/main.py:95-97 (registration)
    Code that iterates over the functions (including get_dataset) and registers them as MCP tools using app.add_tool.
    for func, name, description, *_ in functions:
        app.add_tool(Tool.from_function(func, name=name, description=description))
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose if this is a read-only operation, what permissions are needed, how errors are handled, or the format of the returned data. 'Get' implies retrieval, but details like rate limits or side effects are missing, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single sentence—and front-loaded with the core action. There's no wasted verbiage, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a retrieval operation with 1 parameter), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't address what the tool returns, error conditions, or usage context, making it inadequate for effective agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, and the description only mentions 'URI' without adding meaning. It doesn't explain what a URI is in this context, its format, or examples, failing to compensate for the schema's lack of documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get a dataset by URI' clearly states the action (get) and resource (dataset), but it's vague about what 'get' entails—does it fetch metadata, content, or both? It doesn't differentiate from sibling tools like 'get_datasets' (plural) or 'get_dataset_events', leaving ambiguity in scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't explain if this is for retrieving a single dataset by identifier while 'get_datasets' is for listing multiple, or how it relates to 'get_dataset_events'. The description lacks context for selection among similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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