---
title: "corestack_error_pages_preview"
url: https://docs.corefinity.com/mcp/tools/corestack_error_pages_preview
type: tool
last_updated: 2026-11-13
feature: error-pages
related:
  - https://docs.corefinity.com/api/reference/site-settings/preview-site-error-page.md
  - https://docs.corefinity.com/guides/sites/site-settings/error-and-maintenance-pages.md
---
# corestack_error_pages_preview

**Preview an error page.** Compiles one error or maintenance page as visitors get it, without saving: HTML, diagnostics and size. Scope: read.

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

## When to use it

See one error or maintenance page as visitors would get it, before saving anything. The page is compiled by the same compiler that writes the site's files, so the HTML in the answer is what the site would serve, with sample values for the per-request tags.

Leave `source` out to preview the saved page, send your HTML to preview a draft, or send `null` for the platform's own page. `message` works the same way for the `{{message}}` text.

The answer is `{html, diagnostics, bytes, samples}`. Pages are HTML and CSS only: anything a page may not hold (scripts, event handlers, `javascript:` and other links that are not `https:`, `mailto:` or images, iframes, forms) is removed when you save, and each removal is listed here first as a `warning` whose `code` starts with `removed_`, with its line and column. A diagnostic with severity `error` blocks the save: an unknown tag, a tag inside a link or CSS, `<!--#`, or a page over 64 KiB.

Tags: `{{status_code}}`, `{{status_text}}`, `{{message}}`, `{{site_name}}`, `{{support_email}}`, `{{retry_after}}`, and per request `{{host}}`, `{{request_id}}`, `{{time_utc}}`. Every value is HTML-escaped.

## Inputs

- `site_id` (integer, ≥ 1, required): the environment row.
- `page` (string, required): `maintenance`, `404`, `500`, `502`, `503` or `504`.
- `source` (string or null, at most 64 KiB): the HTML to preview. Left out: the saved page. Null: the platform's page.
- `message` (string or null, at most 300 characters): the `{{message}}` text. Left out: the saved one. Null: the default.
- `sample` (object): values for `host`, `request_id` and `time_utc` in the preview.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "message": {
      "description": "The {{message}} text; null: the default; left out: the saved one.",
      "maxLength": 300,
      "type": [
        "string",
        "null"
      ]
    },
    "page": {
      "description": "The page: maintenance, 404, 500, 502, 503 or 504.",
      "enum": [
        "maintenance",
        "404",
        "500",
        "502",
        "503",
        "504"
      ],
      "type": "string"
    },
    "sample": {
      "additionalProperties": false,
      "description": "Sample values for the per-request tags.",
      "properties": {
        "host": {
          "maxLength": 253,
          "type": "string"
        },
        "request_id": {
          "maxLength": 64,
          "type": "string"
        },
        "time_utc": {
          "maxLength": 40,
          "type": "string"
        }
      },
      "type": "object"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "source": {
      "description": "HTML and CSS; null: the platform page; left out: the saved page.",
      "maxLength": 65536,
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "site_id",
    "page"
  ],
  "type": "object"
}
```

## Refusals

- `feature_off`: error pages are not available to you yet.
- `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_error_pages_preview",
  "arguments": {
    "site_id": 4211,
    "page": "maintenance",
    "source": "<!DOCTYPE html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\"><title>{{status_text}}</title></head>\n<body><h1>{{site_name}} is being updated</h1><p>{{message}}</p><p><small>Reference: {{request_id}}</small></p></body>\n</html>\n"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_error_pages_preview with site_id 4211, page maintenance, source <!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"><title>{{status_text}}</title></head>
<body><h1>{{site_name}} is being updated</h1><p>{{message}}</p><p><small>Reference: {{request_id}}</small></p></body>
</html>
. (Preview an error page.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/error-pages/preview](https://docs.corefinity.com/api/reference/site-settings/preview-site-error-page.md)
- Guide: [Error pages](https://docs.corefinity.com/guides/sites/site-settings/error-and-maintenance-pages.md)
