Skip to main content
Glama
nikhil-ganage

MCP Server Airflow Token

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
NameRequiredDescriptionDefault
limitNo
offsetNo
order_byNo

Implementation Reference

  • 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()))]
  • 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)
  • Initializes the connection_api instance used by the list_connections handler, imported from airflow_client.
    connection_api = ConnectionApi(api_client)

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/nikhil-ganage/mcp-server-airflow-token'

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