CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 8 of 12

corestack_varnish_vcl_validate

Check custom Varnish VCL.

Scope readNo secrets returned
On this page

When to use it

Check custom Varnish VCL without saving it: the same checks a save runs. First the policy (corestack_varnish_policy_get), then a compile of the platform VCL with your hooks inserted, on the row's Varnish version (or on varnish_version, to check before a version change). Run it before every corestack_varnish_vcl_update.

The answer is {valid, diagnostics, test}. Each diagnostic has the hook, the line and column in that hook, severity (error or warning), kind (policy, compile or advice), a code for policy findings (VN-POL-nn, VN-WARN-nn, VN-LIM-nn) and the message. Warnings never block a save. The compile runs in a sandbox and can take up to a minute; when it cannot run, test says so and the policy findings still answer (a save then compiles again before Varnish loads the VCL).

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_varnish_vcl_validate with site_id 4211, hooks {"recv":"if (req.url ~ \"^/stockcheck/\") {\n    return (pass);\n}\n"}. (Check custom Varnish VCL.) Tell me what it returned.

Inputs

hooksobjectRequired

recv, backend_response, deliver, each text or null for empty. A hook left out is checked as it is now.

Fields
backend_responsestring or null

Up to 49,152 characters.

deliverstring or null

Up to 49,152 characters.

recvstring or null

Up to 49,152 characters.

site_idintegerRequired

The row, a Magento 2 site or one of its environments. At least 1.

varnish_versionstring

Compile on another offered version, such as 8.0, instead of the row's own.

Example call

tools/call
{
  "name": "corestack_varnish_vcl_validate",
  "arguments": {
    "site_id": 4211,
    "hooks": {
      "recv": "if (req.url ~ \"^/stockcheck/\") {\n    return (pass);\n}\n"
    }
  }
}

If it is refused

ReasonWhat to do
varnish_not_offeredThe row is not a Magento 2 site.
invalid_argumentsA malformed input, or a varnish_version that is not offered.
managed_elsewhereAnother 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.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT