Skip to main content
Glama

list_tasks

Retrieve all tasks from a specific Apache Airflow DAG to inspect workflow components and monitor task execution status.

Instructions

[Tool Role]: Lists all tasks within the specified DAG.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_tasks' tool. Decorated with @mcp.tool(), it fetches and returns all tasks for the specified DAG ID using the Airflow REST API endpoint /dags/{dag_id}/tasks.
    @mcp.tool()
    async def list_tasks(dag_id: str) -> Dict[str, Any]:
        """[Tool Role]: Lists all tasks within the specified DAG."""
        if not dag_id:
            raise ValueError("dag_id must not be empty")
        resp = await airflow_request("GET", f"/dags/{dag_id}/tasks")
        resp.raise_for_status()
        return resp.json()
  • v1 API version registration: configures the airflow_request function for v1 API and invokes register_common_tools(mcp), which executes the code defining the @mcp.tool()-decorated list_tasks handler.
    # Set the global request function to v1
    common_tools.airflow_request = airflow_request_v1
    
    # Register all 56 common tools (includes management tools)
    common_tools.register_common_tools(mcp)
  • v2 API version registration: configures the airflow_request function for v2 API and invokes register_common_tools(mcp), which executes the code defining the @mcp.tool()-decorated list_tasks handler.
    # Set the global request function to v2
    common_tools.airflow_request = airflow_request_v2
    
    # Register all 43 common tools
    common_tools.register_common_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'Lists all tasks' but doesn't mention pagination, sorting, filtering options, permissions required, rate limits, or what format the output takes. This leaves significant gaps in understanding how the tool behaves.

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 that gets straight to the point with no wasted words. The '[Tool Role]:' prefix is unnecessary but doesn't detract significantly from the overall efficiency.

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

Completeness3/5

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

Given that there's an output schema (which handles return values) and only one simple parameter, the description is minimally adequate. However, for a tool with no annotations and 0% schema description coverage, it should provide more context about behavioral aspects like what 'all tasks' means in practice.

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

Parameters3/5

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

Schema description coverage is 0%, so the description needs to compensate. It mentions 'within the specified DAG' which implies the 'dag_id' parameter identifies which DAG to list tasks from, adding some semantic meaning. However, it doesn't explain what format the DAG ID should take or provide examples.

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

Purpose4/5

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

The description clearly states the action ('Lists') and resource ('tasks within the specified DAG'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'list_task_instances_all' or 'list_task_instances_batch', but the scope is specific enough to be useful.

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 about when to use this tool versus alternatives like 'list_task_instances_all' or 'list_task_instances_batch'. The description only states what it does, not when it's appropriate or what distinguishes it from 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/call518/MCP-Airflow-API'

If you have feedback or need assistance with the MCP directory API, please join our Discord server