Skip to main content
Glama

Publish HTML, Markdown, code or JSON page

publish_html

Publish HTML, Markdown, code, or JSON to BrewPage and get a shareable link; make it public for gallery and search discovery or keep it private, with password, TTL, custom domain, and saved state options.

Instructions

Publish HTML, Markdown, code or JSON to BrewPage (max 5 MiB). Send namespace=public to be found: gallery + Google, Bing & AI search. Omitted: private. Format order: format, then a known filename extension, else the server detects it. Returns its primary share link and owner token. Optional password, TTL, filename, top toolbar (showTopBar). A public page without deliveryMode may get its own subdomain if it needs browser features a BrewPage link lacks; the result then has deliveryModeReason and a delivery notice. Markdown raw HTML is allowlisted: scripts, styles, event handlers, forms, embeds removed. Optional domain connects a custom domain the user owns to an HTML-format page. 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

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "content": "<content>"
    },
    "name": "publish_html"
  }
}

Input Schema

NameRequiredDescriptionDefault
stateNoPage 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.
domainNoOptional 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.
formatNoOmit: a known filename extension decides, else the server detects html, markdown, code or JSON. `html` keeps code/JSON as HTML; also markdown/md or a code language. A whole HTML document sent as markdown becomes an HTML page.
contentYesHTML, Markdown, code or JSON to publish
ttlDaysNoTTL 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.
filenameNoOptional original filename (≤200 chars). Without `format`, a known extension sets the format (.md stays Markdown, even a whole HTML document). Used as title fallback when no <title>/<h1>; immutable on update.
passwordNoOptional password to protect the page
namespaceNoSend 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. Public pages are served on the brewpage.app domain itself, for the strongest search reach; code that needs its own origin (cookies, storage) gets its own subdomain automatically. 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.
ownerTokenNoOptional; 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.
showTopBarNoAdd a thin top toolbar (filename + Download button + theme toggle) on the served page. Default: hidden.
deliveryModeNoOptional 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.22.0
    • changedInput schema / properties / domain / description
      Previous value: -"Optional domain the user owns (www.example.com or example.com) to connect to the new publication. Works when the owner token is in a free BrewPage profile, without a password. The publication is always created; the result lists the DNS records for the domain owner to create, or says why the domain was not set."New value: +"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."
    • changedInput schema / properties / ttlDays / description
      Previous value: -"Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30; up to 90 with an owner token in a profile), reporting each adjustment in notices; the returned expiresAt is the actual expiry."New value: +"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."
  2. Changed1 schema field changedv1.21.0
    • addedInput schema / properties / state
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "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."
      +}
  3. Changed1 schema field changedv1.18.0
    • addedInput schema / properties / domain
      Added value: +{
      +  "description": "Optional domain the user owns (www.example.com or example.com) to connect to the new publication. Works when the owner token is in a free BrewPage profile, without a password. The publication is always created; the result lists the DNS records for the domain owner to create, or says why the domain was not set.",
      +  "type": "string"
      +}
  4. Changed2 schema fields changedv1.16.10
    • changedInput schema / properties / filename / description
      Previous value: -"Optional original filename (≤200 chars). Used as title fallback when no <title>/<h1>; immutable on update."New value: +"Optional original filename (≤200 chars). Without `format`, a known extension sets the format (.md stays Markdown, even a whole HTML document). Used as title fallback when no <title>/<h1>; immutable on update."
    • changedInput schema / properties / format / description
      Previous value: -"Omit: server detects html, markdown, code or JSON. `html` keeps code/JSON as HTML; also markdown/md or a code language."New value: +"Omit: a known filename extension decides, else the server detects html, markdown, code or JSON. `html` keeps code/JSON as HTML; also markdown/md or a code language. A whole HTML document sent as markdown becomes an HTML page."
  5. Changed1 schema field changedv1.16.6
    • changedInput schema / properties / namespace / description
      Previous value: -"namespace=public: listed in the public gallery and the sitemap, so Google, Bing and AI search can find and index it and people can discover it. Suits anything meant to be found or shared: docs, guides, demos, portfolios, reports, landing pages. Public pages are served right on the brewpage.app domain, which gives them the strongest reach in search; a page whose code needs its own origin (cookies, storage) gets its own subdomain automatically. Anyone can find and read a public page, so it is unsuitable for secrets, tokens or personal data. Omit (default): private. Unlisted and not indexed; anyone who has the link can still open it. Lowercase only: 1-32 of a-z, 0-9, hyphen."New value: +"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. Public pages are served on the brewpage.app domain itself, for the strongest search reach; code that needs its own origin (cookies, storage) gets its own subdomain automatically. 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."
  6. Changed5 schema fields changedv1.16.3
    • changedInput schema / properties / content / description
      Previous value: -"HTML or Markdown content to publish"New value: +"HTML, Markdown, code or JSON to publish"
    • removedInput schema / properties / format / default
      Removed value: -"HTML"
    • changedInput schema / properties / format / description
      Previous value: -"Content format, default HTML. HTML or MARKDOWN; the server also maps aliases (md, text/markdown, file extensions, code languages) and detects unknown values from content, reporting the change in notices."New value: +"Omit: server detects html, markdown, code or JSON. `html` keeps code/JSON as HTML; also markdown/md or a code language."
    • changedInput schema / properties / ownerToken / description
      Previous value: -"Optional. Default: BREWPAGE_OWNER_TOKEN, else a new token per create."New value: +"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."
    • changedInput schema / properties / ttlDays / description
      Previous value: -"Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30 by default; owner caps differ), reporting each adjustment in notices; the returned expiresAt is the actual expiry."New value: +"Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30; up to 90 with an owner token in a profile), reporting each adjustment in notices; the returned expiresAt is the actual expiry."
  7. Changed2 schema fields changedv1.15.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
  8. Changed2 schema fields changedv1.14.5
    • changedInput schema / properties / namespace / description
      Previous value: -"namespace=public: listed in the public gallery and the sitemap, so Google, Bing and AI search can find and index it and people can discover it. Use it for anything meant to be found or shared: docs, guides, demos, portfolios, reports, landing pages. Public pages are served right on the brewpage.app domain, which gives them the strongest reach in search; a page whose code needs its own origin (cookies, storage) gets its own subdomain automatically. Anyone can find and read a public page: never put secrets, tokens or personal data there. Omit (default): private. Unlisted and not indexed; anyone who has the link can still open it. Lowercase only: 1-32 of a-z, 0-9, hyphen."New value: +"namespace=public: listed in the public gallery and the sitemap, so Google, Bing and AI search can find and index it and people can discover it. Suits anything meant to be found or shared: docs, guides, demos, portfolios, reports, landing pages. Public pages are served right on the brewpage.app domain, which gives them the strongest reach in search; a page whose code needs its own origin (cookies, storage) gets its own subdomain automatically. Anyone can find and read a public page, so it is unsuitable for secrets, tokens or personal data. Omit (default): private. Unlisted and not indexed; anyone who has the link can still open it. Lowercase only: 1-32 of a-z, 0-9, hyphen."
    • changedInput schema / properties / ttlDays / description
      Previous value: -"Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30 by default; owner caps differ), reporting each adjustment in notices; use returned expiresAt."New value: +"Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30 by default; owner caps differ), reporting each adjustment in notices; the returned expiresAt is the actual expiry."
  9. Changed1 schema field changedv1.14.2
    • changedInput schema / properties / namespace / description
      Previous value: -"Optional. Omit to generate an unlisted namespace: anyone with its unpassworded link can read it, but it is excluded from gallery/search. Pass a custom namespace to group unlisted content, or pass `public` ONLY when the user explicitly wants gallery/search eligibility. Password-protected content stays excluded; unlisted, protected or otherwise ineligible native responses carry noindex; eligible public HTML, sites and files may permit indexing. Lowercase only: 1-32 of a-z, 0-9, hyphen."New value: +"namespace=public: listed in the public gallery and the sitemap, so Google, Bing and AI search can find and index it and people can discover it. Use it for anything meant to be found or shared: docs, guides, demos, portfolios, reports, landing pages. Public pages are served right on the brewpage.app domain, which gives them the strongest reach in search; a page whose code needs its own origin (cookies, storage) gets its own subdomain automatically. Anyone can find and read a public page: never put secrets, tokens or personal data there. Omit (default): private. Unlisted and not indexed; anyone who has the link can still open it. Lowercase only: 1-32 of a-z, 0-9, hyphen."
  10. Changed2 schema fields changedv1.13.0
    • changedInput schema / properties / namespace / description
      Previous value: -"Optional. Omit to generate an unlisted namespace: anyone with its unpassworded link can read it, but it is excluded from gallery/search. Pass a custom namespace to group unlisted content, or pass `public` ONLY when the user explicitly wants gallery/search eligibility. Password-protected content stays excluded; unlisted, protected or otherwise ineligible native responses carry noindex; eligible public HTML, sites and files may permit indexing."New value: +"Optional. Omit to generate an unlisted namespace: anyone with its unpassworded link can read it, but it is excluded from gallery/search. Pass a custom namespace to group unlisted content, or pass `public` ONLY when the user explicitly wants gallery/search eligibility. Password-protected content stays excluded; unlisted, protected or otherwise ineligible native responses carry noindex; eligible public HTML, sites and files may permit indexing. Lowercase only: 1-32 of a-z, 0-9, hyphen."
    • addedInput schema / properties / ownerToken
      Added value: +{
      +  "description": "Optional. Default: BREWPAGE_OWNER_TOKEN, else a new token per create.",
      +  "type": "string"
      +}
  11. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes far beyond the readOnlyHint/destructiveHint annotations: discloses the 5 MiB cap, that it returns a share link and owner token plus a manageUrl granting control, that public pages may auto-get a subdomain with deliveryModeReason, the Markdown HTML allowlist, secret flagging, badge rules, and TTL limits. This is exactly the behavioral context an agent needs before a write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose well, but the body is a dense wall of text mixing return values, allowlists, badge policy, and state API calls in long run-on sentences. Much is valuable, yet some clauses (badge, tokens warning) could be tightened or moved to a guide.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter write tool with no output schema, it covers return values (share link, owner token, manageUrl, expiresAt, deliveryModeReason), mutation semantics (filename immutable on update), and the state data model. An agent has essentially everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: format resolution order (explicit `format`, then filename extension, then detection), namespace semantics (private priv-* vs public gallery), TTL account limits, and the state API surface with example calls. This supplements the schema rather than repeating it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource up front: "Publish HTML, Markdown, code or JSON to BrewPage (max 5 MiB)." An agent can tell this creates a page, though the overlap with siblings publish_json/publish_file/publish_site is not explicitly addressed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use signals: send namespace=public when the page should be discovered, private + password for secrets, load state.js and pass `state` if visitors should save data. It does not name a sibling tool to use instead, so routing between publish_html and publish_json/publish_site is left partly to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.