Skip to main content
Glama

Delete unused note type

delete-unused-note-type
DestructiveIdempotent

Preview and safely delete an explicitly selected unused Note Type, refusing if notes use it or it is the last type, and requiring impact hash plus confirmation.

Instructions

Previews deleting one explicitly selected Note Type. Refuses if any Note uses the type, even without Cards, or if it is the last Note Type. Requires the reviewed impact hash and explicit confirmation to apply. Requires AnkiConnect v1.

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": {
      "noteTypeId": "<noteTypeId>"
    },
    "name": "delete-unused-note-type"
  }
}

Input Schema

NameRequiredDescriptionDefault
dryRunNoPreview without modifying Anki
noteTypeIdYesExplicit stable ID from list-note-types
confirmDeletionNo
expectedImpactHashNoHash from the reviewed deletion preview

Output Schema

NameRequiredDescriptionDefault
dryRunYes
appliedYes
blockersYes
hasNotesYesWhether any Note uses this type; null if the type could not be inspected.
noteTypeYes
verifiedYes
warningsYes
impactHashYes
noteTypeIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, and the description adds real substance beyond that: preview-by-default, hard refusal conditions, the hash-plus-confirmation gate before any mutation, and an AnkiConnect v1 dependency. It stops short of describing error responses or the two-call hash acquisition sequence, but the safety profile is well covered.

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, front-loaded with what the tool does, followed by refusal rules and the apply gate. Nothing is redundant with the schema or annotations, and the version requirement is a single compact clause.

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 destructive, gated mutation with an output schema already covering return values, the description covers the refusal conditions, the confirmation workflow and the environment requirement. The main remaining gap is how the impact hash is obtained (presumably from a prior preview call) and what the preview returns.

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%, and the description supplies the missing semantics: "reviewed impact hash" ties expectedImpactHash to the preview workflow, and "explicit confirmation to apply" explains confirmDeletion's role alongside dryRun. It does not add format or sourcing detail for the hash beyond the schema's pattern, so it is useful but not exhaustive.

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?

States a specific verb and resource ("deleting one explicitly selected Note Type") and pins the scope to a single entity, which separates it from sibling field/template deletion tools. The preview-then-apply nature is stated up front rather than buried.

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?

Gives clear preconditions for use: only for a type no Note references and that is not the last Note Type, plus the requirement to have a reviewed impact hash before applying. It does not name a sibling alternative (e.g., what to do when notes do use the type), so guidance is strong but not fully routed.

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