Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

update_task_instance

Modify the state of a specific task instance in Apache Airflow workflows by providing DAG ID, DAG run ID, and task ID.

Instructions

Update a task instance by DAG ID, DAG run ID, and task ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
task_idYes
stateNo

Implementation Reference

  • Implements the core logic of the 'update_task_instance' tool by constructing an update request (typically for state) and patching the task instance via Airflow's TaskInstanceApi.
    async def update_task_instance(
        dag_id: str, dag_run_id: str, task_id: str, state: Optional[str] = None
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        update_request = {}
        if state is not None:
            update_request["state"] = state
    
        response = task_instance_api.patch_task_instance(
            dag_id=dag_id,
            dag_run_id=dag_run_id,
            task_id=task_id,
            update_mask=list(update_request.keys()),
            task_instance_request=update_request,
        )
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Local registration of the 'update_task_instance' tool within the module's get_all_functions() list, which is imported and used in src/main.py to dynamically register tools with the MCP server.
    (
        update_task_instance,
        "update_task_instance",
        "Update a task instance by DAG ID, DAG run ID, and task ID",
        False,
    ),
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 offers minimal behavioral insight. It implies a mutation operation ('Update') but doesn't disclose required permissions, whether changes are reversible, side effects (e.g., on downstream tasks), or response format. It mentions the 'state' parameter indirectly but doesn't explain its role or valid values, leaving critical behavioral aspects undocumented.

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 a single, efficient sentence that front-loads the core action and key identifiers. There's no wasted verbiage or redundancy. However, it could be more structured by explicitly separating the update action from parameter explanations, but its brevity is appropriate for the minimal content provided.

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

Completeness2/5

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

Given the tool's complexity (mutation with 4 parameters, no annotations, no output schema), the description is inadequate. It lacks behavioral details (e.g., error conditions, idempotency), parameter explanations (especially for 'state'), and comparison to siblings. For a mutation tool in a workflow system, this leaves the agent with significant gaps in understanding how to use it correctly and safely.

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 adds limited value. It lists three required identifiers (DAG ID, DAG run ID, task ID) which map to parameters, clarifying they are needed to locate the instance. However, it doesn't explain the optional 'state' parameter's purpose, valid values, or default behavior, leaving 25% of parameters (1 of 4) without semantic context in either schema or description.

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 ('Update') and the target resource ('a task instance'), providing specific identifiers (DAG ID, DAG run ID, task ID). It distinguishes the tool's focus on updating existing instances rather than creating or deleting them. However, it doesn't explicitly differentiate from similar sibling tools like 'set_task_instances_state' or 'update_dag_run_state'.

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. It doesn't mention prerequisites (e.g., the task instance must exist), compare it to sibling tools like 'set_task_instances_state' (which might handle multiple instances), or specify use cases (e.g., correcting state, updating metadata). The agent must infer usage from the tool name and parameters alone.

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