Skip to main content
Glama
nikhil-ganage

MCP Server Airflow Token

get_variable

Retrieve configuration values from Apache Airflow deployments by specifying a key, enabling AI assistants to access and use Airflow variables for workflow automation.

Instructions

Get a variable by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes

Implementation Reference

  • The main handler function for the 'get_variable' tool, which retrieves an Airflow variable by key using the VariableApi and returns its dict as text content.
    async def get_variable(key: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: response = variable_api.get_variable(variable_key=key) return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The function that returns the list of tool registrations, including the specific tuple for 'get_variable'.
    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), ]
  • src/main.py:90-92 (registration)
    Loop that registers each tool from the variable module (and others) by calling app.add_tool() with the function, name, and description.
    for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
  • src/main.py:36-36 (registration)
    Mapping of APIType.VARIABLE to the get_variable_functions which provides the tool list including 'get_variable'.
    APIType.VARIABLE: get_variable_functions,
  • src/main.py:18-18 (registration)
    Import of the function provider for variable tools in main.py.
    from src.airflow.variable import get_all_functions as get_variable_functions

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/nikhil-ganage/mcp-server-airflow-token'

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