Skip to content

Commit 048841a

Browse files
Merge branch 'master' of http://gitlab.alibaba-inc.com/idb/alibabacloud-dms-mcp-server into yinuo/mcp_2
2 parents 15aed1c + db483d7 commit 048841a

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,70 @@ Key features via MCP include:
2727
- **Data Retrieval**: Automatically route SQL to accurate data sources for business support
2828
- **Security**: Fine-grained access control and auditability
2929

30+
---
31+
## Tool List
32+
33+
### Metadata Related
34+
35+
#### addInstance: Add an instance to DMS. If the instance already exists, return the existing instance information.
36+
37+
- **db_user** (string, required): Username for connecting to the database.
38+
- **db_password** (string, required): Password for connecting to the database.
39+
- **instance_resource_id** (string, optional): Resource ID of the instance, typically assigned by the cloud service provider.
40+
- **host** (string, optional): Connection address of the instance.
41+
- **port** (string, optional): Connection port number of the instance.
42+
- **region** (string, optional): Region where the instance is located (e.g., "cn-hangzhou").
43+
44+
#### getInstance: Retrieve instance details from DMS based on host and port information.
45+
46+
- **host** (string, required): Connection address of the instance.
47+
- **port** (string, required): Connection port number of the instance.
48+
- **sid** (string, optional): Required for Oracle-like databases, defaults to None.
49+
50+
#### searchDatabase: Search for databases in DMS based on schemaName.
51+
52+
- **search_key** (string, required): schemaName.
53+
- **page_number** (integer, optional): Page number to retrieve (starting from 1), default is 1.
54+
- **page_size** (integer, optional): Number of results per page (maximum 1000), default is 200.
55+
56+
#### getDatabase: Retrieve detailed information about a specific database from DMS.
57+
58+
- **host** (string, required): Connection address of the instance.
59+
- **port** (string, required): Connection port number of the instance.
60+
- **schema_name** (string, required): Database name.
61+
- **sid** (string, optional): Required for Oracle-like databases, defaults to None.
62+
63+
#### listTable: Search for data tables in DMS based on databaseId and tableName.
64+
65+
- **database_id** (string, required): Database ID to limit the search scope (obtained via getDatabase).
66+
- **search_name** (string, required): Non-empty string as a search keyword to match table names.
67+
- **page_number** (integer, optional): Pagination page number (default: 1).
68+
- **page_size** (integer, optional): Number of results per page (default: 200, maximum: 200).
69+
70+
#### getTableDetailInfo: Retrieve detailed metadata information for a specific data table, including field and index details.
71+
72+
- **table_guid** (string, required): Unique identifier for the table (format: dmsTableId.schemaName.tableName), obtained via searchTable or listTable.
73+
74+
---
75+
76+
### SQL Execution Related
77+
78+
#### executeScript: Execute an SQL script through DMS and return the results.
79+
80+
- **database_id** (string, required): DMS database ID (obtained via getDatabase).
81+
- **script** (string, required): SQL script content to execute.
82+
83+
---
84+
85+
### NL2SQL Related
86+
87+
#### nl2sql: Convert natural language questions into executable SQL queries.
88+
89+
- **question** (string, required): Natural language question to convert into SQL.
90+
- **database_id** (integer, required): DMS database ID (obtained via getDatabase).
91+
- **knowledge** (string, optional): Additional context or database knowledge to assist SQL generation.
92+
93+
3094

3195
---
3296

doc/README-zh-cn.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,68 @@
2525
- **取数**:通过SQL自动路由准确数据源获得数据,为上层业务提供数据支持
2626
- **安全**:精细的访问控制和可审计性
2727

28+
29+
## 工具清单
30+
31+
### 元数据相关
32+
#### addInstance:将实例添加到 DMS。如果实例已存在,则返回已有实例信息。
33+
34+
- **db_user** (字符串, 必需): 用于连接数据库的用户名。
35+
- **db_password** (字符串, 必需): 用于连接数据库的密码。
36+
- **instance_resource_id** (字符串, 可选): 实例的资源 ID,通常由云服务提供商分配。
37+
- **host** (字符串, 可选): 实例的连接地址。
38+
- **port** (字符串, 可选): 实例的连接端口号。
39+
- **region** (字符串, 可选): 实例所在的区域(例如 "cn-hangzhou")。
40+
41+
#### getInstance:根据 host 和 port 信息从 DMS 中获取实例详细信息。
42+
43+
- **host** (字符串, 必需): 实例的连接地址。
44+
- **port** (字符串, 必需): 实例的连接端口号。
45+
- **sid** (字符串, 可选): Oracle 类数据库所需,默认为 None。
46+
47+
#### searchDatabase:根据 schemaName 在 DMS 中搜索数据库。
48+
49+
- **search_key** (字符串, 必需): schemaName。
50+
- **page_number** (整数, 可选): 要检索的页码(从 1 开始),默认为 1。
51+
- **page_size** (整数, 可选): 每页的结果数量,最多 1000,默认为 200。
52+
53+
#### getDatabase:从 DMS 中获取特定数据库的详细信息。
54+
55+
- **host** (字符串, 必需): 实例的连接地址。
56+
- **port** (字符串, 必需): 实例的连接端口号。
57+
- **schema_name** (字符串, 必需): 数据库名。
58+
- **sid** (字符串, 可选): Oracle 类数据库所需,默认为 None。
59+
60+
#### listTable:根据 databaseId 和 tableName 在 DMS 中搜索数据表。
61+
62+
- **database_id** (字符串, 必需): 用于限定搜索范围的数据库 ID(可通过 getDatabase 工具获取)。
63+
- **search_name** (字符串, 必需): 作为搜索关键词的非空字符串,用于匹配表名。
64+
- **page_number** (整数, 可选): 分页页码(默认:1)。
65+
- **page_size** (整数, 可选): 每页结果数量(默认:200,最大:200)。
66+
67+
#### getTableDetailInfo:获取特定数据表的详细元数据信息,包括字段和索引详情。
68+
69+
- **table_guid** (字符串, 必需): 表的唯一标识符(格式:dmsTableId.schemaName.tableName),可通过 searchTable 或 listTable 工具获取。
70+
71+
---
72+
73+
### SQL 执行相关
74+
75+
#### executeScript:通过 DMS 执行 SQL 脚本并返回结果。
76+
77+
- **database_id** (字符串, 必需): DMS 数据库 ID,可通过 getDatabase 工具获取。
78+
- **script** (字符串, 必需): 要执行的 SQL 脚本内容。
79+
80+
---
81+
82+
### NL2SQL 相关
83+
84+
#### nl2sql:将自然语言问题转换为可执行的 SQL 查询。
85+
86+
- **question** (字符串, 必需): 需要转换为 SQL 的自然语言问题。
87+
- **database_id** (整数, 必需): DMS 数据库 ID,可通过 getDatabase 工具获取。
88+
- **knowledge** (字符串, 可选): 用于辅助 SQL 生成的额外上下文或数据库知识。
89+
2890
---
2991

3092
## 支持的数据源

0 commit comments

Comments
 (0)