Skip to main content
Glama

MCP Server Airflow Token

get_task_instance

Retrieve a specific task instance from an Airflow DAG run by providing the DAG ID, task ID, and DAG run ID to access execution details and status.

Instructions

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

Input Schema

NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
task_idYes

Input Schema (JSON Schema)

{ "properties": { "dag_id": { "title": "Dag Id", "type": "string" }, "dag_run_id": { "title": "Dag Run Id", "type": "string" }, "task_id": { "title": "Task Id", "type": "string" } }, "required": [ "dag_id", "task_id", "dag_run_id" ], "type": "object" }

Implementation Reference

  • The async handler function implementing the 'get_task_instance' tool logic. It calls the Airflow TaskInstanceApi to fetch the task instance by dag_id, task_id, and dag_run_id, then returns the response as text content.
    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 registration tuple for the 'get_task_instance' tool, including the function reference, name, description, and read-only flag, provided by get_all_functions().
    (get_task_instance, "get_task_instance", "Get a task instance by DAG ID, task ID, and DAG run ID", True),
  • src/main.py:90-91 (registration)
    The generic registration code in main.py that adds each tool (including get_task_instance) to the MCP app using app.add_tool during server startup.
    for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
  • src/main.py:17-17 (registration)
    Import of get_all_functions from taskinstance.py in main.py, aliased and used to load the tool registrations.
    from src.airflow.taskinstance import get_all_functions as get_taskinstance_functions

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