---
title: "corestack_deployments_company_variable_set"
url: https://docs.corefinity.com/mcp/tools/corestack_deployments_company_variable_set
type: tool
last_updated: 2026-11-13
feature: deployment-templates
related:
  - https://docs.corefinity.com/api/reference/deployments/update-company-deploy-variable.md
  - https://docs.corefinity.com/guides/sites/code-and-deployments/deployment-templates.md
---
# corestack_deployments_company_variable_set

**Set a company deployment variable.** Create or change one of your company's deployment variables, which its sites' three-stage environments receive as CF_<name> unless they set it themselves. The value is write-only: it is never shown again here. Scope: write.

- Scope: `write`
- Runs as a task: no

## When to use it

Create or change one of your company's deployment variables, which its sites' three-stage environments receive as CF_<name> when their deployments are built, unless an environment sets the name itself. Send `value`, `shared_with_managed` or both; a new name needs a value. `shared_with_managed` matters only for an agency: the value then also reaches the builds of the sites it manages for clients, whose users can run commands there. The value is write-only: it is never shown again here. A token restricted to some sites cannot change company variables.

The same action in the public REST API, with the same checks, refusals and scope: `PUT /api/corestack/companies/{company}/deploy-variables/{name}`.

## Inputs

- `name` (string, matching `^[A-Za-z_][A-Za-z0-9_]{0,63}$`, required): Without the CF_ prefix.
- `value` (string, at most 2048 characters)
- `shared_with_managed` (boolean): An agency only: also the sites it manages for clients.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "name": {
      "description": "Without the CF_ prefix.",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
      "type": "string"
    },
    "shared_with_managed": {
      "description": "An agency only: also the sites it manages for clients.",
      "type": "boolean"
    },
    "value": {
      "maxLength": 2048,
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "type": "object"
}
```

## Refusals

- `forbidden`: the person's role lacks the Edit Environment Deployment Pipeline permission, which every change to the
  company's templates, variables and registry secrets needs (they reach every environment that follows the template). The
  message names it and says an owner of the company can grant it in Roles; `details.permission` is
  `editEnvironmentDeploymentPipeline`. Nothing is changed.
- `variable_reserved`: that name is reserved for a value the platform sets.
- `variable_tool_credential`: a new variable named as 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; `details.field` is `name`). Builds receive it as CF_<name>, so the tool never reads it. The message says so and points at Private registries; save the credentials with `corestack_deployments_company_secret_set` instead. An existing one is kept and can still be changed or deleted.
- `variable_invalid`: the name starts with CF_, the value has a line break, a control character or is too long, or a new name was sent without a value.
- `too_many_variables`: the company already holds the most variables it can (100); delete one first.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_deployments_company_variable_set",
  "arguments": {
    "name": "SLACK_WEBHOOK",
    "value": "<the webhook address>",
    "shared_with_managed": false
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_deployments_company_variable_set with name SLACK_WEBHOOK, value <the webhook address>, shared_with_managed false. (Set a company deployment variable.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PUT /api/corestack/companies/{company}/deploy-variables/{name}](https://docs.corefinity.com/api/reference/deployments/update-company-deploy-variable.md)
- Guide: [Deployment templates](https://docs.corefinity.com/guides/sites/code-and-deployments/deployment-templates.md)
