Back to home
Connect a client

Create a database

Provision a supported database within the project's organisation limits. Check capabilities before choosing an engine. HCode does not connect it to the app: once getDatabase reports running, call attachDatabase to put its connection string in a secret environment variable, then deploy or restart. A project that is being deleted refuses new databases with HTTP 409 project_deleting. When the plan has no room (its database count, or the memory or storage the new database needs), it is refused with HTTP 403 quota_exceeded and details.quota naming the resource, used, limit, requested and free; this refusal used to come back as 403 forbidden.

Queued work: send an idempotencyKey and reuse the same value when retrying this exact call.

Arguments

NameTypeRequiredLimits
namestringYesAt least 1 character(s)
type"postgres" | "redis"NoSee schema
projectIdstringYesAt least 1 character(s)
idempotencyKeystringYesAt least 1 character(s)
Full input schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "type": {
      "type": "string",
      "enum": [
        "postgres",
        "redis"
      ]
    },
    "projectId": {
      "type": "string",
      "minLength": 1
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Unique request key. Reuse this exact value when retrying the same operation."
    }
  },
  "required": [
    "projectId",
    "name",
    "idempotencyKey"
  ],
  "additionalProperties": false
}

Example call

The params of a tools/call request. Replace the placeholder values with your own IDs.

{
  "name": "createDatabase",
  "arguments": {
    "projectId": "REPLACE_WITH_PROJECT_ID",
    "name": "example-app",
    "idempotencyKey": "REPLACE_WITH_IDEMPOTENCY_KEY"
  }
}

Result

The same data as the API operation, wrapped as {"untrusted_data": true, "source": "createDatabase", "note": "...", "data": ...} so the model treats project content as data, not instructions.