anki_add_note
Add a single note to an Anki deck using specified fields, tags, and note type. Supports HTML content and cloze deletions, with an option to allow duplicates.
Instructions
Add a single note to a deck.
Field values are HTML and are sent verbatim — do not escape them. Write the markup you want rendered on the card:
fields={
"Text": 'The GIL is released during <b>I/O</b>, so '
'{{c1::threads}} still help for network-bound work.',
"Back Extra": '<pre><code>'
'<span class="hljs-keyword">async def</span> '
'<span class="hljs-title">main</span>(): ...'
'</code></pre>',
}Cloze deletions use {{c1::hidden text}} and require the "Cloze" model
(or another cloze-type note type) — the syntax is inert on "Basic".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tags to attach. Anki tags cannot contain spaces; use `::` to nest, e.g. `"python::asyncio"`. | |
| fields | Yes | Field name -> HTML content. Omitted fields are left empty. | |
| deck_name | Yes | Target deck. It must already exist; create it first with `anki_create_deck`. | |
| model_name | Yes | Note type, e.g. `"Basic"` or `"Cloze"`. Its field names must match `fields` exactly — check with `anki_get_model_fields`. | |
| allow_duplicate | No | By default Anki refuses a note whose first field already exists in the deck. Set True to add it anyway. | |
| response_format | No | How a tool should render its result. A `StrEnum` so the members compare equal to the plain strings a client sends over the wire (`"markdown"`, `"json"`). | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |