Skip to main content
Glama
nikhil-ganage

MCP Server Airflow Token

get_providers

Retrieve a list of loaded providers from Apache Airflow deployments to manage and monitor available data processing services.

Instructions

Get a list of loaded providers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The main asynchronous handler function that implements the logic for the 'get_providers' tool. It constructs parameters from inputs, calls the external ProviderApi, and formats the response as MCP TextContent.
    async def get_providers(
        limit: Optional[int] = None,
        offset: Optional[int] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Get a list of providers.
    
        Args:
            limit: The numbers of items to return.
            offset: The number of items to skip before starting to collect the result set.
    
        Returns:
            A list of providers with their details.
        """
        # Build parameters dictionary
        kwargs: Dict[str, Any] = {}
        if limit is not None:
            kwargs["limit"] = limit
        if offset is not None:
            kwargs["offset"] = offset
    
        response = provider_api.get_providers(**kwargs)
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Module-level registration function that returns the tuple defining the 'get_providers' tool for inclusion in the MCP toolset.
    def get_all_functions() -> list[tuple[Callable, str, str, bool]]:
        """Return list of (function, name, description, is_read_only) tuples for registration."""
        return [
            (get_providers, "get_providers", "Get a list of loaded providers", True),
        ]
  • src/main.py:90-92 (registration)
    The generic loop in main() that registers all collected tools (including 'get_providers' from providers) to the MCP app using app.add_tool.
    for func, name, description, *_ in functions:
        app.add_tool(func, name=name, description=description)
  • src/main.py:22-38 (registration)
    Central mapping that links APIType.PROVIDER to the provider module's get_all_functions, enabling registration of 'get_providers'.
    APITYPE_TO_FUNCTIONS = {
        APIType.CONFIG: get_config_functions,
        APIType.CONNECTION: get_connection_functions,
        APIType.DAG: get_dag_functions,
        APIType.DAGRUN: get_dagrun_functions,
        APIType.DAGSTATS: get_dagstats_functions,
        APIType.DATASET: get_dataset_functions,
        APIType.EVENTLOG: get_eventlog_functions,
        APIType.IMPORTERROR: get_importerror_functions,
        APIType.MONITORING: get_monitoring_functions,
        APIType.PLUGIN: get_plugin_functions,
        APIType.POOL: get_pool_functions,
        APIType.PROVIDER: get_provider_functions,
        APIType.TASKINSTANCE: get_taskinstance_functions,
        APIType.VARIABLE: get_variable_functions,
        APIType.XCOM: get_xcom_functions,
    }
  • src/main.py:16-16 (registration)
    Import of the provider module's get_all_functions, which includes 'get_providers', into the main registration system.
    from src.airflow.provider import get_all_functions as get_provider_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/nikhil-ganage/mcp-server-airflow-token'

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