Skip to main content
Glama

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

NameRequiredDescriptionDefault
keyNoStable template identity; reuse it to update.
pinNoPages open pinned (default true); false for note-like templates. Omit to keep.
htmlYesTemplate HTML; {{fieldKey}} inserts a form value (escaped), scripts read scribe.template.values.
guideNoMarkdown agent guide for its pages (state shape, events, rules). Omit to keep; "" removes.
titleYesName in the Templates sidebar.
fieldsNoThe form the user fills when opening or editing a page.
descriptionNoBlurb under the name.
agentActionsNoAgent prompts offered on its pages. Omit to keep; [] removes.
initialStateNoscribe.state for a new page.
stateVersionNoInteger >= 1. Bump when existing page data no longer fits the HTML.
titleTemplateNoTab title pattern, e.g. "{{title}}".
syncedWithBuiltinNoTrue when this upsert merges the built-in's latest changes into its copy.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and delivers the most important fact an agent needs before mutating: 'Updating one re-renders every page made from it'. It also discloses the built-in read-only constraint and the escape hatches. It does not cover permissions, what the call returns, or failure behavior on key collisions, which keeps it out of the top band for an unannotated mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, front-loaded with the action and the safety-relevant side effect; almost nothing is wasted. The lone weak spot is the unexplained localId reference, which reads as dangling detail rather than useful context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, nested-object mutation tool with no annotations and no output schema, the description covers the two things an agent cannot infer: the user-consent gate and the page-wide re-render blast radius. The rich per-field schema descriptions absorb the parameter burden. It would be stronger with a note on key-vs-localId identity resolution and on what the call returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds real meaning about identity ('reuse it to update') and the omit-to-keep persistence model implied by the schema. However, it refers to updating 'the user's copy by its localId', and no localId parameter exists in the input schema, which introduces ambiguity about which field identifies a user-copy template rather than clarifying it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb pair and resource: 'Create or update a reusable Scribe template'. It also names the operation's identity model (steady `key`) and the built-in read-only case, so an agent can tell this apart from template_get/template_list/template_delete without opening a schema. It stops short of naming those siblings explicitly, so it is clear but not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a real gating condition ('only when the user asked for that'), a prerequisite ('Read scribe_docs "templates" first'), and a branching rule for the read-only built-ins (new key vs. update the user's copy). Missing is guidance on when to prefer template_get or template_list over an upsert, but the when-to-act and when-not-to-act conditions are explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.