Set Environment Variable or Secret
secrets_setSets one environment variable or secret on an app, like adding or
editing it on the dashboard's Environment page. Creates the key, or
replaces its value when it already exists in that scope (action:
created or updated). Takes the app_id from apps_list.
scope is required: app sets the key for every environment
(development, staging and production), and environment sets it for
the one environment_id (from environments_list) only, where it
wins over an app entry of the same key.
is_secret defaults to true: the value goes to Secret Manager and can
never be read back. Pass is_secret: false for a plain variable,
which the dashboard shows. An existing key keeps its kind: changing
is_secret is refused, so call secrets_unset, then secrets_set.
Keys are uppercase (^[A-Z][A-Z0-9_]*$, up to 128 characters) and
normalized for you. The value is trimmed, non-empty, at most 8192
characters. Refused names: the HOSTING_ prefix, and
MERIDIAN_APP_ID, MERIDIAN_API_URL, MERIDIAN_OAUTH_CLIENT_ID,
MERIDIAN_OAUTH_CLIENT_SECRET, which Meridian always sets itself.
A key that overrides a variable Meridian manages (the Shopify pair,
NODE_ENV, MERIDIAN_API_KEY, DB_*, the REDIS_* set of a ready
Redis add-on, ...) is accepted and listed in overrides_managed, one
entry per environment it overrides.
THE VALUE IS NEVER RETURNED. The change reaches the app at its next
deploy: environments_list reports config_pending_deploy.
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": {
"app_id": "<app_id>",
"key": "<key>",
"value": "<value>",
"scope": "<scope>"
},
"name": "secrets_set"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The variable name, for example `SHOPIFY_APP_URL`. Uppercased and normalized. | |
| scope | Yes | `app` for every environment of the app, `environment` for `environment_id` only. | |
| value | Yes | The value to set. Trimmed, never returned. | |
| app_id | Yes | The app uuid returned by `apps_list`. | |
| is_secret | No | True (the default) for a secret kept in Secret Manager, false for a plain variable the dashboard shows. | |
| environment_id | No | Required when `scope` is `environment`: the environment uuid from `environments_list`. | |
| organization_id | No | An organisation uuid or slug. When supplied, `app_id` is resolved within that organisation and may be a slug instead of a uuid, mirroring the Meridian web app. |