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)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data, implying it's read-only, but doesn't cover aspects like error handling, permissions, or response format, leaving significant gaps for a tool with three required parameters.

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 no wasted words, clearly front-loading the purpose. It's appropriately sized for a straightforward retrieval tool.

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 behavioral traits, parameter semantics, and return values, making it inadequate for a tool with three required parameters in a complex domain like task management.

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. It lists the three required parameters (DAG ID, task ID, DAG run ID) but doesn't explain their meaning, format, or relationships, adding minimal value beyond the schema's property names.

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 ('Get') and resource ('a task instance'), specifying it requires DAG ID, task ID, and DAG run ID. It distinguishes from siblings like 'list_task_instances' by focusing on retrieval of a single instance, 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 'get_task' or 'list_task_instances'. The description implies usage for retrieving a specific task instance but lacks context on prerequisites or exclusions.

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

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