Skip to main content

Cloud Database Tools

By enabling the dbaas Toolset, the assistant can create, scale, and back up Cloud Database clusters through MCP, and manage the Databases and Users inside a cluster. For example, you can write "I want a PostgreSQL cluster named shop", and the assistant shows you the AZ and plan options from the Catalog.

To enable it, put the following value in the X-Mcp-Toolsets header in your client settings:

X-Mcp-Toolsets: dbaas

If you also need Cloud Logs at the same time, write logs,dbaas:

X-Mcp-Toolsets: logs,dbaas

Main Concepts​

  • Cluster The database service you create. Each cluster has a Primary and can also get Standby and Read-only nodes when needed.
  • Instance / Node Each node inside the cluster: Primary, Standby, or Read-only.
  • Database A logical database inside the engine (CREATE DATABASE). A Database isn't the same as the cluster itself.
  • Catalog The list of AZs, engines, versions, plans, and prices that you get from dbaas_catalog_get.
  • Whitelist The list of IPs or CIDRs allowed to connect to the cluster.

The main ID for almost all operations is the clusterId of the Primary node.

Getting Values from the Catalog​

Before creating a cluster or changing a plan, the assistant should get the real values from the Catalog and not guess anything. To do so, it first calls dbaas_catalog_get and shows you the AZ, engine, version, and plan options. After you choose, it runs dbaas_cluster_create or dbaas_cluster_resize.

Note that writing "Tehran" or "Postgres" alone isn't enough to create a cluster; the exact value, such as ir-thr-ba1 and g2-4-2-0, must be selected from the Catalog.

If you get a validation error when creating a cluster, the AZ or flavorRef is probably made up. Run dbaas_catalog_get again and select the value.

Catalog and Cluster Tools​

Use the following tools to manage clusters:

ToolPurposeMain parameters
dbaas_catalog_getGet the Catalog (AZ, engine, version, plan, price)No parameters
dbaas_cluster_listList clusterspage, perPage, q
dbaas_cluster_getDetails of a cluster: nodes, connection, Databases, and UsersclusterId
dbaas_cluster_createCreate a cluster (always Primary)name, az, flavorRef, engine, version, volumeSizeGigaBytes
dbaas_cluster_resizeChange the plan or disk sizeclusterId, flavorRef, volumeSizeGigaBytes
dbaas_cluster_deleteDelete the whole cluster (Primary and all nodes)clusterId
dbaas_cluster_set_whitelistFully replace the WhitelistclusterId, ips
dbaas_cluster_metricsCPU, RAM, disk, and network usageclusterId
dbaas_cluster_logsEngine logs (such as slow queries)clusterId, category

Node Tools​

Use the following tools to add and remove nodes:

ToolPurposeMain parameters
dbaas_cluster_node_addAdd a Standby or Read-only nodeclusterId, nodeType, name, az, flavorRef, volumeSizeGigaBytes
dbaas_cluster_node_removeRemove a Standby or Read-only nodenodeId, role

For nodeType when adding a node, use standby or readOnly. This tool isn't for creating a new cluster. To remove a node, role must be standby or read-only, and it must not be the Primary.

To delete the whole service, use dbaas_cluster_delete.

Database, User, and Backup Tools​

Use the following tools to manage Databases, Users, and backups:

ToolPurposeMain parameters
dbaas_database_createCreate a Database inside the clusterclusterId, databaseName
dbaas_database_deleteDelete a DatabaseclusterId, databaseName
dbaas_user_createCreate an engine UserclusterId, username
dbaas_user_deleteDelete a UserclusterId, username
dbaas_backup_createRequest a full backupclusterId, name, description
dbaas_backup_listList a cluster's backupsclusterId

Don't send a password when creating a cluster; the service creates the base-user user. The dbaas_user_create tool only takes a username and generates the password, but doesn't return it. dbaas_cluster_get and dbaas_cluster_list also hide passwords.

Note that you should copy the password from the panel and not enter it in the chat.

If the password isn't in the assistant's response, this is intentional. Copy the password from the panel.

Creating a Cluster​

The following fields are required for dbaas_cluster_create:

  • name The cluster name, such as shop. You choose this field yourself, and it's required.
  • az The cluster's AZ, such as ir-thr-ba1. Take the value from the Catalog. This field is required.
  • flavorRef The plan ID, such as g2-4-2-0. Take the value from the Catalog. This field is required.
  • engine The database engine, such as postgresql. Take the value from the Catalog. This field is required.
  • version The engine version, such as 17.3. Take the value from the Catalog. This field is required.
  • volumeSizeGigaBytes The disk size in GB, such as 20. Enter a positive integer. This field is required.

