get_import_error
Identify and resolve specific import errors in Apache Airflow by retrieving detailed information using the import error ID. Access precise error data for troubleshooting and system maintenance.
Instructions
Get a specific import error by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| import_error_id | Yes |
Implementation Reference
- src/airflow/importerror.py:37-41 (handler)The async handler function for the 'get_import_error' MCP tool. It fetches the specific import error by ID from the Airflow API and returns it formatted as TextContent.async def get_import_error( import_error_id: int, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = import_error_api.get_import_error(import_error_id=import_error_id) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/importerror.py:11-16 (registration)Module-level registration function that lists the 'get_import_error' tool with its name, description, and read-only status.def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (get_import_errors, "get_import_errors", "List import errors", True), (get_import_error, "get_import_error", "Get a specific import error by ID", True), ]
- src/main.py:24-32 (registration)Top-level mapping that associates the IMPORTERROR API type with the importerror module's get_all_functions for aggregating tools during server startup.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,
- src/airflow/importerror.py:3-8 (helper)Initialization of the ImportErrorApi client instance used by the tool handler.import mcp.types as types from airflow_client.client.api.import_error_api import ImportErrorApi from src.airflow.airflow_client import api_client import_error_api = ImportErrorApi(api_client)