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, ),

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