Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

create_variable

Define and store configuration values as variables in Apache Airflow for use across workflows and tasks.

Instructions

Create a variable

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
valueYes
descriptionNo

Implementation Reference

  • The main handler function for the 'create_variable' tool. It constructs a variable request with key, value, and optional description, then calls the Airflow VariableApi to create the variable and returns the response.
    async def create_variable( key: str, value: str, description: Optional[str] = None ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: variable_request = { "key": key, "value": value, } if description is not None: variable_request["description"] = description response = variable_api.post_variables(variable_request=variable_request) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Registration tuple for the create_variable tool within the module's get_all_functions().
    (create_variable, "create_variable", "Create a variable", False),
  • src/main.py:19-19 (registration)
    Imports the get_all_functions from the variable module for top-level tool registration.
    from src.airflow.variable import get_all_functions as get_variable_functions
  • src/main.py:38-38 (registration)
    Maps APIType.VARIABLE to the variable functions getter.
    APIType.VARIABLE: get_variable_functions,
  • src/main.py:95-96 (registration)
    Loop that registers all tools (including create_variable) by calling app.add_tool.
    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