Skip to main content
Glama
madamak

Apache Airflow MCP Server

airflow_clear_task_instances

Destructive

Clear task instances for a DAG across runs using filters such as date range, upstream/downstream tasks, and dry-run preview.

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: Preview without mutating (default true); set false explicitly to clear

  • 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
dag_idNo
ui_urlNo
dry_runNo
end_dateNo
instanceNo
task_idsNo
start_dateNo
include_pastNo
include_futureNo
reset_dag_runsNo
include_subdagsNo
include_upstreamNo
include_parentdagNo
include_downstreamNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The annotations already mark destructiveHint=true, and the description reinforces this with a clear 'destructive' label. It explains the dry_run parameter (default true, must be set false to mutate) and the return/error formats. However, it does not mention authorization requirements or side effects beyond the dry_run flag.

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 well-structured: a one-sentence intro, followed by parameter and return bullets. Every sentence adds value, with no redundant or vague statements.

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 14 parameters, no required ones, and an output schema, the description covers parameters and return value thoroughly. It lacks context on prerequisites (e.g., permissions) or edge cases, but for a complex tool it is largely complete.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing a detailed bullet list for all 14 parameters, including optionality, mutual exclusivity (instance vs ui_url), and the effect of dry_run. This adds significant meaning beyond the raw schema.

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 action ('Clear task instances') and the resource ('for a DAG across one or more runs'), with the note 'destructive' distinguishing it from read-only tools. Sibling tools like airflow_clear_dag_run are implicitly differentiated by the focus on task instances rather than entire runs.

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

Usage Guidelines3/5

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

The description lists many parameters and the dry_run behavior but does not provide explicit guidance on when to use this tool versus alternatives like airflow_clear_dag_run or airflow_get_task_instance. The 'destructive' label and filter semantics imply use cases, but direct comparisons are absent.

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