Skip to main content
Glama
aliyun

Alibaba Cloud RDS OpenAPI MCP Server

Official
by aliyun

describe_available_classes

Read-only

Query available RDS instance classes and storage options for purchase based on region, engine type, payment model, and configuration requirements.

Instructions

Query the RDS instance class_code and storage space that can be purchased in the inventory.

Args:
    region_id: The region ID of the RDS instance.
    zone_id: The zone ID of the RDS instance. Query available zones by `describe_available_zones`.
    instance_charge_type: Instance payment type. Values: Prepaid, Postpaid, Serverless.
    engine: Database engine type. Values: MySQL, SQLServer, PostgreSQL, MariaDB.
    engine_version: Database version.
    dbinstance_storage_type: Storage type. Values: local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3
    category: Instance category. Values: Basic, HighAvailability, cluster, AlwaysOn, Finance, serverless_basic, serverless_standard, serverless_ha.
    dbinstance_id: The ID of the RDS instance.
    order_type: Order type. Currently only supports "BUY".
    commodity_code: Commodity code for read-only instances.

Returns:
    Dict[str, Any]: The response containing available instance classes and storage ranges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_idYes
zone_idYes
instance_charge_typeYes
engineYes
engine_versionYes
dbinstance_storage_typeYes
categoryYes
dbinstance_idNo
order_typeNo
commodity_codeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function implementing the 'describe_available_classes' tool. It calls the Alibaba Cloud RDS API to query available instance classes and storage spaces based on parameters like region, zone, engine, etc. The function is decorated with @mcp.tool() for registration in the MCP server.
    async def describe_available_classes(
            region_id: str,
            zone_id: str,
            instance_charge_type: str,
            engine: str,
            engine_version: str,
            dbinstance_storage_type: str,
            category: str,
            dbinstance_id: str = None,
            order_type: str = None,
            commodity_code: str = None
    ) -> Dict[str, Any]:
        """Query the RDS instance class_code and storage space that can be purchased in the inventory.
    
        Args:
            region_id: The region ID of the RDS instance.
            zone_id: The zone ID of the RDS instance. Query available zones by `describe_available_zones`.
            instance_charge_type: Instance payment type. Values: Prepaid, Postpaid, Serverless.
            engine: Database engine type. Values: MySQL, SQLServer, PostgreSQL, MariaDB.
            engine_version: Database version.
            dbinstance_storage_type: Storage type. Values: local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3
            category: Instance category. Values: Basic, HighAvailability, cluster, AlwaysOn, Finance, serverless_basic, serverless_standard, serverless_ha.
            dbinstance_id: The ID of the RDS instance.
            order_type: Order type. Currently only supports "BUY".
            commodity_code: Commodity code for read-only instances.
    
        Returns:
            Dict[str, Any]: The response containing available instance classes and storage ranges.
        """
        try:
            # Initialize the client
            client = get_rds_client(region_id)
    
            # Create request
            request = rds_20140815_models.DescribeAvailableClassesRequest(
                region_id=region_id,
                zone_id=zone_id,
                instance_charge_type=instance_charge_type,
                engine=engine,
                engine_version=engine_version,
                dbinstance_storage_type=dbinstance_storage_type,
                category=category
            )
    
            # Add optional parameters if provided
            if dbinstance_id:
                request.dbinstance_id = dbinstance_id
            if order_type:
                request.order_type = order_type
            if commodity_code:
                request.commodity_code = commodity_code
    
            # Make the API request
            response = client.describe_available_classes(request)
            return response.body.to_map()
    
        except Exception as e:
            logger.error(f"Error occurred while querying available classes: {str(e)}")
            raise OpenAPIError(f"Failed to query available instance classes: {str(e)}")
Behavior4/5

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

Annotations provide readOnlyHint=true, indicating a safe read operation. The description adds valuable behavioral context beyond this by specifying that it queries 'what can be purchased in the inventory,' implying it returns available options for provisioning rather than existing resources. It also mentions the return type and purpose, enhancing transparency without contradicting annotations.

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 efficiently structured with a clear purpose statement upfront, followed by organized sections for Args and Returns. Each sentence adds value without redundancy, making it easy to parse and understand the tool's functionality and usage.

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

Completeness5/5

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

Given the tool's complexity (10 parameters, 7 required) and the presence of an output schema, the description is complete. It explains the purpose, details all parameters, references related tools, and notes the return type, providing sufficient context for an agent to use the tool effectively without needing to explain return values explicitly.

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 fully compensates by providing detailed semantics for all 10 parameters, including explanations, allowed values, and references to sibling tools. This adds significant meaning beyond the bare schema, ensuring parameters are well-understood despite the schema's lack of 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 with specific verbs ('Query') and resources ('RDS instance class_code and storage space'), distinguishing it from siblings like 'describe_available_zones' (which queries zones) or 'describe_db_instances' (which lists existing instances). It explicitly identifies what information is retrieved, making the purpose unambiguous.

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

Usage Guidelines4/5

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

The description provides clear context for usage by listing required parameters and referencing a sibling tool ('describe_available_zones') for obtaining zone IDs. However, it does not explicitly state when to use this tool versus alternatives (e.g., when planning purchases vs. checking existing instances) or mention exclusions, which prevents a perfect score.

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