Skip to main content
Glama
yangkyeongmo

MCP Server for Apache Airflow

by yangkyeongmo

update_connection

Modify connection parameters in Apache Airflow by specifying the connection ID and updating fields like host, port, or credentials.

Instructions

Update a connection by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conn_idYes
conn_typeNo
hostNo
portNo
loginNo
passwordNo
schemaNo
extraNo

Implementation Reference

  • Implements the core logic for updating an Airflow connection using the ConnectionApi.patch_connection method. Builds an update_request dictionary from provided optional parameters and applies the patch.
    async def update_connection(
        conn_id: str,
        conn_type: Optional[str] = None,
        host: Optional[str] = None,
        port: Optional[int] = None,
        login: Optional[str] = None,
        password: Optional[str] = None,
        schema: Optional[str] = None,
        extra: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        update_request = {}
        if conn_type is not None:
            update_request["conn_type"] = conn_type
        if host is not None:
            update_request["host"] = host
        if port is not None:
            update_request["port"] = port
        if login is not None:
            update_request["login"] = login
        if password is not None:
            update_request["password"] = password
        if schema is not None:
            update_request["schema"] = schema
        if extra is not None:
            update_request["extra"] = extra
    
        response = connection_api.patch_connection(
            connection_id=conn_id, update_mask=list(update_request.keys()), connection_request=update_request
        )
        return [types.TextContent(type="text", text=str(response.to_dict()))]
  • Defines the list of connection-related tools, including 'update_connection', which is later imported in src/main.py and registered dynamically via app.add_tool based on the API type.
    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),
        ]
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Update' implies mutation, but the description doesn't state what permissions are required, whether the update is partial or complete, what happens to unspecified fields, or what the response looks like. This is a significant gap for a mutation 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.

Conciseness4/5

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

The description is extremely concise with just 5 words, making it front-loaded and efficient. However, this conciseness comes at the cost of completeness - it's arguably under-specified rather than optimally concise.

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?

For a mutation tool with 8 parameters, 0% schema description coverage, no annotations, and no output schema, the description is completely inadequate. It doesn't explain what a 'connection' is in this context, what fields can be updated, what the update behavior entails, or what to expect as a result.

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?

With 0% schema description coverage for 8 parameters, the description provides no information about parameter meanings beyond the obvious 'conn_id'. It doesn't explain what 'conn_type', 'host', 'port', 'login', 'password', 'schema', or 'extra' represent or how they relate to connection updates, failing to compensate for the schema coverage gap.

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 'Update a connection by ID' clearly states the verb (update) and resource (connection), but it's vague about what aspects of a connection can be updated. It doesn't distinguish this tool from sibling tools like 'patch_dag' or 'update_variable' that also perform updates on different resources.

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 about when to use this tool versus alternatives. There's no mention of prerequisites (like needing an existing connection ID), when-not-to-use scenarios, or comparison with related tools like 'create_connection' or 'delete_connection' in the sibling list.

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