project_rollback
Roll back the last deploy, on every plan. The code flips to the previous working version immediately: the version that was live just before the current one. By default this changes code without restoring data. Give a version number to restore a retained deploy from the last 24 hours on Free or any retained deploy on paid plans. Restoring by number leaves the database schema and data unchanged. If the project uses a managed database (db/schema.ts), the response also returns a schema plan in plain language — what the previous version expects of the database vs. what it looks like now — WITHOUT changing the schema. with_schema: true also rolls the schema back; it re-deploys the previous version's schema through the normal deploy path, so a column the new version added is refused (not silently dropped) and a column the old version still declares is restored from retention. Data is never touched beyond the retention/restore window. preview: true reviews before applying — it changes NOTHING and returns target_version (the version it would restore); that value as expected_target_version confirms it, and the rollback is refused (ROLLBACK_TARGET_CHANGED) if the live version moved since your preview, so the rollback never lands on a different version than the one you reviewed.
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": {
"project_id": "<project_id>"
},
"name": "project_rollback"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preview | No | Non-writing preview that returns the schema plan and target_version. False is the default; the returned target_version is the confirmation value for expected_target_version. | |
| version | No | Restore this retained version by number. Free covers the last 24 hours. Paid plans cover any retained version. Use version without the schema or preview options. | |
| project_id | Yes | Project ID, subdomain, or 'default'. | |
| with_schema | No | Also rolls the managed database schema back through the normal deploy path. False (default) rolls back code and shows a schema plan while leaving the schema unchanged pending confirmation. | |
| expected_target_version | No | The target_version returned by a preview. ROLLBACK_TARGET_CHANGED refuses a rollback when the current target differs, preventing confirmation from applying to another version. |