Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_xcom_entry

Retrieve cross-communication data between Airflow tasks by specifying DAG, run, task, and XCom key parameters.

Instructions

Get an XCom entry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
task_idYes
xcom_keyYes
map_indexNo
deserializeNo
stringifyNo

Implementation Reference

  • The main handler function that executes the tool's logic: builds kwargs from optional params and calls the underlying XComApi to retrieve and return the XCom entry as text.
    async def get_xcom_entry(
        dag_id: str,
        dag_run_id: str,
        task_id: str,
        xcom_key: str,
        map_index: Optional[int] = None,
        deserialize: Optional[bool] = None,
        stringify: Optional[bool] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        # Build parameters dictionary
        kwargs: Dict[str, Any] = {}
        if map_index is not None:
            kwargs["map_index"] = map_index
        if deserialize is not None:
            kwargs["deserialize"] = deserialize
        if stringify is not None:
            kwargs["stringify"] = stringify
    
        response = xcom_api.get_xcom_entry(
            dag_id=dag_id, dag_run_id=dag_run_id, task_id=task_id, xcom_key=xcom_key, **kwargs
        )
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Helper function that provides the registration tuple for the get_xcom_entry tool, used by main.py to add it to the MCP app.
    def get_all_functions() -> list[tuple[Callable, str, str, bool]]:
        """Return list of (function, name, description, is_read_only) tuples for registration."""
        return [
            (get_xcom_entries, "get_xcom_entries", "Get all XCom entries", True),
            (get_xcom_entry, "get_xcom_entry", "Get an XCom entry", True),
        ]
  • src/main.py:20-20 (registration)
    Imports the get_all_functions from xcom module to enable registration of xcom tools including get_xcom_entry.
    from src.airflow.xcom import get_all_functions as get_xcom_functions
  • src/main.py:24-40 (registration)
    Maps APIType.XCOM to the xcom get_all_functions, which includes get_xcom_entry, for use in registering tools.
    APITYPE_TO_FUNCTIONS = {
        APIType.CONFIG: get_config_functions,
        APIType.CONNECTION: get_connection_functions,
        APIType.DAG: get_dag_functions,
        APIType.DAGRUN: get_dagrun_functions,
        APIType.DAGSTATS: get_dagstats_functions,
        APIType.DATASET: get_dataset_functions,
        APIType.EVENTLOG: get_eventlog_functions,
        APIType.IMPORTERROR: get_importerror_functions,
        APIType.MONITORING: get_monitoring_functions,
        APIType.PLUGIN: get_plugin_functions,
        APIType.POOL: get_pool_functions,
        APIType.PROVIDER: get_provider_functions,
        APIType.TASKINSTANCE: get_taskinstance_functions,
        APIType.VARIABLE: get_variable_functions,
        APIType.XCOM: get_xcom_functions,
    }
  • src/main.py:95-97 (registration)
    Generic loop that adds each tool from the functions list (including get_xcom_entry when XCOM API is selected) to the MCP app using Tool.from_function.
    for func, name, description, *_ in functions:
        app.add_tool(Tool.from_function(func, name=name, description=description))
Behavior1/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers none. 'Get' implies a read operation, but there's no information about permissions required, rate limits, error conditions, what happens if the XCom entry doesn't exist, or whether this operation has side effects. The description fails to provide any behavioral context beyond the basic verb.

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 extremely concise at just three words. While this represents under-specification rather than ideal conciseness, it contains zero wasted words and is perfectly front-loaded. Every word directly relates to the tool's purpose, earning its place in the description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It provides no context about what XCom entries are, how to use the tool, what parameters mean, what behavior to expect, or what the tool returns. The description fails to provide the minimal context needed for effective tool use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 7 parameters and 0% schema description coverage, the description provides no parameter information whatsoever. It doesn't explain what 'dag_id', 'dag_run_id', 'task_id', 'xcom_key', 'map_index', 'deserialize', or 'stringify' mean or how they relate to retrieving XCom entries. The description fails completely to compensate for the schema's lack of parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get an XCom entry' is a tautology that restates the tool name without adding meaningful context. It doesn't explain what XCom entries are, what resource is being accessed, or how this differs from sibling tools like 'get_xcom_entries' (plural). The purpose is minimally stated but lacks specificity and differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, when this tool is appropriate versus 'get_xcom_entries', or any context about XCom systems. The agent receives zero usage direction beyond the tool name itself.

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