Skip to main content
Glama
aliyun

Alibaba Cloud DMS MCP Server

Official
by aliyun

getTableDetailInfo

Read-only

Retrieve detailed metadata about database tables including schema and index information to understand table structure and relationships.

Instructions

Retrieve detailed metadata information about a specific database table including schema and index details. If you don't know the table_guid parameter, retrieve it using listTables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_guidYesUnique table identifier (format: dmsTableId.schemaName.tableName),Example: IDB_1567890.mySchema.myTable

Implementation Reference

  • The handler function that implements the getTableDetailInfo tool by calling the Alibaba Cloud DMS API to fetch table metadata including columns and indexes.
    async def get_meta_table_detail_info(
            table_guid: str = Field(
                description="Unique table identifier (format: dmsTableId.schemaName.tableName),Example: IDB_1567890.mySchema.myTable")
    ) -> TableDetail:
        client = create_client()
        req = dms_enterprise_20181101_models.GetMetaTableDetailInfoRequest(table_guid=table_guid)
        if mcp.state.real_login_uid:
            req.real_login_user_uid = mcp.state.real_login_uid
        try:
            resp = client.get_meta_table_detail_info(req)
            detail_info = resp.body.to_map().get('DetailInfo', {}) if resp and resp.body else {}
            return TableDetail(**detail_info)
        except Exception as e:
            logger.error(f"Error in get_meta_table_detail_info: {e}")
            raise
  • Pydantic models defining the structure of the table detail response, including Column, Index, and TableDetail.
    class Column(MyBaseModel):
        ColumnName: Any = Field(description="Name of the column")
        ColumnType: Any = Field(description="Full SQL type declaration (e.g., 'varchar(32)', 'bigint(20)')")
        AutoIncrement: Any = Field(description="Whether the column is an auto-increment field")
        Description: Any = Field(description="Column comment/description text")
        Nullable: Any = Field(description="Whether NULL values are allowed")
    
    
    class Index(MyBaseModel):
        IndexColumns: Any = Field(description="List of column names included in the index")
        IndexName: Any = Field(description="Name of the index")
        IndexType: Any = Field(description="Type of index ('Primary', 'Unique', etc.)")
        Unique: Any = Field(description="Whether the index enforces uniqueness")
    
    
    class TableDetail(MyBaseModel):
        ColumnList: Any = Field(description="List of column metadata", default=None)
        IndexList: Any = Field(description="List of index metadata", default=None)
  • Tool registration in the full toolset mode.
    self.mcp.tool(name="getTableDetailInfo",
                  description="Retrieve detailed metadata information about a specific database table including "
                              "schema and index details. If you don't know the table_guid parameter, retrieve it using listTables.",
                  annotations={"title": "获取DMS表详细信息", "readOnlyHint": True})(get_meta_table_detail_info)
  • Tool registration in the configured database toolset mode.
    self.mcp.tool(name="getTableDetailInfo",
                  description="Retrieve detailed metadata information about a specific database table including "
                              "schema and index details. If you don't know the table_guid parameter, retrieve it using listTables.",
                  annotations={"title": "Get Table Details", "readOnlyHint": True})(get_meta_table_detail_info)

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