Skip to main content
Glama
anki-connect-mcp
by SolarianGG

noteTypes.replaceText

noteTypes_replaceText
Destructive

Replace literal text in selected Anki note types or all note types, targeting question, answer, and/or CSS fields. Use one selector and get changed type counts, not occurrence counts.

Instructions

Replace literal text in explicit note types or all note types.

Exactly one selector: noteTypes or allNoteTypes=true. Count changed types, not occurrences.

Anki-Connect method noteTypes.replaceText. Scope: collection. Effect: write. Completion: completed. Undo: grouped.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, staleSession.

Input Schema

NameRequiredDescriptionDefault
findYesLiteral text to find (not a regex).
replaceYesReplacement text (may be empty).
sessionNoOptional. Collection session ID: the `session` field returned by `collection_get`. Usually omit it — the server then uses the session current at the time of the call. Pass it to make the call fail with `staleSession` instead of acting on a different profile/collection than the one your IDs, cursors and tokens came from.
targetsNoWhere to replace: any of question, answer, css. Default all three.
noteTypesNoNote types to change, each exactly one of {"id": "<noteTypeId>"} or {"name": "<note type name, e.g. Basic>"}. Give either this or `allNoteTypes: true`.
allNoteTypesNoSet true (instead of `noteTypes`) to change all note types.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the destructiveHint/readOnlyHint annotations, the description supplies the undo model ('Undo: grouped'), the completion semantics ('completed'), the collection scope, and an explicit error taxonomy including staleSession and editorConflict. Some of this restates annotations ('Effect: write'), but the undo and error details are genuinely additive for a destructive mutation.

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?

Purpose and the one-selector rule are front-loaded, followed by a compact metadata block (scope/effect/completion/undo) and a terse error list. The shorthand is efficient, though the 'Effect: write' fragment partially duplicates what the annotations already declare.

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 six-parameter mutation with no output schema, the description covers selection semantics, what gets changed, how results are counted, undo behavior, and the failure modes. An agent has enough to invoke it correctly and reason about safety.

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 every parameter is already documented, including the literal-not-regex constraint, targets, and the id/name selector shape. The description adds little parameter meaning beyond the selector rule already encoded in oneOf; the 'count changed types, not occurrences' note concerns the result set rather than any parameter.

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 first sentence gives a specific verb and resource ('Replace literal text in ... note types') and narrows scope to note types, which distinguishes it from siblings like tags_replace and notes_update. It does not name an alternative sibling explicitly, so it falls short of a 5.

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?

The description states the selection constraint ('Exactly one selector: noteTypes or allNoteTypes=true'), which is useful invocation guidance, but that constraint is already enforced by the schema's oneOf. There is no guidance about when to use this tool instead of noteTypes_update, notes_update, or noteTypes_editStructure.

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

Deploy Server

Other Tools