Publish Document
publish_documentPublish Markdown or HTML to Gryz as a document and return its URL.
Public documents are reachable by anyone holding the link. Default lifespan by plan: anonymous 24h, free account 72h, Pro 30 days, Pro Plus permanent (or shorter if set). Private documents appear only in the owner's Gryz dashboard and never expire.
Visibility and retention are the publisher's choice, not properties of the content. Use the defaults below unless the person asks for something else.
Use this to save finished work the person would want again (a document, spec, plan, report or handoff) without waiting to be asked, unless they say not to. Do not save short answers, drafts in progress or routine replies. Unless the person asks for something else, use restricted on Pro and Pro Plus accounts. On a free account use public with show_on_explore: false: an unlisted link that stays off Explore and search engines, that anyone who has it can read, and that expires after 72 hours. On a free account, ask first if the work looks sensitive (client names, personal details, credentials). JSON and CSV can never be public, so use restricted for them. After saving, tell the person what was saved, who can read it and the link, and on a free account when the link expires. If a limit or an error stops the save, say so plainly; do not publish a listed public document instead, and do not say it was saved when it was not.
If the person may already have a document on this topic, you can look with list_documents and update that one (append_to_document or edit_document when available, otherwise update_document) rather than make a copy.
If the result says the person needs to accept the Terms, show them the message and its link, wait until they say it is done, then try again. Only they can accept, in their own browser. You cannot accept for them, and nothing was saved.
If the result lists warnings about parts of an HTML page that will not work for viewers, tell the user about them in plain words, skip any technical names, and offer to make the fix. Optional folder files the new document in a folder you can see (an id or a path such as "Handbook/Policies"; call map to see them). If no folder matches, the document is still saved at the top level and the result says so. Folders only help people find things; they never change who can open a document.
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>",
"content_type": "<content_type>",
"visibility": "<visibility>"
},
"name": "publish_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | No | Custom URL slug (e.g. "my-report"). Must be lowercase, 3–64 chars, letters/numbers/hyphens. Pro plan only. | |
| title | No | Document title. If omitted, Gryz will infer it from the content. | |
| folder | No | Optional: file the new document in this folder (an id from `map`, or a path such as "Handbook/Policies"). If no folder you can see matches, the document is saved at the top level. | |
| content | Yes | The full document content to publish (Markdown, HTML, SVG, CSV, Mermaid, or JSON) | |
| visibility | Yes | "public" = shareable link anyone can open. "restricted" = private to your Gryz dashboard only. CSV and JSON documents must use "restricted" — the explore/trending feed only shows public prose/diagram/snippet content, not raw data. | |
| content_type | Yes | "markdown" for Markdown content, "html" for HTML, "svg" for an SVG document (must start with an <svg> element), "csv" for tabular data (Pro and Pro Plus accounts only — every row must have the same number of columns as the header, and it can never be visibility: "public"), "mermaid" for Mermaid diagram syntax (Pro and Pro Plus accounts only — invalid syntax fails at render time, not publish time), "json" for JSON data (any signed-in account, but it can never be visibility: "public"). Default to "markdown" if unsure. | |
| show_on_explore | No | For public documents: set false to keep the document off Explore and search engines while the link still works for anyone who has it (an unlisted link). Omit or true = listed on Explore. Use false for a default save on a free account, or when the user asks to hide it. This is not security: anyone with the link can still read it. | |
| expires_in_hours | No | For public documents: hours until the link expires. Omit for your tier default (free account: 72h, Pro: 30d, Pro Plus: permanent). Clamped to your plan maximum. Ignored for private documents. |