$npx -y skills add TencentCloudBase/cloudbase-skills --skill relational-database-tool[Deprecated] This is the required documentation for agents operating on the CloudBase Relational Database through MCP. It defines the canonical SQL management flow with queryMysqlDatabase, manageMysqlDatabase, queryPermissions, and managePermissions, including MySQL provi
| 1 | ## Standalone Install Note |
| 2 | |
| 3 | If this environment only installed the current skill, start from the CloudBase main entry and use the published `cloudbase/references/...` paths for sibling skills. |
| 4 | |
| 5 | - CloudBase main entry: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md` |
| 6 | - Current skill raw source: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-tool/SKILL.md` |
| 7 | |
| 8 | Keep local `references/...` paths for files that ship with the current skill directory. When this file points to a sibling skill such as `auth-tool` or `web-development`, use the standalone fallback URL shown next to that reference. |
| 9 | |
| 10 | ## Activation Contract |
| 11 | |
| 12 | ### Use this first when |
| 13 | |
| 14 | - The agent must inspect SQL data, execute SQL statements, provision or destroy MySQL, initialize table structure, or manage table security rules through MCP tools. |
| 15 | |
| 16 | ### Read before writing code if |
| 17 | |
| 18 | - The task includes `queryMysqlDatabase`, `manageMysqlDatabase`, `queryPermissions`, or `managePermissions`. |
| 19 | |
| 20 | ### Then also read |
| 21 | |
| 22 | - Web application integration -> `../relational-database-web/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-web/SKILL.md`) |
| 23 | - Raw HTTP database access -> `../http-api/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/http-api/SKILL.md`) |
| 24 | |
| 25 | ### Do NOT use for |
| 26 | |
| 27 | - Frontend or backend application code that should use SDKs instead of MCP operations. |
| 28 | |
| 29 | ### Common mistakes / gotchas |
| 30 | |
| 31 | - Initializing SDKs in an MCP management flow. |
| 32 | - Running write SQL or DDL before checking whether MySQL is provisioned and ready. |
| 33 | - Treating document database tasks as MySQL management tasks. |
| 34 | - Skipping `_openid` and permissions review after creating new SQL tables. |
| 35 | - Destroying MySQL without explicit confirmation or without checking whether the environment still needs the instance. |
| 36 | |
| 37 | ## When to use this skill |
| 38 | |
| 39 | Use this skill when an **agent** needs to operate on **CloudBase Relational Database via MCP tools**, for example: |
| 40 | |
| 41 | - Inspecting or querying SQL data |
| 42 | - Provisioning MySQL for an environment |
| 43 | - Destroying MySQL for an environment |
| 44 | - Polling MySQL provisioning status |
| 45 | - Modifying data or schema (INSERT/UPDATE/DELETE/DDL) |
| 46 | - Initializing tables and indexes after MySQL is ready |
| 47 | - Reading or changing table permissions |
| 48 | |
| 49 | Do **NOT** use this skill for: |
| 50 | |
| 51 | - Building Web or Node.js applications that talk to CloudBase Relational Database directly through SDKs |
| 52 | - Auth flows or user identity management |
| 53 | |
| 54 | ## How to use this skill (for a coding agent) |
| 55 | |
| 56 | 1. **Recognize MCP context** |
| 57 | - If you can call tools like `queryMysqlDatabase`, `manageMysqlDatabase`, `queryPermissions`, `managePermissions`, you are in MCP context. |
| 58 | - In this context, **never initialize SDKs for CloudBase Relational Database**; use MCP tools instead. |
| 59 | |
| 60 | 2. **Pick the right tool for the job** |
| 61 | - Read-only SQL and provisioning status checks -> `queryMysqlDatabase` |
| 62 | - MySQL provisioning, MySQL destruction, write SQL, DDL, schema initialization -> `manageMysqlDatabase` |
| 63 | - Inspect permissions -> `queryPermissions(action="getResourcePermission")` |
| 64 | - Change permissions -> `managePermissions(action="updateResourcePermission")` |
| 65 | |
| 66 | 3. **Always be explicit about safety** |
| 67 | - Before destructive operations (DELETE, DROP, etc.), summarize what you are about to run and why. |
| 68 | - Prefer `queryMysqlDatabase(action="getInstanceInfo")` or a read-only SQL check before writes. |
| 69 | - Provisioning or destroying MySQL requires explicit confirmation because both actions have environment-level impact. |
| 70 | |
| 71 | --- |
| 72 | |
| 73 | ## Available MCP tools (CloudBase Relational Database) |
| 74 | |
| 75 | These tools are the supported way to interact with CloudBase Relational Database via MCP: |
| 76 | |
| 77 | ### 1. `queryMysqlDatabase` |
| 78 | |
| 79 | - **Purpose:** Query SQL data and provisioning state. |
| 80 | - **Use for:** |
| 81 | - Running `SELECT` and other read-only SQL queries with `action="runQuery"` |
| 82 | - Checking whether MySQL already exists with `action="getInstanceInfo"` |
| 83 | - Inspecting asynchronous provisioning progress with `action="describeCreateResult"` or `action="describeTaskStatus"` |
| 84 | |
| 85 | **Example flow:** |
| 86 | |
| 87 | ```json |
| 88 | { |
| 89 | "action": "runQuery", |
| 90 | "sql": "SELECT id, email FROM users ORDER BY created_at DESC LIMI |