Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

list_variables

Retrieve and manage Airflow variables by listing them with optional filters like limit, offset, and order_by. Simplifies access to key-value pairs within your Airflow environment.

Instructions

List all variables

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
order_byNo

Implementation Reference

  • The main handler function for the 'list_variables' tool. It accepts optional parameters limit, offset, and order_by, calls the Airflow VariableApi to list variables, and returns the response as a TextContent object.
    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() returns the registration tuple for 'list_variables' among other variable tools, which is used by main.py to register the tools with the MCP server.
    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:95-97 (registration)
    The generic registration loop in main.py that adds all tools (including list_variables) to the MCP app using Tool.from_function, after fetching from get_all_functions.
    for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))
  • Initialization of the VariableApi instance used by the list_variables handler.
    variable_api = VariableApi(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/yangkyeongmo/mcp-server-apache-airflow'

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