Manage environments
manage_environmentsAdd, rename or delete a project's environments (staging, qa), and record, change or forget the deployment URLs that point at them. Every change is immediate; nothing is deployed or taken offline. The variables inside an environment change through manage_secrets, project fields through manage_projects. Actions (arguments besides action and project):
create (name; optional slug, kind): an empty environment, kind custom unless given. The slug is made from the name when omitted and never changes. Fill it with manage_secrets action copy or import.
rename (environment, name): the display name only; CI jobs that use the slug keep working.
delete (environment): permanent, with its deployment URLs, and only for an environment holding no secret or file and not synced to Vercel. A project keeps at least one environment.
add_url (label, url; optional environment, primary): adds a row on every call, so repeating it duplicates the URL. Without environment it belongs to the whole project; primary true demotes the previous primary.
update_url (url_id; any of label, url, primary true) and delete_url (url_id): url_id is the id list_project_items item deployment_urls shows. Deleting the primary URL promotes the oldest remaining one. Errors are messages: a slug in use, an archived project, an unknown url_id, an environment that is not empty. Audited. Needs projects:write, the editor role and the scope on the environment touched; delete needs the owner role.
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": {
"action": "<action>",
"project": "<project>"
},
"name": "manage_environments"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | add_url: required http(s) address. update_url: the new address | |
| kind | No | create only: development, preview, production or custom (the default). Tokens limited to some kinds reach the environment only if its kind is one of them | |
| name | No | create: display name. rename: the new display name, 1 to 40 characters | |
| slug | No | create only: the slug the other tools take, lowercase letters, digits and dashes, up to 48 characters, e.g. staging. Made from the name when omitted | |
| label | No | add_url: required short name, e.g. Production. update_url: the new label | |
| action | Yes | What to do | |
| url_id | No | update_url, delete_url: deployment URL id, from list_project_items item deployment_urls | |
| primary | No | add_url: make it the project's primary URL (the previous one stops being primary). update_url: pass true only, to make it primary | |
| project | Yes | Project slug from list_projects, e.g. my-app, or its id (a UUID) | |
| environment | No | rename, delete: which one. add_url: the environment the URL belongs to (default: the whole project) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | create, rename: the environment id; add_url, update_url, delete_url: the deployment URL id | |
| url | No | add_url, update_url: the URL's address | |
| kind | No | create, rename: the environment's kind | |
| name | No | create, rename: the environment's display name | |
| note | No | create: with restricted, how to ask for access | |
| slug | No | create, rename: the environment's slug | |
| label | No | add_url, update_url, delete_url: the URL's label | |
| deleted | No | delete, delete_url: true once removed | |
| primary | No | add_url, update_url: whether it is the project's primary URL | |
| project | No | delete: the project's slug | |
| restricted | No | create: this token's environment limits leave the new environment out | |
| environment | No | add_url: the environment's slug, null for the whole project; delete: the environment deleted |