Provision Postgres database
provision_postgresProvision the project's managed Postgres database and inject DATABASE_URL into the app's environment — the same action as the dashboard's Settings → Postgres button; no external Postgres provider or pasted connection string is needed. Idempotent: a project that already has one gets its current state back (already_provisioned=true) and nothing is created. Returns the env var names that are now set, with masked values — the app reads them from its process environment at runtime. Deployed commits are rolled so the new variable lands in the running pods. Requires a read-write token.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>"
},
"name": "provision_postgres"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | optional provisioning mode: disk (Postgres or S3 in the project's own data pod on its disk) or nas (object storage only: a bucket on the shared server; refused for Postgres). Omit to use the platform default; Postgres is always disk. A second call on an already-provisioned project returns the current mode and ignores this field | |
| project_id | Yes | the project id (from list_projects or deploy_files) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| mode | No | ||
| message | Yes | ||
| env_vars | Yes | ||
| repaired | Yes | ||
| converged | Yes | ||
| project_id | Yes | ||
| resource_name | No | ||
| rolled_commits | No | ||
| already_provisioned | Yes | ||
| env_secret_digest_after | No | ||
| env_secret_digest_before | No |