Skip to main content
Glama
aliyun

Alibaba Cloud RDS OpenAPI MCP Server

Official
by aliyun

create_db_instance

Create a new RDS database instance on Alibaba Cloud by specifying region, engine type, storage, and network configuration to deploy managed database services.

Instructions

Create an RDS instance.

Args:
    region_id: Region ID.
    engine: Database type (MySQL, SQLServer, PostgreSQL, MariaDB).
    engine_version: Database version.
    dbinstance_class: Instance specification. Query available class_codes by `describe_available_classes`.
    dbinstance_storage: Storage space in GB.
    security_ip_list: IP whitelist, separated by commas. Default: "127.0.0.1".
    instance_network_type: Network type (Classic, VPC). Default: VPC.
    zone_id: Zone ID. Query available zones by `describe_available_zones`.
    zone_id_slave1: Slave Node1 Zone ID. Query available zones by `describe_available_zones`.
    zone_id_slave2: Slave Node2 Zone ID. Query available zones by `describe_available_zones`.
    pay_type: Payment type (Postpaid, Prepaid). Default: Postpaid.
    instance_charge_type: Instance charge type.
    system_db_charset: Character set.
    dbinstance_net_type: Network connection type (Internet, Intranet). Default: Internet.
    category: Instance category. Default: Basic.
    dbinstance_storage_type: Storage type. (e.g. local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3)
    vpc_id: VPC ID.
    vswitch_id: VSwitch ID.
    private_ip_address: Private IP address.
    client_token: Idempotence token.
    resource_group_id: Resource group ID.
    tde_status: TDE status (Enable, Disable).
    encryption_key: Custom encryption key.
    serverless_config: Serverless instance configuration.
    table_names_case_sensitive: Are table names case-sensitive.
    db_time_zone: the db instance time zone.
    connection_string: the connection string for db instance.
    db_param_group_id: the db param group id for db instance.
Returns:
    Dict[str, Any]: Response containing the created instance details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_idYes
