list_connections
Retrieve and display all configured connections from Apache Airflow deployments, enabling management of data pipeline integrations.
Instructions
List all connections
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| order_by | No |
Implementation Reference
- src/airflow/connection.py:23-39 (handler)The main handler function for the 'list_connections' tool. It accepts optional parameters limit, offset, and order_by, constructs kwargs, calls connection_api.get_connections, and returns the response as TextContent.async def list_connections( limit: Optional[int] = None, offset: Optional[int] = None, order_by: Optional[str] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: # Build parameters dictionary kwargs: Dict[str, Any] = {} if limit is not None: kwargs["limit"] = limit if offset is not None: kwargs["offset"] = offset if order_by is not None: kwargs["order_by"] = order_by response = connection_api.get_connections(**kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/connection.py:11-20 (registration)Registers the list_connections tool (along with related connection tools) by returning a tuple of (function, name, description, read_only=True) which is later used in main.py to add_tool to the MCP app.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:90-92 (registration)The generic registration loop in main.py that calls app.add_tool for each tool from the modules' get_all_functions, including list_connections.for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
- src/airflow/connection.py:8-8 (helper)Initializes the connection_api instance used by the list_connections handler, imported from airflow_client.connection_api = ConnectionApi(api_client)