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

**Show the Varnish VCL policy.** Shows the rules custom Varnish VCL must follow: the three hooks, what each may set and return, refused statements, protected headers, limits and every code. Read it before writing VCL. Scope: read.

- Scope: `read`
- Runs as a task: no

## When to use it

Read the rules custom Varnish VCL must follow before you write any, so it is accepted the first time. Then check your VCL with `corestack_varnish_vcl_validate` and save it with `corestack_varnish_vcl_update`.

Custom VCL is three snippets, each inserted into the platform's Magento VCL at a fixed point:

- `recv` (`vcl_recv`): after purge handling, URL normalisation and every mandatory bypass (admin, customer, checkout, REST, GraphQL with Authorization, the health check); before static files and the cache lookup. It may set and unset request headers, `return (pass)`, `return (hash)` and `return (synth(<301–308, 403, 404, 410 or 429>, "<text>"))`. The request target is the platform's: `req.url`, `Host` and the method-override headers may be read in a condition but never set or unset (`VN-POL-09`); redirect with `return (synth(301, "..."))` instead.
- `backend_response` (`vcl_backend_response`): after the platform has decided what may be cached; it may set the TTL (up to 30 days), grace (up to 3 days) and keep, set and unset response headers and turn on ESI. It can never make a private, no-store or cookie-setting response cacheable.
- `deliver` (`vcl_deliver`): before the platform's header clean-up; it may set and unset response headers, never `Set-Cookie`.

Hashing, purging, backends and access control stay the platform's. The answer lists exactly what is refused (keywords, variables, functions, returns), the protected headers, the limits (16 KiB a hook, 48 KiB for the three, 200 statements a hook) and every diagnostic code (`VN-POL-nn` errors, `VN-WARN-nn` warnings, `VN-LIM-nn` limits) with its message.

## Inputs

- `site_id` (integer, ≥ 1, required): the row, a Magento 2 site or one of its environments.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `varnish_not_offered`: the row is not a Magento 2 site.
- 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_policy_get",
  "arguments": {
    "site_id": 4211
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_varnish_policy_get with site_id 4211. (Show the Varnish VCL policy.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [GET /api/corestack/sites/{site}/varnish/vcl/policy](https://docs.corefinity.com/api/reference/varnish/get-site-varnish-vcl-policy.md)
- Guide: [Varnish](https://docs.corefinity.com/guides/sites/software-and-services/varnish.md)
