Skip to main content
Glama
nikhil-ganage

MCP Server Airflow Token

get_task_instance

Retrieve specific task instance details from Apache Airflow using DAG ID, task ID, and DAG run ID parameters for workflow monitoring and management.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
task_idYes
dag_run_idYes

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'get_task_instance' tool by calling the Airflow TaskInstanceApi to retrieve the task instance and formatting it as MCP TextContent.
    async def get_task_instance( dag_id: str, task_id: str, dag_run_id: str ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = task_instance_api.get_task_instance(dag_id=dag_id, dag_run_id=dag_run_id, task_id=task_id) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The get_all_functions() function that registers the 'get_task_instance' tool (line 14) along with related task instance tools, which is later imported and used in src/main.py for MCP tool registration.
    def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (get_task_instance, "get_task_instance", "Get a task instance by DAG ID, task ID, and DAG run ID", True), (list_task_instances, "list_task_instances", "List task instances by DAG ID and DAG run ID", True), ( update_task_instance, "update_task_instance", "Update a task instance by DAG ID, DAG run ID, and task ID", False, ), ]
  • Initialization of the TaskInstanceApi client instance used by the get_task_instance handler.
    task_instance_api = TaskInstanceApi(api_client)

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/nikhil-ganage/mcp-server-airflow-token'

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