get_xcom_entries
Retrieve cross-communication data entries between Airflow tasks to monitor and debug workflow execution.
Instructions
Get all XCom entries
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | Yes | ||
| dag_run_id | Yes | ||
| task_id | Yes | ||
| map_index | No | ||
| xcom_key | No | ||
| limit | No | ||
| offset | No |
Implementation Reference
- src/airflow/xcom.py:19-41 (handler)The asynchronous handler function implementing the 'get_xcom_entries' tool logic. It constructs parameters from inputs and calls the Airflow XComApi to fetch entries, returning them as formatted text content.async def get_xcom_entries( dag_id: str, dag_run_id: str, task_id: str, map_index: Optional[int] = None, xcom_key: Optional[str] = None, limit: Optional[int] = None, offset: Optional[int] = 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 xcom_key is not None: kwargs["xcom_key"] = xcom_key if limit is not None: kwargs["limit"] = limit if offset is not None: kwargs["offset"] = offset response = xcom_api.get_xcom_entries(dag_id=dag_id, dag_run_id=dag_run_id, task_id=task_id, **kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/xcom.py:13-16 (registration)Registration tuple for the 'get_xcom_entries' tool within the module's get_all_functions() which collects tools for central 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:90-91 (registration)Central registration loop where tools from xcom module (via get_xcom_functions()) are added to the MCP app using app.add_tool().for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
- src/main.py:19-19 (registration)Import of xcom module's get_all_functions for inclusion in central tool registration.from src.airflow.xcom import get_all_functions as get_xcom_functions
- src/airflow/xcom.py:8-8 (helper)Initialization of XComApi client instance used by the get_xcom_entries handler.xcom_api = XComApi(api_client)