CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployments · 57 of 65

corestack_enterprise_variable_set

Set a CoreStack Enterprise build variable.

Scope writeNo secrets returned
On this page

When to use it

Create, change, clear or rename one of a CoreStack Enterprise environment's build variables: the Environment Variables editor's Save. Every deployment of the environment receives it as CF_<name>.

  • value left out keeps the stored value (a rename alone).
  • value as "" or null clears it: the variable stays, with no value.
  • Any other string sets it. A new variable needs one.
  • rename_to renames the variable and keeps its value, unless value changes it too, so a rename never needs the value shown first. The new name follows the rules for a new variable's name and must be free. A rename that only changes the case (api_token to API_TOKEN) is allowed.

The name rules below apply to a name being created and to rename_to. A variable the environment already has is found by the name it was saved with, so one saved before today's rules (with a hyphen, say) can still be changed, cleared, or renamed to a name that follows them.

The value is write-only: the answer, {variable: {name, masked, updated_at}, created}, carries only the mask, and the value is never shown again here. corestack_enterprise_variable_reveal shows it. For a CoreStack or CoreCluster site, use corestack_deployments_variable_set by site_id instead.

The public API's PUT /api/environments/{environment}/variables/{name} does the same, with the same checks and refusals in the same words.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_enterprise_variable_set with enterprise_env_id 1530, name API_URL, value https://api.example.com. (Set a CoreStack Enterprise build variable.) Tell me what it returned.

Inputs

enterprise_env_idintegerRequired

A CoreStack Enterprise environment's id; for CoreStack or CoreCluster use the corestack_deployment_* tools. At least 1.

namestringRequired

Without the CF_ prefix. A new name: letters, digits and underscores, starting with a letter or an underscore, at most 64 characters. An existing variable: its name as corestack_enterprise_variables_list gives it.

rename_tostring or null

The variable's new name.

valuestring or null

At most 2,048 characters, with no line breaks, control or invisible formatting characters.

Example call

tools/call
{
  "name": "corestack_enterprise_variable_set",
  "arguments": {
    "enterprise_env_id": 1530,
    "name": "API_URL",
    "value": "https://api.example.com"
  }
}

If it is refused

ReasonWhat to do
variable_invalidA new name or rename_to that breaks the rule above or starts with CF_ ("Use letters, digits and underscores, starting with a letter or underscore, without the CF_ prefix (CoreStack adds it)."); a value that is too long, holds a line break, a control or an invisible formatting character, or a new variable with no value ("Use at most 2,048 characters, with no line breaks, control or invisible formatting characters.").
variable_reservedA new name (or rename_to) CoreStack sets itself, such as DOMAIN ("CF_DOMAIN is set by CoreStack. Choose another name."). An existing variable of such a name can still be changed or deleted.
variable_tool_credentialA new name (or rename_to) of a build tool's credential (COMPOSER_AUTH, NPM_TOKEN, NODE_AUTH_TOKEN, YARN_NPM_AUTH_TOKEN, GITHUB_TOKEN, GITLAB_TOKEN, BITBUCKET_TOKEN, in any case): builds see it as CF_<name>, so the tool would never read it.
too_many_variablesThe environment already holds the most variables it can (limit in the list).
existsrename_to names another variable the environment already has ("This environment already has a variable with that name."). Choose another name, or delete that variable first.
invalid_argumentsA CoreStack or CoreCluster environment; use the corestack_deployments_* tools by site_id.
tenant_mismatchThe environment does not exist, is not the person's, or is hidden from them; and a rename of a variable the environment does not have. Both answers are the same, so read corestack_enterprise_variables_list to tell them apart.
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.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
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