Skip to main content
Glama

Export an Anki deck

export_anki_deck
Destructive

Exports Anki flashcard decks (.apkg) with rendered chemistry structures, reactions, and spectra for custom or curated molecule study cards.

Instructions

Export an Anki flashcard deck (.apkg) with rendered chemistry images.

Use this whenever the user wants flashcards, Anki cards or a study deck for molecules, reactions (e.g. pharmacopoeia identity tests) or spectra. A stated intention to learn or an exam coming up is the same request: offer a deck and write the cards yourself. The cards draw their structures, so learning needs no extra batch_generate call.

Not this tool for: structures only to look at, not to learn (use generate_molecule or batch_generate).

Two ways to fill the deck. Either pass cards you wrote yourself, or pass curated_deck_id for a ready-made, formula-verified starter deck:

  • "analgesics-structures": structure → name drills for 8 classic analgesics (NSAIDs, paracetamol, morphine, celecoxib).

  • "pheur-identity-basics": classic Ph.Eur. identity tests — reagent, observation and reaction scheme where it helps.

The tool renders the images — YOU supply the card content from your knowledge. Each card side carries text plus at most ONE visual: structure (name or SMILES), reaction ({reactants, products, conditions}) or spectrum ({spectrum_type, peaks, title}). Proven types: structure↔name, identity reactions (question front, scheme back), functional-group recognition, band assignment, name drills.

Re-exporting under the SAME deck name updates existing cards instead of duplicating them — the front identifies the card.

Options: reversed=true drills both directions; cloze=true makes fill-in-the-blank cards ({{c1::...}} in front.text, back.text is the extra note). "Parent::Child" nests subdecks.

IMPORTANT: structures take English/IUPAC names or SMILES; card TEXTS may be localized. Never deliver via AnkiConnect unless asked.

Args: deck_name: Deck name and filename (ignored with curated_deck_id). cards: The flashcards. Fronts unambiguous, explanations on the back. default_tags: Tags added to every card. deliver: "apkg" (file), "open" (opens Anki, macOS) or "ankiconnect". curated_deck_id: one of the two ids above.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "export_anki_deck"
  }
}

Input Schema

NameRequiredDescriptionDefault
cardsNo
deliverNoapkg
deck_nameNo
default_tagsNo
curated_deck_idNo

Output Schema

NameRequiredDescriptionDefault
fileNo
nameYes
typeNoanki_deck
cardsYes
mediaYes
frontsNo
deliveryNoapkg
previewsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • addedOutput schema / $defs
      Added value: +{
      +  "AnkiCardPreview": {
      +    "description": "One card as the panel previews it: text as in the deck, image as a small PNG data URI.",
      +    "properties": {
      +      "back": {
      +        "default": "",
      +        "title": "Back",
      +        "type": "string"
      +      },
      +      "back_image": {
      +        "default": "",
      +        "title": "Back Image",
      +        "type": "string"
      +      },
      +      "front": {
      +        "default": "",
      +        "title": "Front",
      +        "type": "string"
      +      },
      +      "front_image": {
      +        "default": "",
      +        "title": "Front Image",
      +        "type": "string"
      +      }
      +    },
      +    "title": "AnkiCardPreview",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / previews
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "$ref": "#/$defs/AnkiCardPreview"
      +  },
      +  "title": "Previews",
      +  "type": "array"
      +}
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare a non-read-only, destructive, open-world tool; the description explains exactly why — re-exporting under the same deck name updates existing cards in place, the front identifies the card, and deck_name doubles as the filename. It also notes platform limits on deliver="open" (macOS) and the AnkiConnect caveat. It does not say where the .apkg is written or what happens to cards removed from a re-export, which keeps it short of a 5.

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 purpose, then guidelines, then fill modes, then options, then constraints — a logical progression with bulleted curated deck ids that scan well. It is on the long side and the 'IMPORTANT' line plus the Args block partially restate earlier points, but nearly every sentence carries usable instruction.

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 complex, highly configurable export tool with an output schema, the definition covers call construction, both content paths, rendering constraints, and delivery modes. Remaining unknowns (output file path, partial re-export behavior) are minor against the depth provided.

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 description coverage is 0%, so the description carries the load and largely does: it defines all five top-level args, the card-side model (text plus at most one of structure/reaction/spectrum), reversed/cloze semantics, 'Parent::Child' nesting, and English/IUPAC-or-SMILES constraints. Deeper nested fields (spectrum_type values, peak intensity/width, reaction conditions formatting) are left to the schema titles.

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 artifact: export an Anki flashcard deck (.apkg) with rendered chemistry images. The following sentences make clear what the deck contains and how it differs from generate_molecule/batch_generate, so an agent can pick it out of the sibling set.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('whenever the user wants flashcards... a stated intention to learn or an exam coming up is the same request') and explicit when-not ('structures only to look at, not to learn — use generate_molecule or batch_generate'), plus guidance between the two fill modes (own `cards` vs `curated_deck_id`).

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