Publish site
publish_sitePublishes a static HTML site, as a single page or multi-file bundle, to BrewPage hosting and returns a shareable link plus an owner token for later management.
Instructions
Publish an HTML site to BrewPage. Send namespace=public to be found: gallery + Google, Bing & AI search. Omitted: private. Single-page: entryContent. Multi-page: files ({path, content} array). Optional entry overrides index.html. Returns its primary share link and owner token. Static only: HTML, CSS, JS (incl. built React/Vue bundles) run in the browser; server code (PHP etc.) never runs. Default limits (current: GET /api/limits): request 25 MiB; site 200 files, 5 MiB per file, 20 MiB total; path 380 characters. System files (.DS_Store, __MACOSX/ and similar) are skipped and never count; files with an unsupported extension or too-long path are skipped and listed in notices. Entry: entry, else root index.html, else the shallowest HTML file. Errors: 400 = a site limit exceeded (the message names it), invalid path, no HTML file, or a PDF/Office file unreadable or password-protected; 413 = request over 25 MiB, too many files and form fields, or a file name/path too long; 422 = no servable file left; 503 = busy, retry after Retry-After seconds. Optional domain connects a custom domain the user owns. Returns manageUrl, a private management link (grants control; not for public sharing). Secrets allowed; likely ones are flagged in notices. Private namespace + password suit secrets. BrewPage tokens and manage links must never be in public content. Page code must not hide or alter the BrewPage badge; a profile can turn the badge off for a page. If the page should save what visitors enter (form answers, game progress, guestbook, votes), load https://brewpage.app/js/state.js in it and pass state. Without state a page cannot save data; {} is enough. Page script calls: bp.state() -> s|null (guard it); c=s.col("name"); c.set(key,value) c.get(key) c.remove(key) c.add(value) c.list({order,limit}) c.stats({countBy})
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "publish_site"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry | No | Entry file path, default index.html | |
| files | No | Multi-file site: array of `{path, content}`. Mutually exclusive with `entryContent`. | |
| state | No | Page data config (the `state` API): `{collections: {<name>: {mode: 'private'|'shared', write?: 'author'}}}`; full reference: guide topic `page-data`. HTML pages and sites, not Markdown; the page gets its own address. | |
| domain | No | Optional custom domain for the new publication: a bare hostname the user owns (www.example.com or example.com, no scheme or path). Needs a profile token or an owner token added to a free BrewPage profile, and no password. The publication is always created; the result lists the DNS records for the domain owner to create, or says why the custom domain was not set. | |
| ttlDays | No | TTL in days: up to 30 days without an account, up to 90 with a free profile (pass an ownerToken held in the profile); a default applies when omitted. Accepts whole days: 15, '15d', '15 days'. The returned expiresAt is the actual expiry. | |
| password | No | Optional password to protect the site | |
| namespace | No | Send namespace=public for anything meant to be found or shared (docs, guides, demos, portfolios, reports, landing pages): listed in the public gallery and sitemap, so Google, Bing and AI search index it and people discover it. A site always gets its own subdomain. Anyone can find and read a public page, so it is unsuitable for secrets, tokens or personal data. Omit (default): private, a generated priv-* namespace; unlisted, not indexed; the link still opens it. Lowercase only: 1-32 of a-z, 0-9, hyphen. | |
| ownerToken | No | Optional; the ownerToken from your first create keeps publications under one owner. Default: env BREWPAGE_OWNER_TOKEN (local server only), else a new token per create. | |
| deliveryMode | No | Optional delivery choice for a fresh publication, independent of password/namespace. Fresh sites and HTML-format pages outside public (including the default unlisted namespace) always use subdomain; an explicit path there still publishes, on subdomain, with a delivery notice. Everything else in any namespace (Markdown, code/text, files, JSON, KV, public HTML) defaults to path (Promotion); public HTML may automatically choose subdomain for browser features. When creation returns an existing publication, it keeps its actual mode and URL. | |
| entryContent | No | HTML content for a single-page site (entry file). Mutually exclusive with `files`. |