Skip to main content
Glama
aliyun

Alibaba Cloud DMS MCP Server

Official
by aliyun

getDatabase

Read-only

Retrieve detailed metadata about a specific database in Alibaba Cloud DMS by providing host, port, and schema name for cross-engine data management.

Instructions

Obtain detailed information about a specific database in DMS when the host and port are provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesHostname or IP of the database instance
portYesConnection port number
schema_nameYesName of the database schema
sidNoRequired for Oracle like databases

Implementation Reference

  • The handler function that implements the core logic of the getDatabase tool by calling the Alibaba Cloud DMS Enterprise API's get_database method with the provided host, port, schema_name, and optional sid.
    async def get_database(
            host: str = Field(description="Hostname or IP of the database instance"),
            port: str = Field(description="Connection port number"),
            schema_name: str = Field(description="Name of the database schema"),
            sid: Optional[str] = Field(default=None, description="Required for Oracle like databases")
    ) -> DatabaseDetail:
        client = create_client()
        req = dms_enterprise_20181101_models.GetDatabaseRequest(host=host, port=port, schema_name=schema_name)
    
        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_database(req)
            db_data = resp.body.to_map().get('Database', {}) if resp and resp.body else {}
            return DatabaseDetail(**db_data)
        except Exception as e:
            logger.error(f"Error in get_database: {e}")
            raise
  • Registration of the 'getDatabase' tool in the full toolset using FastMCP's tool decorator, which binds the get_database handler function and provides description and annotations.
    self.mcp.tool(name="getDatabase",
                  description="Obtain detailed information about a specific database in DMS when the host and port are provided.",
                  annotations={"title": "获取DMS数据库详情", "readOnlyHint": True})(get_database)
  • Pydantic model defining the structure and field descriptions for the output of the getDatabase tool.
    class DatabaseDetail(MyBaseModel):
        DatabaseId: Any = Field(description="Unique database identifier in DMS", default=None)
        SchemaName: Any = Field(description="Name of the database schema", default=None)
        DbType: Any = Field(description="Database Engine type", default=None)
        InstanceAlias: Any = Field(description="Instance alias in DMS", default=None)
        InstanceId: Any = Field(description="Instance identifier in DMS", default=None)
        State: Any = Field(description="Current operational status", default=None)
Behavior3/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 context about requiring host and port, which is useful beyond annotations. However, it doesn't disclose additional behavioral traits like error handling, response format, or any rate limits, leaving some gaps in transparency.

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 a single, clear sentence that efficiently conveys the core purpose and prerequisite. It's appropriately sized without unnecessary details, though it could be slightly more structured to front-load key information more effectively.

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 complexity (4 parameters, no output schema) and annotations covering safety, the description is adequate but incomplete. It lacks details on what 'detailed information' includes, error scenarios, or output format, which would help the agent understand the full context of use.

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%, so parameters are well-documented in the schema. The description adds minimal value by mentioning host and port as required, but doesn't elaborate on parameter meanings beyond what the schema already provides. This 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 ('Obtain detailed information') and resource ('about a specific database in DMS'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'getInstance' or 'searchDatabase', which might offer similar database-related information, so it doesn't reach the highest score.

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

Usage Guidelines3/5

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

The description implies usage when 'host and port are provided', suggesting a prerequisite context, but it doesn't specify when to use this tool versus alternatives like 'getInstance' or 'searchDatabase'. No explicit when-not or alternative guidance is provided, leaving usage somewhat ambiguous.

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