Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_variable

Retrieve configuration values from Apache Airflow using a specific key to access stored variables for workflow automation.

Instructions

Get a variable by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes

Implementation Reference

  • The core handler function for the 'get_variable' tool. It calls the Airflow VariableApi to retrieve the variable by key and formats the response as MCP TextContent.
    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()))]
  • Registration of the 'get_variable' tool within the list of functions returned by get_all_functions(), which is used by main.py to add the tools to the MCP server.
    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:38-38 (registration)
    Mapping of APIType.VARIABLE to get_variable_functions (alias for get_all_functions from variable.py), enabling dynamic tool registration for variables.
    APIType.VARIABLE: get_variable_functions,
  • src/main.py:95-96 (registration)
    The dynamic registration loop where tools, including 'get_variable', are added to the MCP app using Tool.from_function.
    for func, name, description, *_ in functions:
        app.add_tool(Tool.from_function(func, name=name, description=description))
  • Initialization of the variable_api client used by the get_variable handler.
    variable_api = VariableApi(api_client)
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action 'get' without detailing behavioral traits such as read-only nature, error handling (e.g., if the key doesn't exist), permissions required, or rate limits. This lack of information makes it inadequate for understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence 'Get a variable by key', which is front-loaded and wastes no words. While it lacks depth, it efficiently communicates the core action without unnecessary elaboration, making it structurally sound for its brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a retrieval operation with 1 parameter), lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't cover what the tool returns, error conditions, or behavioral context, making it insufficient for the agent to understand and use the tool effectively in this environment.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, meaning the schema provides no details about the 'key' parameter. The description adds no semantic information beyond implying the parameter is used to retrieve a variable, failing to explain what the key represents, its format, or examples. This leaves the parameter undocumented and unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get a variable by key' is a tautology that essentially restates the tool name 'get_variable' with minimal elaboration. It specifies the verb 'get' and resource 'variable', but lacks specificity about what a 'variable' represents in this context (e.g., configuration, environment, or data variable) and doesn't differentiate from sibling tools like 'get_value' or 'list_variables', making it vague and minimally informative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools such as 'list_variables' for browsing or 'get_value' for similar retrieval, nor does it specify prerequisites like authentication or context. This absence of usage context leaves the agent without direction for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/yangkyeongmo/mcp-server-apache-airflow'

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