preview_document_update
Show how one part of a Clarifo document would change, or what publishing it would do. Writes nothing. Use when the user asks to change, rewrite, update or add to an existing document. Give exactly one target:
section_id + markdown: a section (get_workspace_item view="manifest").
block_id + markdown: one paragraph, list or table (view="blocks"); a table as a Markdown table.
visual_id + visual_data: the data of one saved chart, map or heatmap (view="visuals"; visual_data is its saved_data as read, or just the data object inside it (chartData, ...); every stored key kept). The result shows Clarifo's rendering of the saved and the proposed chart.
visual_story: the whole Visual Story (as view="visuals" returns it, changed). The result shows the proposed cards.
seo: publishing settings {"title", "description", "slug", "cover_image_url", "cover_image_alt"}; keys left out stay; cover_image_url "" removes the cover. The address (slug) is fixed once the document has been published.
publish: "public" (on clarifo.com for anyone) or "private" (signed-in Clarifo users only), only when the user asks to publish. The result shows the document as it would be published, its title, address, visibility, last check and whether the plan allows it.
Show the user the diff and the images (for publish: the preview, the address and visibility), then call apply_document_update with the same arguments plus base_version and preview_hash only after they agree.
Args: item_id: The document, from list_workspace_items. section_id: The section to change (manifest), or "intro". markdown: The new text, for a section or block. For a section replace without a leading heading the section keeps its heading; for insert_after start with a ## heading. Cite a filing page as [page_id] and list it in sources. None for remove. operation: replace (default), insert_after, or remove (takes the section, with its subsections, or the block out; no markdown). A part holding a chart is not removed here. sources: Filing page_ids the new text or cards rest on. Omitted for a section or block: the pages it already cites (sources_inherited in the result). companies: Optional; not used (figures are not checked). workspace_id: Optional; the document's workspace. block_id: One block to replace or insert after (view="blocks"). visual_id: A saved chart's V (view="visuals"). visual_data: The chart's new data, with visual_id. visual_story: The new Visual Story. seo: New publishing settings (SEO title, description, URL slug, cover image). publish: "public" or "private" to preview publishing the document; give no other target with it.
Returns: {"section" | "block_id" | "visual", "old_text", "new_text", "diff", "base_version", "preview_hash"} (+ images for a visual) or {"error", "failure_kind"}.
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": {
"item_id": "<item_id>"
},
"name": "preview_document_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seo | No | ||
| item_id | Yes | ||
| publish | No | ||
| sources | No | ||
| block_id | No | ||
| markdown | No | ||
| companies | No | ||
| operation | No | replace | |
| visual_id | No | ||
| section_id | No | ||
| visual_data | No | ||
| visual_story | No | ||
| workspace_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||