Skip to main content
Glama

list_task_instances_batch

Retrieve multiple Airflow task instances by filtering with date ranges and state criteria to monitor workflow execution.

Instructions

[Tool Role]: Lists task instances in batch with date and state filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
start_date_gteNo
start_date_lteNo
stateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function decorated with @mcp.tool() that executes the list_task_instances_batch tool. It queries the Airflow API /taskInstances endpoint with pagination, date range, and state filters, then enriches the response with a state summary.
    @mcp.tool()
    async def list_task_instances_batch(
        limit: int = 100,
        offset: int = 0,
        start_date_gte: Optional[str] = None,
        start_date_lte: Optional[str] = None,
        state: Optional[List[str]] = None
    ) -> Dict[str, Any]:
        """[Tool Role]: Lists task instances in batch with date and state filtering."""
        params = {'limit': limit, 'offset': offset}
        
        if start_date_gte:
            params['start_date_gte'] = start_date_gte
        if start_date_lte:
            params['start_date_lte'] = start_date_lte
        if state:
            params['state'] = state
        
        query_string = "&".join([f"{k}={v}" for k, v in params.items()])
        resp = await airflow_request("GET", f"/taskInstances?{query_string}")
        resp.raise_for_status()
        data = resp.json()
        
        # Add summary statistics
        task_instances = data.get("task_instances", [])
        state_summary = {}
        for task in task_instances:
            task_state = task.get("state", "unknown")
            state_summary[task_state] = state_summary.get(task_state, 0) + 1
        
        data["state_summary"] = state_summary
        return data
  • Calls register_common_tools(mcp) which registers the list_task_instances_batch tool (among other common tools) for Airflow API v1 usage.
    common_tools.register_common_tools(mcp)
  • Calls register_common_tools(mcp) which registers the list_task_instances_batch tool (among other common tools) for Airflow API v2 usage.
    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 but only states it's a listing operation with filtering. It lacks critical behavioral details such as pagination behavior (implied by limit/offset but not explained), rate limits, authentication needs, or what 'batch' entails operationally.

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 with a single sentence that front-loads the core purpose. Every word earns its place, and there's no redundancy or unnecessary elaboration, making it efficient for quick scanning.

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 the tool has an output schema (which handles return values) and no annotations, the description is minimally adequate but incomplete. It covers the basic operation but misses key context like behavioral traits, parameter details, and differentiation from siblings, which are needed for a listing tool with 5 parameters.

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?

Schema description coverage is 0%, so the description must compensate but only vaguely mentions 'date and state filtering' without explaining parameters like 'start_date_gte', 'start_date_lte', 'state', 'limit', or 'offset'. This leaves most parameters undocumented and unclear in usage.

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 verb 'Lists' and resource 'task instances in batch' with filtering capabilities ('date and state filtering'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list_task_instances_all' or explain what 'batch' means in this context, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list_task_instances_all' or other listing tools. It mentions filtering but doesn't specify scenarios or prerequisites, leaving the agent with minimal context for selection.

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