---
title: "corestack_varnish_vcl_revert"
url: https://docs.corefinity.com/mcp/tools/corestack_varnish_vcl_revert
type: tool
last_updated: 2026-11-13
feature: varnish
related:
  - https://docs.corefinity.com/api/reference/varnish/restore-site-varnish-vcl-revision.md
  - https://docs.corefinity.com/guides/sites/software-and-services/varnish.md
---
# corestack_varnish_vcl_revert

**Revert a site's Varnish VCL.** Puts an earlier Varnish VCL revision back: a new revision, checked first, applied live like corestack_varnish_vcl_update. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Runs as a task: yes

## When to use it

Put an earlier custom Varnish VCL revision back on a Magento 2 row. A revert is a new revision (origin `revert`) with that revision's hooks: it is checked and compiled first, then applied live exactly like `corestack_varnish_vcl_update`, with the same task (its result's `vcl` says whether Varnish loaded it), the same automatic put-back if Varnish refuses it, and the same answer while Varnish is off. The history keeps every revision.

## Inputs

- `site_id` (integer, ≥ 1, required): the row, a Magento 2 site or one of its environments.
- `number` (integer, ≥ 0, required): the revision to put back, from `corestack_varnish_vcl_history_list`. `0` puts back the platform's original, the empty hooks: the platform VCL alone.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "number": {
      "description": "0 is the platform's original.",
      "minimum": 0,
      "type": "integer"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "number"
  ],
  "type": "object"
}
```

## Refusals

- `tenant_mismatch`: the row has no revision with that number (or the row is not yours).
- `vcl_invalid` or `vcl_compile_failed`: that revision no longer passes the policy or compiles on the row's Varnish version; `details.diagnostics`. Nothing was saved.
- `vcl_locked`: Corefinity manages the VCL on this environment.
- `busy`: a save is already applying; try again when it ends.
- `varnish_not_offered`: the row is not a Magento 2 site.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_varnish_vcl_revert",
  "arguments": {
    "site_id": 4211,
    "number": 3
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_varnish_vcl_revert with site_id 4211, number 3. (Revert a site's Varnish VCL.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/varnish/vcl/revisions/{number}/revert](https://docs.corefinity.com/api/reference/varnish/restore-site-varnish-vcl-revision.md)
- Guide: [Varnish](https://docs.corefinity.com/guides/sites/software-and-services/varnish.md)
