Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

update_variable

Modify or create a variable in Apache Airflow by specifying its key, value, and optional description. Ensures consistent variable management via the MCP Server.

Instructions

Update a variable by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
keyYes
valueNo

Implementation Reference

  • Registers the update_variable tool (and others) by including it in the tuple list returned for tool registration.
    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), ]
  • The main handler function that performs the update_variable tool logic using Airflow's VariableApi to patch the variable.
    async def update_variable( key: str, value: Optional[str] = None, description: Optional[str] = None ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: update_request = {} if value is not None: update_request["value"] = value if description is not None: update_request["description"] = description response = variable_api.patch_variable( variable_key=key, update_mask=list(update_request.keys()), variable_request=update_request ) return [types.TextContent(type="text", text=str(response.to_dict()))]

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