Publish file from URL
publish_fileUploads a file from a URL to BrewPage and returns a share link and owner token; set namespace=public for search-indexed pages or omit it for private hosting.
Instructions
Upload a file from a URL. Send namespace=public to be found: gallery + Google, Bing & AI search. Omitted: private. Max 5 MiB, video 20 MiB; no password or TTL. Returns its primary share link and owner token. HTML and Markdown files become pages in any namespace and the link opens the page: a known file name extension decides, then the source's Content-Type, then the content; .txt and anything unclear stay files. An HTML file over the page limit or in no readable encoding stays a file shown as source (notice html-file-as-source). 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.
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": {
"url": "<url>"
},
"name": "publish_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the file to upload | |
| filename | No | Custom filename (optional); replaces the URL's name, so its extension decides whether the file becomes a page | |
| 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. 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. | |
| 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. |