delete_variable
Remove a specific variable from Apache Airflow by providing its key, enabling cleanup of configuration data in Airflow deployments including Astronomer Cloud.
Instructions
Delete a variable by key
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes |
Input Schema (JSON Schema)
{
"properties": {
"key": {
"title": "Key",
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
}
Implementation Reference
- src/airflow/variable.py:74-76 (handler)The async handler function that deletes the specified Airflow variable using the VariableApi and returns a formatted text response.async def delete_variable(key: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = variable_api.delete_variable(variable_key=key) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/variable.py:11-19 (registration)The function that returns the list of tool registrations, including the 'delete_variable' tool.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), ]