Roll back a service
rollback_serviceReturn a website, app, or agent to an earlier release. It publishes that release's files again as a new release, so the service gets the next version number, runs every release policy a publish runs, and keeps the history. Repeating a call that names a release changes nothing; repeating one without release goes back another step. A release published before Valet kept its source cannot be restored. Environment variables, connectors, and access settings are not rolled back. Skills are refused: publish_skill publishes an earlier version. Returns the restored version and the new release's version, or for an app a build_id to follow with get_build. no_changes means the service already runs those files, evaluation that the release waits for its policies, and pending that an agent lacks setup. 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": "rollback_service"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The website's, app's, or agent's name. | |
| release | No | Which earlier release to bring back, as a version list_releases shows, when the person names a point in history. Omit to undo the latest change: Valet returns to the newest earlier release built from different files. | |
| org_name | No | The Valet organization it belongs to. Omit to use the organization the account joined first. | |
| idempotency_key | No | An opaque key of your choosing. Repeating a call with the same key returns the first call's result instead of rolling back a second time. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Name of the Valet organization the call acted in. | |
| url | No | URL that serves the website or app. Absent for an agent and while a site or app has no route. | |
| kind | Yes | Kind of the service: site, app, or agent. | |
| name | Yes | Name of the website, app, or agent. | |
| pending | No | What the organization must set up before the agent deploys. Nothing was rolled back. Set each up with its tool, then call rollback_service again. Absent when the rollback went through. | |
| version | No | Version number of the new release that went live. Absent when none did: the app builds first (see build_id), the release waits for its policies (see evaluation), or nothing changed. | |
| build_id | No | An app's rollback starts a build. Pass the ID to get_build and poll until deploy_state is up, idle, crashed, superseded, or refused. Absent for other kinds. | |
| restored | Yes | Version of the release whose files were restored. A repeat of a keyed call returns the same value. | |
| evaluation | No | The release evaluation. Without version, the release waits for its policies: follow it with get_evaluation. With version, the release is live and this is its monitor-only evaluation. Absent when the release has none. | |
| no_changes | No | True when the service already runs the release's files, so nothing was published. Absent otherwise. |