Skip to main content
Glama

get_xcom_entry

Retrieve a specific cross-communication (XCom) entry for a task instance in an Apache Airflow DAG by providing the DAG ID, run ID, task ID, and XCom key. Retrieves both the value and metadata.

Instructions

[Tool Role]: Retrieves a specific XCom entry for a task instance.

Args: dag_id: The DAG ID dag_run_id: The DAG run ID task_id: The task ID
xcom_key: The XCom key to retrieve map_index: Map index for mapped tasks (default: -1 for non-mapped)

Returns: Dictionary containing the specific XCom entry with full value and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
dag_run_idYes
map_indexNo
task_idYes
xcom_keyYes

Implementation Reference

  • The handler function for the 'get_xcom_entry' tool. It makes a GET request to the Airflow API to retrieve a specific XCom entry given dag_id, dag_run_id, task_id, and xcom_key. The function is registered as an MCP tool using the @mcp.tool() decorator.
    @mcp.tool() async def get_xcom_entry(dag_id: str, dag_run_id: str, task_id: str, xcom_key: str) -> Dict[str, Any]: """[Tool Role]: Gets a specific XCom entry.""" resp = await airflow_request("GET", f"/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}") resp.raise_for_status() return resp.json()
  • The @mcp.tool() decorator registers the get_xcom_entry function as an MCP tool within the register_common_tools function.
    @mcp.tool()

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/call518/MCP-Airflow-API'

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