Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

list_connections

Retrieve and manage all connections in Apache Airflow using customizable parameters like limit, offset, and order for efficient monitoring and organization.

Instructions

List all connections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
order_byNo

Implementation Reference

  • The main handler function for the 'list_connections' tool. It calls the Airflow ConnectionApi.get_connections with optional pagination parameters and returns the response as text content.
    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()))]
  • Registers the 'list_connections' tool (and other connection tools) by including it in the list returned by get_all_functions, which is imported and used in src/main.py.
    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:95-97 (registration)
    Generic registration loop where tools from get_all_functions (including list_connections) are added to the MCP app using Tool.from_function.
    for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))
  • src/main.py:26-26 (registration)
    Maps APIType.CONNECTION to get_connection_functions (alias for connection.py's get_all_functions), enabling its tools to be loaded.
    APIType.CONNECTION: get_connection_functions,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yangkyeongmo/mcp-server-apache-airflow'

If you have feedback or need assistance with the MCP directory API, please join our Discord server