get_import_error
Retrieve specific import error details by ID to diagnose and resolve DAG import failures in Apache Airflow.
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 MCP tool handler for 'get_import_error'. It takes an import_error_id, calls the underlying ImportErrorApi, converts the response to dict string, and wraps it in 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 via get_all_functions() which lists the 'get_import_error' tool for inclusion in the main MCP server.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:13-13 (registration)Global registration: import of the importerror module's get_all_functions into the main.py server setup.from src.airflow.importerror import get_all_functions as get_importerror_functions
- src/main.py:32-32 (registration)Global registration: mapping of APIType.IMPORTERROR to the importerror functions in the main dispatcher.APIType.IMPORTERROR: get_importerror_functions,
- src/airflow/importerror.py:8-8 (helper)Initialization of the ImportErrorApi client instance used by the handler.import_error_api = ImportErrorApi(api_client)