get_connection
Retrieve connection details from Apache Airflow deployments by specifying a connection ID, enabling AI assistants to access and manage Airflow configuration data.
Instructions
Get a connection by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conn_id | Yes |
Implementation Reference
- src/airflow/connection.py:72-74 (handler)The async handler function implementing the 'get_connection' tool logic. Retrieves an Airflow connection by ID using the ConnectionApi and formats the response as TextContent.async def get_connection(conn_id: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = connection_api.get_connection(connection_id=conn_id) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/connection.py:11-20 (registration)The get_all_functions that returns the registration details for connection tools, including the tuple for 'get_connection'.def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (list_connections, "list_connections", "List all connections", True), (create_connection, "create_connection", "Create a connection", False), (get_connection, "get_connection", "Get a connection by ID", True), (update_connection, "update_connection", "Update a connection by ID", False), (delete_connection, "delete_connection", "Delete a connection by ID", False), (test_connection, "test_connection", "Test a connection", True), ]
- src/main.py:24-24 (registration)Mapping of APIType.CONNECTION to get_connection_functions in the APITYPE_TO_FUNCTIONS dictionary, used to load tools during server startup.APIType.CONNECTION: get_connection_functions,
- src/main.py:6-6 (registration)Import of get_all_functions from connection.py, aliased for use in main.py tool registration.from src.airflow.connection import get_all_functions as get_connection_functions