CorefinityCorefinityDocs
Open the Control PanelControl Panel
Database · 5 of 12

corestack_external_db_user_add

Add a database user.

Scope writeAlso exec to reveal secretsAsks you to confirmRuns as a taskCan return a secretCoreCluster
On this page

When to use it

Add a database user to an environment, for a reporting tool, an agency's script or an outside system such as an order system or ERP:

  • internal: connects from inside the site only, through its crons, the terminal or the SSH tunnel.
  • external: connects through external database access, from the allowed addresses only. Turn external access on first with corestack_external_db_enable.

Read-only is SELECT and SHOW VIEW on the environment's own database. Read-write adds INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES and EXECUTE, never users, grants or another database; it can change and delete data, which only a snapshot restore takes back, so ask the person first and send confirm_read_write: "read-write".

The password is either one you send ({"mode": "set", "value": ...}) or one the Control Panel makes ({"mode": "generate"}, 24 characters). A generated password is shown once, in the person's browser; with exec and reveal_to_agent: true it is given to you when the task completes. The Control Panel keeps only its hash, so it cannot be shown again later: rotate it with corestack_external_db_user_password_rotate if it is lost.

The call answers a task on the change; it usually applies within a minute.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_external_db_user_add with site_id 4211, kind internal, username reporting_ro, scope read_only, password {"mode":"generate"}. (Add a database user.) Tell me what it returned.

Inputs

confirm_read_writestringConfirmation

With scope: read_write, the text read-write, typed after the person agreed.

kindstringRequired

internal or external. External needs external access on.

internalexternal
max_statement_timeinteger or null

External users only, the longest query in seconds; null or absent for none.

max_user_connectionsinteger or null

External users only, the most connections at once; null or absent for none.

passwordobjectRequired

{"mode": "generate"}, or {"mode": "set", "value": "..."} with 12 to 64 printable ASCII characters and no quotes, backticks or backslashes.

Fields
modestringRequired

generate: 24 characters made for you and shown once in the person's browser; set: your own value.

generateset
valuestring

With mode set: 12 to 64 printable ASCII characters, no quotes, backticks or backslashes.

require_tlsboolean

External users only, refuse connections without TLS (encrypted, not CA-verified).

reveal_to_agentboolean

Return the secret to you instead of opening it in the person's browser. Needs exec. Defaults to false.

scopestringRequired

read_only or read_write.

read_onlyread_write
site_idintegerRequired

At least 1.

usernamestringRequired

Lower-case letters, digits and underscores, starting with a letter; not used by another user of this environment.

Your assistant fills in a confirmation only after you agree.

Example call

tools/call
{
  "name": "corestack_external_db_user_add",
  "arguments": {
    "site_id": 4211,
    "kind": "internal",
    "username": "reporting_ro",
    "scope": "read_only",
    "password": {
      "mode": "generate"
    }
  }
}

If it is refused

ReasonWhat to do
confirm_mismatchA read-write user without confirm_read_write: "read-write"; nothing changed.
external_offAn external user while external access is not on.
user_capThe environment has 10 users already, or 5 external ones.
invalid_argumentsThe name is taken, malformed or reserved ("That name is reserved. Choose another." is the one answer for every reserved name), the password breaks its rules, or limits or TLS were sent for an internal user; fields names each.
busyAnother change to this environment is applying; try again when it finishes.
deletedThe site is deleted (in its grace period); restore it with corestack_site_restore_deleted first.
provisioningThe site is still being created.
managed_elsewhereAnother control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT