Skip to main content
Glama

MCP Server Airflow Token

create_variable

Define and store variables in Apache Airflow for use in workflows, supporting key-value pairs with optional descriptions.

Instructions

Create a variable

Input Schema

NameRequiredDescriptionDefault
descriptionNo
keyYes
valueYes

Input Schema (JSON Schema)

{ "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Description" }, "key": { "title": "Key", "type": "string" }, "value": { "title": "Value", "type": "string" } }, "required": [ "key", "value" ], "type": "object" }

Implementation Reference

  • The asynchronous handler function that executes the 'create_variable' tool. It takes key, value, and optional description, constructs a request, calls Airflow's VariableApi.post_variables, and returns the response as TextContent.
    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()))]
  • The get_all_functions() in variable.py that registers the create_variable tool (along with others) by returning a tuple (create_variable, "create_variable", "Create a variable", False). This is imported and used in src/main.py to add the tool to 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), ]

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