Skip to main content
Glama
aliyun

Alibaba Cloud RDS OpenAPI MCP Server

Official
by aliyun

show_create_table

Retrieve the CREATE TABLE SQL statement for a specific table in an Alibaba Cloud RDS database to understand its structure and schema.

Instructions

show create table db_name.table_name Args: dbinstance_id (str): The ID of the RDS instance. region_id(str): the region id of instance. db_name(str): the db name for table. table_name(str): the table name. Returns: the sql result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_idYes
dbinstance_idYes
db_nameYes
table_nameYes

Implementation Reference

  • The MCP tool handler for 'show_create_table'. It uses DBService to connect to an Alibaba Cloud RDS instance (specified by region_id and dbinstance_id) and the given database (db_name), then executes the MySQL SQL command 'SHOW CREATE TABLE db_name.table_name' to retrieve and return the CREATE TABLE statement for the specified table.
    @mcp.tool(annotations=READ_ONLY_TOOL) async def show_create_table( region_id: str, dbinstance_id: str, db_name: str, table_name: str ) -> str: """ show create table db_name.table_name Args: dbinstance_id (str): The ID of the RDS instance. region_id(str): the region id of instance. db_name(str): the db name for table. table_name(str): the table name. Returns: the sql result. """ try: async with DBService(region_id, dbinstance_id, db_name) as service: return await service.execute_sql(f"show create table {db_name}.{table_name}") except Exception as e: logger.error(f"Error occurred: {str(e)}") raise e

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