Replace template content
replace-template-contentReplaces the ENTIRE content of a draft template from an HTML string in a single destructive write.
Use this tool ONLY when:
You are authoring the initial content of an empty, freshly created template (e.g. after create-template-from-scratch), or
The user has explicitly asked to discard the current content and rewrite the whole template.
This is the right tool for laying down a large body of content at once (e.g. a whole NDA). It writes the whole template body in one go; there is no way to edit an individual node.
Do NOT use this tool to edit a template that already has content. Overwriting throws the existing content away. If the template already has content, this tool refuses to run unless you pass replace_existing_content=true to confirm the destructive overwrite. Read the current content with get-template-html first, so anything worth keeping can be carried over into the new HTML.
Overwriting an existing body cannot be undone, so ask the user to confirm it before passing replace_existing_content=true.
Only allowed on unpublished (draft) templates with a prosemirror_data content type.
Create the template's parties, signature blocks and dynamic fields before this call, so the body can reference their existing records by ref_uuid. Key HTML forms:
Dynamic field:
Party:
Signatures:
Numbered clause: Clause text
Cross-reference: (set a matching UUID you generate as data-uuid on the target ordered list node in the same call)
Clause numbers are always computed by fynk: text starting with a clause marker ("1.", "(a)", "§ 5") is rejected. Headings go up to . No two nodes may share a data-uuid (except , which repeats the target clause's uuid). Copy images, dynamic tables and signing vote blocks over exactly as get-template-html returned them; leaving one out removes it.
The response carries a warnings list alongside the stored HTML: what the template still lacks to
work as a template. The write succeeded either way, but act on them before reporting the template as
finished.
Read the fynk://articles/working-with-template-content resource before your first call writing template content in a conversation: it covers nested and non-decimal clause numbering (1.1, (a), I., § 1), numbered sections vs headings, multi-paragraph clauses and alignment.
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": {
"template_uuid": "<template_uuid>",
"html": "<html>"
},
"name": "replace-template-content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | Full HTML of the template content, in the format described by the fynk://articles/working-with-template-content resource. Replaces the entire document | |
| template_uuid | Yes | UUID of the unpublished template whose content should be replaced | |
| replace_existing_content | No | Required confirmation (true) to overwrite a template that already has content. Omit (or false) for empty templates. Defaults to false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | The stored template content serialised back to HTML. Addressable nodes carry a data-uuid attribute usable in subsequent operations. | |
| warnings | No | Advisory notes on what the stored template is still missing to work as a template: dynamic fields or signature blocks that exist but are placed nowhere, a body naming its parties as fixed text. The write succeeded; act on these before reporting the template as finished. |