Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

get_connection

Retrieve connection details from Apache Airflow by specifying the connection ID to access configuration data for external systems.

Instructions

Get a connection by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conn_idYes

Implementation Reference

  • The handler function that executes the 'get_connection' tool logic: retrieves the Airflow connection by ID and returns it as formatted text content.
    async def get_connection(conn_id: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        response = connection_api.get_connection(connection_id=conn_id)
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Local registration of connection tools, including 'get_connection' in the list returned for MCP tool registration.
    def get_all_functions() -> list[tuple[Callable, str, str, bool]]:
        """Return list of (function, name, description, is_read_only) tuples for registration."""
        return [
            (list_connections, "list_connections", "List all connections", True),
            (create_connection, "create_connection", "Create a connection", False),
            (get_connection, "get_connection", "Get a connection by ID", True),
            (update_connection, "update_connection", "Update a connection by ID", False),
            (delete_connection, "delete_connection", "Delete a connection by ID", False),
            (test_connection, "test_connection", "Test a connection", True),
        ]
  • src/main.py:7-26 (registration)
    Import of get_all_functions as get_connection_functions and its mapping to APIType.CONNECTION for global tool registration.
    from src.airflow.connection import get_all_functions as get_connection_functions
    from src.airflow.dag import get_all_functions as get_dag_functions
    from src.airflow.dagrun import get_all_functions as get_dagrun_functions
    from src.airflow.dagstats import get_all_functions as get_dagstats_functions
    from src.airflow.dataset import get_all_functions as get_dataset_functions
    from src.airflow.eventlog import get_all_functions as get_eventlog_functions
    from src.airflow.importerror import get_all_functions as get_importerror_functions
    from src.airflow.monitoring import get_all_functions as get_monitoring_functions
    from src.airflow.plugin import get_all_functions as get_plugin_functions
    from src.airflow.pool import get_all_functions as get_pool_functions
    from src.airflow.provider import get_all_functions as get_provider_functions
    from src.airflow.taskinstance import get_all_functions as get_taskinstance_functions
    from src.airflow.variable import get_all_functions as get_variable_functions
    from src.airflow.xcom import get_all_functions as get_xcom_functions
    from src.enums import APIType
    from src.envs import READ_ONLY
    
    APITYPE_TO_FUNCTIONS = {
        APIType.CONFIG: get_config_functions,
        APIType.CONNECTION: get_connection_functions,
  • src/main.py:95-96 (registration)
    The code that adds the tools (including get_connection) 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))
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a read operation ('Get'), implying non-destructive behavior, but doesn't disclose error handling (e.g., what happens if the ID is invalid), authentication needs, rate limits, or return format. This leaves significant behavioral gaps for a tool with no annotation coverage.

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 at 4 words, front-loaded with the core action, and has zero wasted words. It efficiently communicates the basic purpose without unnecessary elaboration.

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

Completeness2/5

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

Given 1 parameter with no schema descriptions, no annotations, and no output schema, the description is incomplete. It doesn't explain what a 'connection' is, how to obtain IDs, what data is returned, or error cases, making it inadequate for effective tool use in this context.

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

Parameters2/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, and the description adds minimal meaning beyond the schema. It mentions 'by ID' which clarifies the parameter's purpose, but doesn't explain what a 'conn_id' is (e.g., format, source, or constraints), failing to compensate for the low schema coverage.

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

Purpose3/5

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

The description 'Get a connection by ID' clearly states the verb ('Get') and resource ('connection'), but it's vague about what a 'connection' entails in this context. It distinguishes from siblings like 'list_connections' by specifying retrieval by ID rather than listing, but lacks specificity about the connection type or system.

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

Usage Guidelines2/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. It doesn't mention prerequisites (e.g., needing a valid connection ID), exclusions, or compare it to siblings like 'list_connections' for browsing or 'test_connection' for validation.

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