Skip to main content
Glama
aliyun

Alibaba Cloud DMS MCP Server

Official
by aliyun

getInstance

Read-only

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)
Behavior3/5

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

Annotations already declare readOnlyHint=true, indicating this is a safe read operation. The description adds that it retrieves 'detailed instance information', which provides some context about the scope of data returned. However, it doesn't disclose additional behavioral traits like authentication needs, rate limits, or what 'detailed' entails, missing opportunities to enhance transparency beyond 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 a single, efficient sentence that front-loads the core purpose ('Retrieve detailed instance information') and specifies the required parameters. Every word contributes to understanding without redundancy, making it appropriately sized and well-structured.

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

Completeness3/5

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

Given the tool's moderate complexity (3 parameters, no output schema) and good annotations (readOnlyHint), the description is minimally adequate. It states what the tool does but lacks details on output format, error handling, or when to use versus siblings. With no output schema, more information on return values would improve completeness, but it's not critically incomplete.

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?

Schema description coverage is 100%, with clear descriptions for each parameter (e.g., host as 'hostname of the database instance', port as 'connection port number', sid as 'required for Oracle like databases'). The description mentions host and port but doesn't add meaning beyond the schema, such as format examples or usage context, so it meets the baseline for high schema coverage.

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 action ('Retrieve detailed instance information') and the resource ('from DMS'), specifying the verb and target. However, it doesn't explicitly differentiate from sibling tools like 'listInstances' or 'getDatabase', which reduces clarity about when to use this specific retrieval tool versus alternatives.

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 like 'listInstances' or 'getDatabase'. It mentions the required parameters (host and port) but doesn't explain the context or prerequisites for retrieving instance details, leaving the agent without usage direction.

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