The following fields are optional:

  • backupRef Used to restore a backup into the new cluster. This field is optional.
  • selectedStandbyCount Sets the number of Standby nodes when creating with HA. This field is optional.
  • multiZone Requests multi-zone Standby nodes. This field is optional.
  • standbysInfo Explicitly sets the AZ and flavor of each Standby. This field is optional.
  • nodeType Its default value is primary, and you usually use this value for a new cluster. This field is optional.

After the request is accepted, the response usually doesn't mean the work is done, and a 202 (Accepted) status is returned. The assistant should wait with dbaas_cluster_get until the status is ACTIVE, and then report the cluster as ready. The same pattern applies to resize, delete, backup, Database, User, Whitelist, and node changes: first the request is accepted, then the assistant checks the status with get.

If the cluster isn't ready yet, you have probably only received the 202 response. Wait with dbaas_cluster_get until the status becomes ACTIVE.

Resource and Ready-Made Prompt​

The dbaas://docs/provision resource (named dbaas_provision) gives the assistant a guide for finding field values from the Catalog, creating a cluster, checking its status, and keeping passwords safe.

The dbaas_provision_cluster prompt is the cluster creation workflow. If fields are missing, the assistant first gets the Catalog, then creates the cluster, and then waits with get until the status is ACTIVE. The arguments of this prompt are name, az, flavorRef, engine, version, and volumeSizeGigaBytes.

Common Scenarios​

Viewing Existing Clusters​

Write in the chat:

Show me the list of my DBaaS clusters.
Tell me the details of the shop cluster with the connection host and node status; don't show the password.

The assistant runs dbaas_cluster_list and dbaas_cluster_get for this.

Creating a New Cluster​

Write in the chat:

I want a PostgreSQL cluster named shop. First get the Catalog and
show me the AZ and plan options; don't create anything until I choose.

If you know all the fields, you can use the ready-made prompt:

Use the provision cluster prompt:
name=shop, az=ir-thr-ba1, flavorRef=g2-4-2-0, engine=postgresql,
version=17.3, volumeSizeGigaBytes=20.

The assistant shouldn't choose the plan or AZ itself unless you have explicitly said so.

Creating a Database and User in the Cluster​

Write in the chat:

Create a Database named book_store1 on the shop cluster.
Create a User named app_rw and tell me to copy the password from the panel.

Before doing this, the cluster's status must be ACTIVE. You can see the list of Databases and Users with dbaas_cluster_get.

Backup and Restore​

Write in the chat:

Take a backup of the shop cluster named shop-before-migrate.
List the backups of shop.

To restore, give the backup ID as backupRef to dbaas_cluster_create so the new cluster is created from it.

Scaling, Whitelist, and Monitoring​

Write in the chat:

Change the shop cluster's plan to g2-4-4-0 and the disk to 40 GB; confirm with the Catalog.
Set the shop cluster's Whitelist to 203.0.113.10/32.
Show the CPU and RAM usage of the shop cluster.
Get the recent slow_query logs of shop.

Note that dbaas_cluster_set_whitelist replaces the current list. Only send the IPs that should stay.

Deleting Safely​

Write in the chat:

Find the test-old cluster. Before deleting, show its id, name, and nodes and wait for my confirmation.
Delete only the Standby of shop; don't delete the cluster itself.

The dbaas_cluster_delete tool removes the whole cluster. To remove a secondary node, use dbaas_cluster_node_remove.

Sample Client Configuration​

To make only the Cloud Database tools available to the client, write the configuration as follows and replace YOUR-MACHINE-USER-UUID with your machine user's ID:

{
"mcpServers": {
"arvancloud": {
"url": "https://mcp.arvancloud.ir",
"headers": {
"Arvancloud-Api-Key": "apikey YOUR-MACHINE-USER-UUID",
"X-Mcp-Toolsets": "dbaas"
}
}
}
}

To enable both products, set X-Mcp-Toolsets to logs,dbaas:

{
"mcpServers": {
"arvancloud": {
"url": "https://mcp.arvancloud.ir",
"headers": {
"Arvancloud-Api-Key": "apikey YOUR-MACHINE-USER-UUID",
"X-Mcp-Toolsets": "logs,dbaas"
}
}
}
}

If you get a 401 error after connecting, the API key is invalid; check the Arvancloud-Api-Key header. If you see a 400 error on the MCP connection, the value of X-Mcp-Toolsets is empty or invalid, and you should set it to dbaas or logs,dbaas. If the Cloud Database tools aren't shown, check the Toolset header and the machine user's permissions for Cloud Database.

The client connection details are in Client Setup. If you haven't connected MCP yet, start with the Quick Start.