Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

list_variables

Retrieve and display all variables stored in Apache Airflow for configuration management and workflow parameterization.

Instructions

List all variables

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
order_byNo

Implementation Reference

  • The async handler function implementing the 'list_variables' tool. It calls the Airflow VariableApi to list variables with optional limit, offset, and order_by parameters, returning the response as TextContent.
    async def list_variables(
        limit: Optional[int] = None,
        offset: Optional[int] = None,
        order_by: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        # Build parameters dictionary
        kwargs: Dict[str, Any] = {}
        if limit is not None:
            kwargs["limit"] = limit
        if offset is not None:
            kwargs["offset"] = offset
        if order_by is not None:
            kwargs["order_by"] = order_by
    
        response = variable_api.get_variables(**kwargs)
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • The get_all_functions() in variable.py that registers the list_variables tool along with other variable tools by returning the tuple (function, name, description, read_only).
    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:19-20 (registration)
    Import of get_all_functions from variable.py in the main.py file, aliased as get_variable_functions for top-level tool registration.
    from src.airflow.variable import get_all_functions as get_variable_functions
    from src.airflow.xcom import get_all_functions as get_xcom_functions
  • src/main.py:38-39 (registration)
    Mapping of APIType.VARIABLE to the variable functions getter in the APITYPE_TO_FUNCTIONS dict used in main() to load tools.
    APIType.VARIABLE: get_variable_functions,
    APIType.XCOM: get_xcom_functions,
  • src/main.py:95-96 (registration)
    The loop in main.py that adds each tool (including list_variables) 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))
Behavior1/5

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

With no annotations provided, the description carries full burden but discloses no behavioral traits. It doesn't mention whether this is a read-only operation, potential side effects, authentication needs, rate limits, or return format, making it inadequate for a tool with parameters.

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 three-word phrase, 'List all variables,' which is front-loaded and wastes no words. While under-specified, it is structurally efficient without redundancy.

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 no annotations, 0% schema coverage, three parameters, and no output schema, the description is severely incomplete. It lacks essential details on behavior, parameters, and output, failing to provide adequate context for tool invocation.

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?

Schema description coverage is 0%, and the description adds no information about the three parameters (limit, offset, order_by). It fails to explain their purposes, such as pagination or sorting, leaving parameters 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 'List all variables' restates the tool name 'list_variables' with minimal elaboration, making it tautological. It specifies the resource ('variables') and action ('list') but lacks detail on scope or format, failing to distinguish from siblings like 'get_variable' or 'delete_variable'.

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?

No guidance is provided on when to use this tool versus alternatives such as 'get_variable' for retrieving a single variable or 'delete_variable' for removal. The description offers no context, prerequisites, or exclusions, leaving usage ambiguous.

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