Skip to main content
Glama

Replace a tag on selected notes

replace-note-tag
DestructiveIdempotent

Replace one whole tag on selected Anki note IDs by previewing the change first, then confirming to write; notes without the source tag are skipped.

Instructions

Previews replacing one whole tag on explicit Note IDs. Notes without the source tag are skipped. Does not recursively rename child tags, change unrelated tags, or apply to the whole collection. Requires AnkiConnect v1 and explicit confirmation of the reviewed preview to write.

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": {
      "noteIds": "<noteIds>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "replace-note-tag"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesOne replacement tag name. Anki may reuse registered casing.
fromYesFull existing tag name to replace. Not a prefix or search query.
dryRunNoPreview without modifying Anki
noteIdsYesExplicit selection of up to 100 Note IDs. No collection-wide option.
confirmReplacementNo
expectedImpactHashNoHash from the reviewed replacement preview

Output Schema

NameRequiredDescriptionDefault
toYes
fromYes
dryRunYes
appliedYes
changesYes
blockersYes
verifiedYes
warningsYes
impactHashYes
missingNoteIdsYes
skippedNoteIdsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the destructive/idempotent annotations, it discloses skip behavior for notes lacking the source tag, non-recursion into child tags, no collateral changes to unrelated tags, no collection-wide mode, an AnkiConnect v1 prerequisite, and a review-then-confirm gate. That is exactly the side-effect context an agent needs before authorizing a destructive write.

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?

Four tight sentences, with the operation and its preview behavior front-loaded, followed by exclusions and prerequisites. Every clause carries distinct information and nothing is repeated from the title.

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

Completeness5/5

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

For a destructive mutation with an output schema and strong annotations, the description covers scope, skip semantics, exclusions, environment prerequisite, and the write-confirmation path. Nothing an agent needs to call it safely is missing.

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 already 83%, so the baseline is 3, but the description adds real meaning by tying the preview to the reviewed-confirmation requirement, which explains why dryRun, expectedImpactHash, and confirmReplacement exist as a sequence. It also reinforces that noteIds is an explicit bounded selection with no collection-wide fallback.

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?

The description gives a specific verb ('replacing') and resource ('one whole tag') plus the scoping unit ('explicit Note IDs'), so the agent knows exactly what changes. It stops short of naming a sibling (e.g. edit-note-tags) as the alternative, so differentiation is implied by scope rather than stated.

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 clearly frames the use case: whole-tag replacement on explicitly enumerated notes, with a preview-first flow and a required confirmation step before writing. It does not say when an agent should prefer edit-note-tags or update-note-fields instead, so the routing guidance is contextual rather than explicit.

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