Skip to main content
Glama

Update note type templates

update-note-type-templates
DestructiveIdempotent

Validates and replaces front/back HTML templates for a note type, defaulting to dry-run and applying all requested sides in one Anki undo step.

Instructions

Validates and replaces selected front/back HTML templates for one note type. Defaults to dry-run mode and applies all requested sides in one Anki undo step.

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": {
      "modelName": "<modelName>",
      "templates": "<templates>"
    },
    "name": "update-note-type-templates"
  }
}

Input Schema

NameRequiredDescriptionDefault
dryRunNoWhen true, validate and report the proposed changes without modifying Anki
modelNameYesAnki note type name. AnkiConnect calls note types "models" in its API.
templatesYes
expectedDesignHashNoHash returned by get-note-type-design; required when dryRun is false and blocks stale writes

Output Schema

NameRequiredDescriptionDefault
dryRunYes
appliedYes
changedYes
changesYes
afterHashYesSHA-256 hash of the current CSS and card templates
modelNameYes
beforeHashYesSHA-256 hash of the current CSS and card templates
validationYes
scopeWarningYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=true; the description adds genuinely new behavior: validation happens before writing, dry-run is the default, and all requested sides land in a single Anki undo step. The one gap is that the hard requirement of expectedDesignHash when dryRun is false is left entirely to the schema, and the irreversibility of overwriting existing template HTML is not called out.

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

Conciseness5/5

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

Two tight sentences, zero filler, with the mutating action and its validation behavior front-loaded and the atomic-undo guarantee as the second beat. Nothing is repeated from annotations or schema verbatim.

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?

With annotations, a 75%-covered schema, and an output schema present, the description is nearly complete for a destructive template-replacement tool. It omits only the explicit warning that existing HTML is overwritten and the hash prerequisite for live writes, both of which an agent may need surfaced in prose given the destructive hint.

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

Parameters4/5

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

Schema coverage is 75%, so the baseline is 3; the description earns an extra point by clarifying that "selected" templates mean partial per-side updates applied atomically, and that dryRun defaults to true. It does not explain the modelName/models terminology or the stale-write hash guard, but those are handled in the schema.

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: validates and replaces front/back HTML templates for one note type, with the scope limited to a single note type. It distinguishes itself reasonably from obvious near-neighbors like add-note-type-template or update-note-type-styling by naming the exact asset (front/back HTML) touched, though it never explicitly names a sibling it is not.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: "selected front/back templates" suggests partial updates and the dry-run default hints at a validate-then-apply workflow. However, there is no explicit statement of when to use this versus add-note-type-template, replace-note-type-text, or get-note-type-design-first, and no prerequisites or exclusions are given.

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