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

noteTypes.editStructure

noteTypes_editStructure

Apply ordered field and template edits to an Anki note type in a single validated save, preserving card identity and rejecting invalid removals or cloze structures.

Instructions

Apply ordered structural edits and persist once using native note-type updates.

Carry original field/template ordinals to preserve card identity. Added entries have no original ordinal. Validate all edits on a copy before saving; reject last field/template removal and invalid cloze structures.

Anki-Connect method noteTypes.editStructure. Scope: collection. Effect: write. Completion: completed. Undo: single.

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

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": {
      "noteType": "<noteType>",
      "edits": "<edits>"
    },
    "name": "noteTypes_editStructure"
  }
}

Input Schema

NameRequiredDescriptionDefault
editsYesOrdered structural edits, each {op, ...} with op one of addField, updateField, moveField, removeField, addTemplate, updateTemplate, moveTemplate, removeTemplate. Saved once after all edits apply.
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.
noteTypeYesNote type: exactly one of {"id": "<noteTypeId>"} or {"name": "<note type name, e.g. Basic>"}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false) it discloses scope (collection), effect (write), completion semantics, and "Undo: single", which explains why a removal-bearing operation is still declared non-destructive. It also lists rejection rules (last field/template removal, invalid cloze structures) and a full error enum, though it omits any note about mutation cost or session/editor locking beyond the editorConflict error name.

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?

Front-loaded with the action and the atomicity guarantee (persist once), then constraints, then a compact scope/effect/undo line and error list. Dense but every line carries operational weight; only the Anki-Connect method name is 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?

For a multi-op union-schema write tool with no output schema, the description is largely complete: it covers atomicity, ordering, ordinal rules, validation requirements, undo granularity, and failure modes. It leaves the return shape and whether a note-type snapshot is returned unstated, which is a minor gap rather than a blocker.

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 coverage is 100%, so the schema already documents noteType, edits, and session in detail; the baseline is 3. The description adds one genuinely new semantic point not in the schema: ordinals must be carried from the original to preserve card identity, and newly added entries have none. That is useful but limited to a single rule across the three parameters.

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?

"Apply ordered structural edits and persist once using native note-type updates" names a specific verb (apply ordered edits) and resource (note-type structure: fields/templates). The word "structural" implicitly separates it from noteTypes_update (metadata) and noteTypes_create, but no sibling is named explicitly.

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?

It gives procedural guidance on how to call (carry original ordinals, added entries have no original ordinal, validate on a copy first) but never states when to prefer this over noteTypes_update or noteTypes_create. Usage is implied by the operation list rather than declared, so an agent must infer the boundary.

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