Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_tasks

Retrieve tasks from an Apache Airflow DAG to manage workflow execution and monitor task status.

Instructions

Get tasks for DAG

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
order_byNo

Implementation Reference

  • The async handler function implementing the 'get_tasks' MCP tool. It accepts a dag_id (required) and optional order_by, calls the Airflow DAGApi.get_tasks, and returns the response as TextContent.
    async def get_tasks(
        dag_id: str, order_by: Optional[str] = None
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        kwargs = {}
        if order_by is not None:
            kwargs["order_by"] = order_by
    
        response = dag_api.get_tasks(dag_id=dag_id, **kwargs)
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The registration tuple for the 'get_tasks' tool within the get_all_functions() list returned from dag.py. This tuple (function, name, description, read_only) is used by src/main.py to register the tool with the MCP server.
    (get_tasks, "get_tasks", "Get tasks for DAG", True),
  • src/main.py:86-97 (registration)
    The code in main.py that imports get_all_functions from dag.py (via line 8), calls it for APIType.DAG, and registers each tool (including get_tasks) with the FastMCP app using Tool.from_function and app.add_tool.
    try:
        functions = get_function()
    except NotImplementedError:
        continue
    
    # Filter functions for read-only mode if requested
    if read_only:
        functions = filter_functions_for_read_only(functions)
    
    for func, name, description, *_ in functions:
        app.add_tool(Tool.from_function(func, name=name, description=description))
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('Get tasks') without any details on permissions, rate limits, pagination, error handling, or what 'Get' entails (e.g., returns a list, single object, or metadata). For a tool with no annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is extremely concise ('Get tasks for DAG'), which is efficient and front-loaded. However, it's under-specified rather than appropriately sized—it lacks essential details that would make it useful. While not verbose, its brevity comes at the cost of clarity.

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

Completeness1/5

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

Given the complexity (2 parameters, 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain the tool's behavior, parameter usage, or output format, leaving the agent with insufficient information to use the tool correctly. This is inadequate for a tool in this context.

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

Parameters1/5

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

Schema description coverage is 0%, meaning parameters 'dag_id' and 'order_by' are undocumented in the schema. The description adds no information about these parameters—it doesn't explain what 'dag_id' refers to (e.g., Airflow DAG identifier), what 'order_by' does, or valid values. With low coverage and no compensation in the description, this fails to provide necessary context.

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

Purpose2/5

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

The description 'Get tasks for DAG' restates the tool name 'get_tasks' without adding specificity. It mentions 'DAG' which is clarified by the required 'dag_id' parameter, but it doesn't distinguish this tool from sibling tools like 'get_dag_tasks' or explain what 'tasks' means in this context (e.g., Airflow tasks vs. general tasks). This is a tautology with minimal added value.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'get_dag_tasks' and 'get_task' available, there's no indication of how this tool differs (e.g., scope, filtering capabilities, or performance). The agent must infer usage from the name alone, which is insufficient.

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