get_variable
Retrieve the value of a specific variable from Apache Airflow clusters to access configuration data or parameters for workflow management.
Instructions
[Tool Role]: Gets the value of a specific variable.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable_key | Yes |
Implementation Reference
- The core handler implementation for the 'get_variable' tool. This async function fetches the Airflow variable value via the API endpoint /variables/{variable_key} using the shared airflow_request function and returns the JSON response.@mcp.tool() async def get_variable(variable_key: str) -> Dict[str, Any]: """[Tool Role]: Gets the value of a specific variable.""" resp = await airflow_request("GET", f"/variables/{variable_key}") resp.raise_for_status() return resp.json()
- src/mcp_airflow_api/tools/v1_tools.py:23-23 (registration)Registration of the get_variable tool (via register_common_tools call) for Airflow API v1 compatibility.common_tools.register_common_tools(mcp)
- src/mcp_airflow_api/tools/v2_tools.py:24-24 (registration)Registration of the get_variable tool (via register_common_tools call) for Airflow API v2 compatibility.common_tools.register_common_tools(mcp)