Skip to main content
Glama
madamak

Apache Airflow MCP Server

by madamak

airflow_clear_task_instances

Destructive

Clear task instances in Apache Airflow DAGs using native filters to remove execution history and reset states for troubleshooting or reruns.

Instructions

Clear task instances for a DAG across one or more runs using Airflow's native filter set (destructive).

Parameters

  • instance: Instance key (optional; mutually exclusive with ui_url)

  • ui_url: Airflow UI URL to resolve instance (optional; takes precedence)

  • dag_id: DAG identifier (required if ui_url not provided)

  • task_ids: List of task IDs to clear (optional)

  • start_date: ISO8601 start date filter (optional)

  • end_date: ISO8601 end date filter (optional)

  • include_subdags: Include subDAGs (optional)

  • include_parentdag: Include parent DAG (optional)

  • include_upstream: Include upstream tasks (optional)

  • include_downstream: Include downstream tasks (optional)

  • include_future: Include future runs (optional)

  • include_past: Include past runs (optional)

  • dry_run: If true, perform a dry-run only (optional)

  • reset_dag_runs: Reset DagRun state (optional)

Returns

  • Response dict: { "dag_id": str, "cleared": object, "request_id": str }

  • Raises: ToolError with compact JSON payload (code, message, request_id, optional context)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceNo
ui_urlNo
dag_idNo
task_idsNo
start_dateNo
end_dateNo
include_subdagsNo
include_parentdagNo
include_upstreamNo
include_downstreamNo
include_futureNo
include_pastNo
dry_runNo
reset_dag_runsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description adds valuable behavioral context beyond annotations by explicitly labeling the operation as 'destructive' (reinforcing destructiveHint=true), describing the return format ('Response dict'), and mentioning error handling ('Raises: ToolError'). While annotations already indicate destructiveHint=true, the description provides additional implementation details about response structure and error payloads that aren't captured in annotations.

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 well-structured with clear sections (purpose statement, parameters list, returns information) and front-loaded the core purpose. While comprehensive, some parameter descriptions could be more concise, and the overall length is justified by the complexity of 14 parameters. Every sentence serves a clear purpose in documenting the tool's behavior.

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

Completeness4/5

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

Given the tool's complexity (14 parameters, destructive operation), the description provides good coverage of purpose, parameters, and return values. With annotations covering safety profile (destructive) and an output schema presumably defining the response structure, the description focuses appropriately on parameter semantics and operational context. The main gap is lack of explicit guidance on when to choose this over sibling tools like airflow_clear_dag_run.

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

Parameters4/5

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

With 0% schema description coverage and 14 parameters, the description provides substantial semantic value by listing all parameters with brief explanations of their purpose. It clarifies relationships (e.g., 'instance' vs 'ui_url' mutual exclusivity, 'dag_id' requirement conditions) and parameter types (ISO8601 dates, boolean flags). While not exhaustive, it compensates well for the complete lack of schema descriptions.

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

Purpose5/5

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

The description clearly states the specific action ('Clear task instances for a DAG across one or more runs') and resource ('using Airflow's native filter set'), and explicitly distinguishes it from siblings by specifying it's for task instances rather than DAG runs or other operations. The parenthetical '(destructive)' further clarifies the nature of the operation.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool (for clearing task instances with Airflow's filter set), but doesn't explicitly state when not to use it or name specific alternatives among the sibling tools. It implies usage for task instance clearing rather than DAG run operations, but lacks explicit exclusions or comparisons.

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/madamak/apache-airflow-mcp-server'

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