Skip to main content
Glama

MCP Server Airflow Token

get_variable

Retrieve specific configuration variables from Apache Airflow deployments using their unique keys to access runtime parameters and settings.

Instructions

Get a variable by key

Input Schema

NameRequiredDescriptionDefault
keyYes

Input Schema (JSON Schema)

{ "properties": { "key": { "title": "Key", "type": "string" } }, "required": [ "key" ], "type": "object" }

Implementation Reference

  • The handler function implementing the 'get_variable' tool. It calls the Airflow VariableApi to fetch the variable by key and returns the response as a text content list.
    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 get_all_functions helper that provides the registration tuple for the 'get_variable' tool among others.
    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:36-36 (registration)
    Mapping of APIType.VARIABLE to the get_variable_functions (alias for get_all_functions from variable.py) for tool registration.
    APIType.VARIABLE: get_variable_functions,
  • src/main.py:90-91 (registration)
    The loop that registers each tool, including 'get_variable', by calling app.add_tool.
    for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
  • Import of the get_all_functions from variable.py, aliased for use in main.py registration.
    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