Skip to main content
Glama

Replace literal text in Anki note type designs

replace-note-type-text
Destructive

Previews and applies case-sensitive literal replacements in selected Note Types' front HTML, back HTML, or CSS, without changing note field values.

Instructions

Previews and validates a case-sensitive literal replacement in explicitly selected Note Types' front HTML, back HTML, and/or CSS. Does not replace Note field values. Applying requires AnkiConnect v1, a current impact hash, and explicit confirmation.

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": {
      "noteTypeIds": "<noteTypeIds>",
      "targets": "<targets>",
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "replace-note-type-text"
  }
}

Input Schema

NameRequiredDescriptionDefault
findYesLiteral case-sensitive search text, not a regular expression.
dryRunNoPreview without changing Anki.
replaceYesLiteral replacement text. An empty string removes the matches.
targetsYesChoose question (front HTML), answer (back HTML), and/or css.
noteTypeIdsYesExplicit selection of up to 20 Note Type IDs from list-note-types.
confirmReplacementNo
expectedImpactHashNoHash from the reviewed replacement preview.

Output Schema

NameRequiredDescriptionDefault
dryRunYes
appliedYes
changesYes
profileYes
blockersYes
verifiedYes
warningsYes
impactHashYes
validationYes
occurrenceCountYes
changedTypeCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description's added value is in scoping the blast radius (design HTML/CSS only, never field values) and disclosing prerequisites (AnkiConnect v1, impact hash, explicit confirmation) plus the default-preview behavior. It does not discuss reversibility/undo or failure modes for a stale hash, which keeps it below the top score.

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: the first front-loads what is being changed and what is deliberately excluded, the second front-loads the safety preconditions for applying. No filler wording and nothing redundant with the title.

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 declaring destructiveness and an output schema present, the definition covers all an agent needs to decide between preview and apply. The only gap is what a caller should do when the impact hash no longer matches, which is implied but not stated.

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 86%, so noteTypeIds, targets, find, replace, and expectedImpactHash are already documented in the schema. The description restates that selection is explicit and that apply needs a current hash, but adds no format or edge-case detail beyond the structured fields, so the baseline of 3 applies.

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

Purpose5/5

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

The description names a specific verb and resource — a case-sensitive literal replacement across Note Type front HTML, back HTML, and CSS — and explicitly rules out the nearest confusion by stating it does not replace Note field values. An agent can distinguish it from tag/field-level siblings without opening the schema.

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?

It lays out the intended two-phase workflow: preview first, then apply only with a current impact hash and explicit confirmation. It stops short of naming alternative siblings (e.g. whole-template or styling updates) or saying when the literal-replace path should be preferred over them, so it is clear context rather than full routing guidance.

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