Skip to main content
Glama
aliyun

Alibaba Cloud DMS MCP Server

Official
by aliyun

getInstance

Retrieve detailed database instance information from Alibaba Cloud DMS using host and port parameters to access metadata and perform cross-engine queries.

Instructions

Retrieve detailed instance information from DMS using the host and port.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesThe hostname of the database instance
portYesThe connection port number
sidNoRequired for Oracle like databases

Implementation Reference

  • The core handler function implementing the getInstance tool. It creates a DMS client, constructs a GetInstanceRequest with host/port/sid, calls the API, processes the response into an InstanceDetail model, and handles errors.
    async def get_instance( host: str = Field(description="The hostname of the database instance"), port: str = Field(description="The connection port number"), sid: Optional[str] = Field(default=None, description="Required for Oracle like databases") ) -> InstanceDetail: client = create_client() req = dms_enterprise_20181101_models.GetInstanceRequest(host=host, port=port) if sid: req.sid = sid if mcp.state.real_login_uid: req.real_login_user_uid = mcp.state.real_login_uid try: resp = client.get_instance(req) instance_data = resp.body.to_map().get('Instance', {}) if resp and resp.body else {} instance_data['InstanceResourceId'] = instance_data.pop('EcsInstanceId', None) return InstanceDetail(**instance_data) except Exception as e: logger.error(f"Error in get_instance: {e}") raise
  • Registers the 'getInstance' tool using the FastMCP framework, linking it to the get_instance handler function with description and annotations.
    self.mcp.tool(name="getInstance", description="Retrieve detailed instance information from DMS using the host and port.", annotations={"title": "获取DMS实例详情", "readOnlyHint": True})(get_instance)
  • Pydantic model defining the structured output schema for the getInstance tool response, including fields like InstanceId, State, Host, Port, etc.
    class InstanceDetail(MyBaseModel): InstanceId: Any = Field(description="Unique instance identifier in DMS", default=None) State: Any = Field(description="Current operational status", default=None) InstanceType: Any = Field(description="Database Engine type", default=None) InstanceAlias: Any = Field(description="Instance alias in DMS", default=None) EnvType: Any = Field(description="The environment type of the instance (e.g., production, development, etc.)", default=None) Host: Any = Field(description="The hostname of the database instance", default=None) Port: Any = Field(description="The connection port number", default=None) InstanceSource: Any = Field(description="The instance source (e.g., RDS, VPC_IDC, ECS_OWN, PUBLIC_OWN etc.)", default=None) InstanceResourceId: Any = Field( description="Resource ID of the instance from RDS", default=None)

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