engineYes
engine_versionYes
dbinstance_classYes
dbinstance_storageYes
vpc_idYes
vswitch_idYes
zone_idYes
zone_id_slave1No
zone_id_slave2No
security_ip_listNo127.0.0.1
instance_network_typeNoVPC
pay_typeNoPostpaid
system_db_charsetNo
dbinstance_net_typeNoInternet
categoryNoBasic
dbinstance_storage_typeNo
private_ip_addressNo
client_tokenNo
resource_group_idNo
tde_statusNo
encryption_keyNo
serverless_configNo
table_names_case_sensitiveNo
db_time_zoneNo
connection_stringNo
db_param_group_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the 'create_db_instance' MCP tool. It constructs a CreateDBInstanceRequest using Alibaba Cloud RDS SDK models and calls the API via get_rds_client to create a new RDS database instance.
    async def create_db_instance(
            region_id: str,
            engine: str,
            engine_version: str,
            dbinstance_class: str,
            dbinstance_storage: int,
            vpc_id: str,
            vswitch_id: str,
            zone_id: str,
            zone_id_slave1: str = None,
            zone_id_slave2: str = None,
            security_ip_list: str = "127.0.0.1",
            instance_network_type: str = "VPC",
            pay_type: str = "Postpaid",
            system_db_charset: str = None,
            dbinstance_net_type: str = "Internet",
            category: str = "Basic",
            dbinstance_storage_type: str = None,
            private_ip_address: str = None,
            client_token: str = None,
            resource_group_id: str = None,
            tde_status: str = None,
            encryption_key: str = None,
            serverless_config: Dict[str, Any] = None,
            table_names_case_sensitive: bool = False,
            db_time_zone: str = None,
            connection_string: str = None,
            db_param_group_id: str = None,
    ) -> Dict[str, Any]:
        """Create an RDS instance.
    
        Args:
            region_id: Region ID.
            engine: Database type (MySQL, SQLServer, PostgreSQL, MariaDB).
            engine_version: Database version.
            dbinstance_class: Instance specification. Query available class_codes by `describe_available_classes`.
            dbinstance_storage: Storage space in GB.
            security_ip_list: IP whitelist, separated by commas. Default: "127.0.0.1".
            instance_network_type: Network type (Classic, VPC). Default: VPC.
            zone_id: Zone ID. Query available zones by `describe_available_zones`.
            zone_id_slave1: Slave Node1 Zone ID. Query available zones by `describe_available_zones`.
            zone_id_slave2: Slave Node2 Zone ID. Query available zones by `describe_available_zones`.
            pay_type: Payment type (Postpaid, Prepaid). Default: Postpaid.
            instance_charge_type: Instance charge type.
            system_db_charset: Character set.
            dbinstance_net_type: Network connection type (Internet, Intranet). Default: Internet.
            category: Instance category. Default: Basic.
            dbinstance_storage_type: Storage type. (e.g. local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3)
            vpc_id: VPC ID.
            vswitch_id: VSwitch ID.
            private_ip_address: Private IP address.
            client_token: Idempotence token.
            resource_group_id: Resource group ID.
            tde_status: TDE status (Enable, Disable).
            encryption_key: Custom encryption key.
            serverless_config: Serverless instance configuration.
            table_names_case_sensitive: Are table names case-sensitive.
            db_time_zone: the db instance time zone.
            connection_string: the connection string for db instance.
            db_param_group_id: the db param group id for db instance.
        Returns:
            Dict[str, Any]: Response containing the created instance details.
        """
        try:
            client = get_rds_client(region_id)
    
            request = rds_20140815_models.CreateDBInstanceRequest(
                region_id=region_id,
                engine=engine,
                engine_version=engine_version,
                dbinstance_class=dbinstance_class,
                dbinstance_storage=dbinstance_storage,
                security_iplist=security_ip_list,
                instance_network_type=instance_network_type,
                dbis_ignore_case=str(not table_names_case_sensitive).lower(),
                dbtime_zone=db_time_zone,
                connection_string=connection_string,
                dbparam_group_id=db_param_group_id
            )
    
            # Add optional parameters
            if zone_id:
                request.zone_id = zone_id
            if zone_id_slave1:
                request.zone_id_slave_1 = zone_id_slave1
            if zone_id_slave2:
                request.zone_id_slave_2 = zone_id_slave2
            if pay_type:
                request.pay_type = pay_type
            if system_db_charset:
                request.system_dbcharset = system_db_charset
            if dbinstance_net_type:
                request.dbinstance_net_type = dbinstance_net_type
            if category:
                request.category = category
            if dbinstance_storage_type:
                request.dbinstance_storage_type = dbinstance_storage_type
            if vpc_id:
                request.vpcid = vpc_id
            if vswitch_id:
                request.v_switch_id = vswitch_id
            if private_ip_address:
                request.private_ip_address = private_ip_address
            if client_token:
                request.client_token = client_token
            if resource_group_id:
                request.resource_group_id = resource_group_id
            if tde_status:
                request.tde_status = tde_status
            if encryption_key:
                request.encryption_key = encryption_key
            if serverless_config:
                request.serverless_config = json.dumps(serverless_config)
    
            response = client.create_dbinstance(request)
            return response.body.to_map()
    
        except Exception as e:
            logger.error(f"Error occurred while creating RDS instance: {str(e)}")
            raise e
  • Helper function to create and configure the Alibaba Cloud RDS SDK client used by the create_db_instance handler.
    def get_rds_client(region_id: str):
        ak, sk, sts = get_aksk()
        config = Config(
            access_key_id=ak,
            access_key_secret=sk,
            security_token=sts,
            region_id=region_id,
            protocol="https",
            connect_timeout=10 * 1000,
            read_timeout=300 * 1000
        )
        client = RdsClient(config)
        return client
  • Initialization of the RdsMCP server instance where tools like create_db_instance are registered via decorators.
    logger = logging.getLogger(__name__)
    mcp = RdsMCP("Alibaba Cloud RDS OPENAPI", port=os.getenv("SERVER_PORT", 8000), stateless_http=True)
    try:
  • Activation of the MCP server, which registers all pending tools including create_db_instance based on enabled groups.
    mcp.activate(enabled_groups=enabled_groups)
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. It states 'Create an RDS instance' which implies a write/mutation operation, but doesn't mention permissions required, costs, time to provision, idempotence (though 'client_token' hints at it), or error handling. The description lacks critical behavioral context for a complex creation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The description is appropriately front-loaded with the core purpose, but the parameter documentation is lengthy (27 items). While necessary given the schema gap, it could be more structured (e.g., grouping related parameters). Some sentences are efficient, but overall it's verbose due to the parameter details.

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 the high complexity (27 parameters, 8 required), no annotations, and an output schema present, the description does well by documenting all parameters thoroughly. The output schema handles return values, so the description doesn't need to explain them. However, it lacks behavioral context (e.g., creation process, errors), which is a gap for such a critical tool.

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

Parameters5/5

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

With 0% schema description coverage, the description compensates fully by providing detailed semantics for all 27 parameters. It explains each parameter's purpose, provides examples (e.g., engine types, storage types), default values, and references to sibling tools for querying values. This adds significant value beyond the bare schema.

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 tool's purpose: 'Create an RDS instance.' This is a specific verb ('Create') with a clear resource ('RDS instance'), distinguishing it from sibling tools like 'describe_db_instances' or 'modify_db_instance_spec'. However, it doesn't explicitly differentiate from other creation tools like 'create_db_instance_account', though the resource focus (instance vs. account) is implied.

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 mentions querying 'describe_available_classes' and 'describe_available_zones' for parameter values, but doesn't explain prerequisites, dependencies, or when to choose this over other tools like 'modify_db_instance_spec' for updates. Usage context is implied but not explicit.

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-rds-openapi-mcp-server'

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