Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

delete_connection

Remove a connection from Apache Airflow by specifying its unique ID to manage database and external service configurations.

Instructions

Delete a connection by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conn_idYes

Implementation Reference

  • The core handler function that executes the deletion of a connection by calling the Airflow ConnectionApi.
    async def delete_connection(conn_id: str) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        response = connection_api.delete_connection(connection_id=conn_id)
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Registers the delete_connection tool (line 18) among other connection tools by including it 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)
    Imports the get_all_functions from connection.py and maps APIType.CONNECTION to it in the central APITYPE_TO_FUNCTIONS dictionary used for 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,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Delete' implies a destructive mutation, but it doesn't specify if this is permanent, reversible, requires specific permissions, or has side effects (e.g., affecting dependent DAGs). This is a significant gap for a destructive tool with zero 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 a single, efficient sentence with zero waste—it directly states the action and required parameter. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 this is a destructive tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It lacks critical details like behavioral traits, parameter specifics, and expected outcomes, which are essential for safe and effective use.

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

Parameters3/5

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

The schema description coverage is 0%, so the description must compensate. It mentions 'by ID', which adds meaning to the 'conn_id' parameter by indicating it's an identifier, but doesn't explain the ID format, source, or constraints. This provides some value but doesn't fully compensate for the coverage gap.

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

Purpose4/5

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

The description clearly states the verb ('Delete') and resource ('a connection by ID'), making the purpose unambiguous. However, it doesn't distinguish this tool from other deletion tools like delete_dag, delete_dag_run, or delete_variable, which would require mentioning what type of connection is being deleted or its context.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing the connection ID from get_connection or list_connections), when not to use it, or how it differs from update_connection or clear_dag_run for related operations.

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