Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_task_instance

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

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 main handler function for the 'get_task_instance' tool. It calls the Airflow TaskInstanceApi to fetch the task instance and returns it as 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 registration tuple for the 'get_task_instance' tool within the get_all_functions() list, which is imported and used in main.py to register tools with MCP.
    (get_task_instance, "get_task_instance", "Get a task instance by DAG ID, task ID, and DAG run ID", True),
  • Initialization of the TaskInstanceApi client used by the get_task_instance handler.
    task_instance_api = TaskInstanceApi(api_client)
  • src/main.py:18-18 (registration)
    Import of get_all_functions from taskinstance module in main.py, which leads to registration of the tool.
    from src.airflow.taskinstance import get_all_functions as get_taskinstance_functions
  • src/main.py:96-96 (registration)
    The generic tool registration loop in main.py where tools from get_all_functions (including get_task_instance) are added to the MCP app.
    app.add_tool(Tool.from_function(func, name=name, description=description))
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states a read operation ('Get') but doesn't disclose behavioral traits such as permissions needed, error handling (e.g., if IDs are invalid), response format, or rate limits. This leaves significant gaps for a tool with no annotation coverage.

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 a single, efficient sentence with zero waste, front-loading the core action and parameters. It's appropriately sized for the tool's purpose without unnecessary elaboration.

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 no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on behavior, parameter meanings, return values, and usage context, making it inadequate for a 3-parameter tool in a complex server environment.

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%, and the description only names the parameters (dag_id, task_id, dag_run_id) without explaining their semantics, formats, or examples. It adds minimal value beyond the schema, failing to compensate for the low coverage.

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 verb 'Get' and the resource 'a task instance', specifying it's retrieved by three identifiers (DAG ID, task ID, and DAG run ID). It distinguishes from siblings like 'list_task_instances' by focusing on a single instance retrieval, though it doesn't explicitly mention this distinction.

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?

No guidance is provided on when to use this tool versus alternatives like 'list_task_instances' or 'get_task'. The description implies usage for retrieving a specific task instance but lacks context on prerequisites, error cases, or comparisons to sibling tools.

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