template_upsert
Create or update a reusable Scribe template to standardize pages; updating it re-renders every page generated from it.
Instructions
Create or update a reusable Scribe template; only when the user asked for that. Updating one re-renders every page made from it. Built-ins are read-only: upsert under a new key, or update the user's copy by its localId. Read scribe_docs "templates" first.
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": {
"title": "<title>",
"html": "<html>"
},
"name": "template_upsert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Stable template identity; reuse it to update. | |
| pin | No | Pages open pinned (default true); false for note-like templates. Omit to keep. | |
| html | Yes | Template HTML; {{fieldKey}} inserts a form value (escaped), scripts read scribe.template.values. | |
| guide | No | Markdown agent guide for its pages (state shape, events, rules). Omit to keep; "" removes. | |
| title | Yes | Name in the Templates sidebar. | |
| fields | No | The form the user fills when opening or editing a page. | |
| description | No | Blurb under the name. | |
| agentActions | No | Agent prompts offered on its pages. Omit to keep; [] removes. | |
| initialState | No | scribe.state for a new page. | |
| stateVersion | No | Integer >= 1. Bump when existing page data no longer fits the HTML. | |
| titleTemplate | No | Tab title pattern, e.g. "{{title}}". | |
| syncedWithBuiltin | No | True when this upsert merges the built-in's latest changes into its copy. |