Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

list_variables

Retrieve and display all variables stored in Apache Airflow for configuration management and workflow parameterization.

Instructions

List all variables

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
order_byNo

Implementation Reference

  • The async handler function implementing the 'list_variables' tool. It calls the Airflow VariableApi to list variables with optional limit, offset, and order_by parameters, returning the response as TextContent.
    async def list_variables( 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 = variable_api.get_variables(**kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The get_all_functions() in variable.py that registers the list_variables tool along with other variable tools by returning the tuple (function, name, description, read_only).
    def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (list_variables, "list_variables", "List all variables", True), (create_variable, "create_variable", "Create a variable", False), (get_variable, "get_variable", "Get a variable by key", True), (update_variable, "update_variable", "Update a variable by key", False), (delete_variable, "delete_variable", "Delete a variable by key", False), ]
  • src/main.py:19-20 (registration)
    Import of get_all_functions from variable.py in the main.py file, aliased as get_variable_functions for top-level tool registration.
    from src.airflow.variable import get_all_functions as get_variable_functions from src.airflow.xcom import get_all_functions as get_xcom_functions
  • src/main.py:38-39 (registration)
    Mapping of APIType.VARIABLE to the variable functions getter in the APITYPE_TO_FUNCTIONS dict used in main() to load tools.
    APIType.VARIABLE: get_variable_functions, APIType.XCOM: get_xcom_functions,
  • src/main.py:95-96 (registration)
    The loop in main.py that adds each tool (including list_variables) 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))

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