Skip to main content
Glama
aliyun

Alibaba Cloud DMS MCP Server

Official
by aliyun

createDataChangeOrder

Destructive

Execute SQL changes through a formal data change order in Alibaba Cloud DMS, returning an order ID for tracking and compliance purposes.

Instructions

Execute SQL changes through a data change order, and a corresponding order ID will be returned. Prefer using the executeScript tool for SQL execution;only use this tool when explicitly instructed to perform the operation via a order.If you don't know the databaseId, first use getDatabase or searchDatabase to retrieve it. (1) If you have the exact host, port, and database name, use getDatabase. (2) If you only know the database name, use searchDatabase. (3) If you don't know any information, ask the user to provide the necessary details. Note: searchDatabase may return multiple databases. In this case, let the user choose which one to use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYesRequired DMS databaseId. Obtained via getDatabase tool
scriptYesSQL script to execute
logicNoWhether to use logical execution mode

Implementation Reference

  • Core handler function implementing the logic to create a data change order via Alibaba Cloud DMS API. Constructs the request parameters including SQL script, database ID, and logic mode, then invokes the API.
    async def create_data_change_order(
            database_id: str = Field(description="DMS databaseId"),
            script: str = Field(description="SQL script to execute"),
            logic: bool = Field(default=False, description="Whether to use logical execution mode")
    ) -> Dict[str, Any]:
        client = create_client()
        req = dms_enterprise_20181101_models.CreateDataCorrectOrderRequest()
        req.comment = "Data correct order submitted by MCP"
    
        param = dms_enterprise_20181101_models.CreateDataCorrectOrderRequestParam()
        param.estimate_affect_rows = 1
        param.sql_type = "TEXT"
        param.exec_sql = script
        param.classify = "MCP"
    
        db_list = dms_enterprise_20181101_models.CreateDataCorrectOrderRequestParamDbItemList()
        db_list.db_id = database_id
        db_list.logic = logic
    
        db_items = [db_list]
        param.db_item_list = db_items
    
        req.param = param
        try:
            resp = client.create_data_correct_order(req)
            return resp.body.to_map()
        except Exception as e:
            logger.error(f"Error in create_data_change_order: {e}")
            raise
  • Tool registration for pre-configured database mode, using default_database_id. Wrapper calls the core handler.
    @self.mcp.tool(name="createDataChangeOrder",
                   description="Execute SQL changes through a data change order, and a corresponding order ID will be returned. "
                               "Prefer using the executeScript tool for SQL execution; "
                               "only use this tool when explicitly instructed to perform the operation via a order.",
                   annotations={"title": "在DMS中创建数据变更工单", "readOnlyHint": False, "destructiveHint": True})
    async def create_data_change_order_configured(
            script: str = Field(description="SQL script to execute")
    ) -> str:
        result_obj = await create_data_change_order(database_id=self.default_database_id, script=script,
                                                    logic=False)
        return str(result_obj)
  • Tool registration for full toolset, requiring explicit database_id. Wrapper calls the core handler.
    @self.mcp.tool(name="createDataChangeOrder",
                   description=f"Execute SQL changes through a data change order, and a corresponding order ID will be returned. "
                               f"Prefer using the executeScript tool for SQL execution;"
                               f"only use this tool when explicitly instructed to perform the operation via a order."
                               f"{DATABASE_ID_DESCRIPTION}",
                   annotations={"title": "在DMS中创建数据变更工单", "readOnlyHint": False, "destructiveHint": True})
    async def create_data_change_order_wrapper(
            database_id: str = Field(description="Required DMS databaseId. Obtained via getDatabase tool"),
            script: str = Field(description="SQL script to execute"),
            logic: bool = Field(description="Whether to use logical execution mode", default=False)
    ) -> str:  # Return string representation
        result_obj = await create_data_change_order(database_id=database_id, script=script, logic=logic)
        return str(result_obj)
Behavior4/5

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

The description adds valuable behavioral context beyond annotations. While annotations indicate destructiveHint=true (implying data modification), the description clarifies this is for 'SQL changes' and specifies that an 'order ID will be returned' - important information about the workflow. It also mentions the need for explicit instruction to use this tool, suggesting it's part of a controlled process. No contradiction with annotations exists.

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 appropriately sized and front-loaded with the core purpose in the first sentence. The subsequent guidance about tool selection and database_id acquisition is necessary but could be slightly more streamlined. Every sentence serves a clear purpose in helping the agent use the tool correctly.

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

Completeness4/5

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

Given this is a destructive operation with no output schema, the description provides good contextual completeness. It explains the purpose, when to use it, prerequisites for parameters, and the expected outcome (order ID returned). The main gap is lack of information about what happens after order creation (e.g., approval workflow hinted at by submitOrderApproval sibling), but the description covers the essential context for correct tool invocation.

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?

With 100% schema description coverage, the baseline is 3. The description doesn't add significant parameter semantics beyond what's in the schema, though it does reinforce that database_id should be obtained via getDatabase tool. The schema already documents all three parameters adequately with descriptions.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Execute SQL changes through a data change order, and a corresponding order ID will be returned.' It specifies the verb ('execute SQL changes'), resource ('data change order'), and outcome ('order ID returned'). It also distinguishes from sibling tools by explicitly mentioning 'executeScript' as the preferred alternative for SQL execution.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs. alternatives: 'Prefer using the executeScript tool for SQL execution; only use this tool when explicitly instructed to perform the operation via a order.' It also includes detailed prerequisites for obtaining the database_id parameter with step-by-step instructions for using getDatabase or searchDatabase, and what to do if information is missing.

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/aliyun/alibabacloud-dms-mcp-server'

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