list_variables
Retrieve all variables stored in Apache Airflow for configuration management and workflow parameter access.
Instructions
[Tool Role]: Lists all variables in Airflow.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Implementation Reference
- The primary handler function for the 'list_variables' MCP tool. Decorated with @mcp.tool() for automatic registration. Fetches Airflow variables via the REST API with optional pagination parameters (limit and offset).@mcp.tool() 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()