This is the required documentation for agents operating on the CloudBase Relational Database. It lists the only four supported tools for running SQL and managing security rules. Read the full content to understand why you must NOT use standard Application SDKs and how to safely execute INSERT, UPDATE, or DELETE operations without corrupting production data.
Use this skill when an agent needs to operate on CloudBase Relational Database via MCP tools, for example:
Do NOT use this skill for:
Recognize MCP context
executeReadOnlySQL, executeWriteSQL, readSecurityRule, writeSecurityRule, you are in MCP context.Pick the right tool for the job
executeReadOnlySQLexecuteWriteSQLreadSecurityRulewriteSecurityRuleAlways be explicit about safety
These tools are the only supported way to interact with CloudBase Relational Database via MCP:
executeReadOnlySQLSELECT queries (read-only).Example call (conceptual):
SELECT id, email FROM users WHERE active = true ORDER BY created_at DESC LIMIT 50;
Call this through the MCP tool instead of embedding SQL in code.
executeWriteSQLINSERT, UPDATE, DELETECREATE TABLE, ALTER TABLE, DROP TABLEImportant: When creating a new table, you must include the _openid column for per-user access control:
_openid VARCHAR(64) DEFAULT '' NOT NULL
Before calling this tool, confirm:
SELECT via executeReadOnlySQL when appropriate.readSecurityRuleSecurity rule types typically include:
READONLY – anyone can read, no one can writePRIVATE – only authenticated users can read/writeADMINWRITE – anyone can read, only admins can writeADMINONLY – only admins can read/writeCUSTOM – custom security logicwriteSecurityRuleWhen using this tool:
READONLY, PRIVATE, etc.) before CUSTOM.executeReadOnlySQL with a limited SELECT:
LIMIT clause.This pattern prevents accidental full-table scans and gives you context before any write operations.
executeReadOnlySQL to inspect the current schema or data (if needed).CREATE TABLE / ALTER TABLE statement.executeWriteSQL.SELECT again.Always describe:
readSecurityRule for the table to see current settings.READONLY → PRIVATE).writeSecurityRule with the new rule.MCP tools are for agent operations and database management:
SDKs are for application code:
When working as an MCP agent, always prefer these MCP tools for CloudBase Relational Database, and avoid mixing them with SDK initialization in the same flow.