Page Templates
notion_templateBuild Notion pages from reusable templates with variables, previews, and validation, avoiding many block calls.
Instructions
Build pages from reusable templates instead of many block calls. Built-in templates: weekly-executive-report, content-brief, launch-plan, research-dossier; save your own. Actions: list, get (a template's full spec, a good starting point), validate (check a template, and with variables that it compiles), preview (the page outline, block count, charts, views, estimated requests, and, with compare_to, what differs from an existing page; writes nothing), render (create the page under parent, or append to append_to; charts are rendered and uploaded, live views placed; notion_undo removes it), save, delete, export (your saved templates), import. A template is {version: 1, name, description?, variables: {name: {type: string|number|boolean|date|list|object, required?, default?, description?}}, parts?: {name: [nodes]}, title, icon?, blocks: [nodes]}. Strings use {{variable}} (also {{item.field}} in loops, {{item_index}}, {{today}}, {{now}}); a string that is exactly one {{variable}} passes lists and objects through. Nodes: {markdown}, {heading, level?}, {callout, icon?, color?}, {toggle, children}, {columns: [[nodes], …]}, {divider: true}, {kpis: [{label, value} | {label, metric: {database, value: "count"|"sum:Prop", where?}}]}, {chart: {spec (as notion_create_chart), data | source, data_table?, format?}}, {view: {database, view (as notion_views)}} (top level only), {table: {header?, rows} | {query: {database, properties?, where?, limit?}}}, {gantt: {title?, tasks}}, {each: "list", as: "item", blocks}, {if: "var" | {var, equals|not|in|gt|lt|empty}, then, else?}, {part: name, with?}, {slot: name, default?} (filled by slots), {blocks: [raw block specs]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Template name (get, preview, render, delete). | |
| slots | No | Fill named slots with markdown, or with template nodes. | |
| action | Yes | ||
| parent | No | render: page to create the new page under. | |
| template | No | A template spec (validate, save, or preview/render without saving). | |
| append_to | No | render: existing page to append to instead. | |
| templates | No | import: template specs. | |
| variables | No | ||
| compare_to | No | preview: an existing page to compare the result with. |