list_variables
Retrieve and manage Airflow variables by listing their keys, values, and descriptions. Supports pagination, sorting, and customizable limits for efficient data access.
Instructions
[Tool Role]: Lists all variables stored in Airflow.
Args: limit: Maximum number of variables to return (default: 20) offset: Number of variables to skip for pagination (default: 0) order_by: Order variables by field (key, description) (default: key)
Returns: List of variables with their keys, values, and descriptions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| order_by | No | key |
Implementation Reference
- The main handler function for the 'list_variables' tool. It makes an API request to list Airflow variables with optional pagination using limit and offset parameters.async def list_variables(limit: int = 20, offset: int = 0) -> Dict[str, Any]: """[Tool Role]: Lists all variables in Airflow.""" params = {'limit': limit, 'offset': offset} query_string = "&".join([f"{k}={v}" for k, v in params.items()]) resp = await airflow_request("GET", f"/variables?{query_string}") resp.raise_for_status() return resp.json()