Set environment variables
set_env_varsSet environment variables on an app or agent. plain_vars sets plain configuration, name to value, at once; plain values are readable from the dashboard, so a name or value that looks like a secret, such as STRIPE_KEY, an sk_live_ key, or a URL with a password, is refused there. For a secret, such as an API key, pass its name in secret_names and say plainly in reason why it is needed: the answer carries a request whose url the person opens, signed in to Valet, to enter each value. Valet stores each as an encrypted secret when they do. Give the person the url, then follow the request with get_request. Never ask the person to type a secret into this conversation. A call may carry both plain_vars and secret_names, but a name belongs in only one. Setting a name that exists replaces its value, which is why this is destructive. If the service is running, Valet restarts it once when plain values are set and once more when the person completes the request; a stopped or idle service reads them on its next start, and if a restart fails, call restart_service. The answer names variables and never values. Requires connecting a Valet account.
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": {
"name": "<name>"
},
"name": "set_env_vars"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The app's or agent's name. | |
| reason | No | Shown to the person on the request page to explain why the values are needed, so they can decide whether to enter them, such as: The app charges cards and needs your Stripe key. | |
| org_name | No | The Valet organization it belongs to. Omit to use the organization the account joined first. | |
| plain_vars | No | Settings the service reads that are safe to show, such as LOG_LEVEL to debug, as variable name to value. They apply without a person, but anyone in the dashboard can read them, so put a secret in secret_names instead. Setting a name that exists replaces its value. | |
| secret_names | No | The secrets the service needs, named by variable, such as STRIPE_KEY. The person types each value on the request page, so no value passes through this conversation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Name of the Valet organization the call acted in. | |
| set | No | Names of the plain variables this call set, sorted. Absent when plain_vars was not given. Never values. | |
| name | Yes | Name of the app or agent the variables were set on. | |
| request | No | The request a person completes in the dashboard to enter a value that must not pass through this conversation. Absent when nothing needs a person. |