Skip to main content
Glama

get_variable

Retrieve specific Airflow variables by their key, including metadata such as value and description, simplifying variable management and configuration within Apache Airflow clusters.

Instructions

[Tool Role]: Retrieves a specific variable by its key from Airflow.

Args: variable_key: The key of the variable to retrieve

Returns: Variable information including key, value, and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variable_keyYes

Implementation Reference

  • The core handler implementation for the 'get_variable' tool. This async function fetches the value of a specific Airflow variable using the Airflow REST API endpoint `/variables/{variable_key}`. The @mcp.tool() decorator both defines the tool schema via type hints/docstring and registers it when executed.
    @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()
  • Registration call in v1_tools.py that invokes register_common_tools(mcp), which defines and registers the get_variable tool (among 56 common tools) for Airflow API v1.
    common_tools.register_common_tools(mcp)
  • Registration call in v2_tools.py that invokes register_common_tools(mcp), which defines and registers the get_variable tool (among 56 common tools) for Airflow API v2.
    common_tools.register_common_tools(mcp)

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/call518/MCP-Airflow-API'

If you have feedback or need assistance with the MCP directory API, please join our Discord server