| num_cards_due_todayA | Get the number of cards due exactly today, with an optional deck filter. |
| list_decks_and_notesC | Get all decks (excluding specified patterns) and note types with their fields. |
| get_examplesA | Get example notes from Anki to guide your flashcard making. Limit the number of examples returned and provide a sampling technique: - random: Randomly sample notes
- recent: Notes added in the last week
- most_reviewed: Notes with more than 10 reviews
- best_performance: Notes with less than 3 lapses
- mature: Notes with interval greater than 21 days
- young: Notes with interval less than 7 days
Args:
deck: Optional[str] - Filter by specific deck (use exact name).
limit: int - Maximum number of examples to return (default 5).
sample: str - Sampling technique (random, recent, most_reviewed, best_performance, mature, young).
|
| fetch_due_cards_for_reviewA | Fetch cards due for review, formatted for an LLM to present. Args:
deck: Optional[str] - Filter by specific deck name.
limit: int - Maximum number of cards to fetch (default 5).
today_only: bool - If true, only fetch cards due today. If false, fetch cards due up to MAX_FUTURE_DAYS ahead (currently {MAX_FUTURE_DAYS}).
|
| submit_reviewsA | Submit multiple card reviews to Anki using ratings ('wrong', 'hard', 'good', 'easy'). Args:
reviews: List of review dictionaries, each with:
- card_id (int): The ID of the card reviewed.
- rating (str): 'wrong', 'hard', 'good', or 'easy'.
|
| add_noteB | Add a flashcard to Anki. Ensure you have looked at examples before you do this, and that you have got approval from the user to add the flashcard. For code examples, use <code> tags to format your code.
e.g. <code>def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)</code>
For MathJax, use the <math> tag to format your math equations. This will automatically render the math equations in Anki.
# e.g. <math>\frac{d}{dx}[3\sin(5x)] = 15\cos(5x)</math>
To attach images to a card, use the picture parameter. Each picture object must have a filename
and exactly one source (url, data, or path). The fields list specifies which card fields get the <img> tag inserted.
## How to attach images based on the source:
**User provides a URL:**
[{"url": "https://example.com/photo.jpg", "filename": "photo.jpg", "fields": ["Back"]}]
**User provides a local file (e.g. screenshot, downloaded image):**
[{"path": "/absolute/path/to/image.png", "filename": "image.png", "fields": ["Back"]}]
**Base64-encoded data (for small images only):**
[{"data": "iVBORw0KGgo...", "filename": "diagram.png", "fields": ["Back"]}]
IMPORTANT: When a user shares an image file or screenshot, prefer using "path" with the absolute
file path rather than trying to base64-encode the image contents. AnkiConnect reads the file directly
from disk which is faster and more reliable.
Args:
deckName: str - The target deck name.
modelName: str - The note type (model) name.
fields: dict - Dictionary of field names and their string content.
tags: List[str] - Optional list of tags.
picture: List[dict] - Optional list of picture attachments. Each dict should have:
- filename (str): Name for the stored image file.
- url (str, optional): URL to download the image from.
- path (str, optional): Absolute file path to a local image. Preferred for user-shared files.
- data (str, optional): Base64-encoded image data.
- fields (List[str]): Card field names where the <img> tag will be inserted.
- skipHash (str, optional): MD5 hash to skip if file matches.
|
| store_media_fileA | Store an image or media file in Anki's media folder. Use this tool to store images that can be referenced in flashcard fields using
HTML img tags: <img src="filename">
This is useful when you need to:
- Store an image before creating a note (e.g. to reference it in multiple notes)
- Add an image to an existing card's field
Provide exactly one of url, data, or path:
- path: Absolute path to a local file. PREFERRED when the user shares an image file or screenshot.
- url: A URL to download the image from (e.g. "https://example.com/photo.jpg")
- data: Base64-encoded file content (for small images only)
IMPORTANT: When a user shares an image file or screenshot, prefer using "path" with the absolute
file path. AnkiConnect reads the file directly from disk, which avoids needing to base64-encode
large image files.
Args:
filename: str - The filename to store the media as (e.g. "diagram.png").
url: str - Optional URL to download the image from.
data: str - Optional base64-encoded image data.
path: str - Optional absolute path to a local file. Preferred for user-shared files.
|
| search_notesA | Search for notes in Anki using the powerful built-in search syntax. This tool allows you to find existing notes/flashcards using Anki's query language.
Results include note IDs which can be used for follow-up actions.
## Common Search Patterns
**Simple text search:**
- `dog` - notes containing "dog" (matches "doggy", "underdog")
- `dog cat` - notes with both "dog" AND "cat"
- `dog or cat` - notes with "dog" OR "cat"
- `-cat` - notes WITHOUT "cat"
- `"a dog"` - exact phrase match
- `w:dog` - whole word match only
**Field-specific search:**
- `front:dog` - Front field exactly equals "dog"
- `front:*dog*` - Front field contains "dog"
- `front:` - Front field is empty
- `front:_*` - Front field is non-empty
**Deck and tag filters:**
- `deck:French` - cards in French deck (including subdecks)
- `deck:French -deck:French::*` - only top-level French deck
- `tag:vocab` - notes with "vocab" tag
- `tag:none` - notes without any tags
- `note:Basic` - notes using "Basic" note type
**Card state:**
- `is:due` - cards due for review
- `is:new` - new cards not yet studied
- `is:learn` - cards in learning phase
- `is:review` - review cards
- `is:suspended` - suspended cards
- `is:buried` - buried cards
**Card properties:**
- `prop:ivl>=10` - interval >= 10 days
- `prop:due=0` - due today
- `prop:due=1` - due tomorrow
- `prop:lapses>3` - lapsed more than 3 times
- `prop:ease<2.5` - easier than default
- `prop:reps<10` - reviewed fewer than 10 times
**Recent activity:**
- `added:7` - added in last 7 days
- `edited:3` - edited in last 3 days
- `rated:1` - answered today
- `rated:7:1` - answered "Again" in last 7 days
- `introduced:30` - first answered in last 30 days
**Combining searches:**
- `deck:Spanish tag:verb is:due` - due Spanish verbs
- `added:7 -is:review` - new cards added this week
- `(dog or cat) deck:Animals` - dog or cat in Animals deck
Args:
query: The Anki search query string.
limit: Maximum notes to return (1-100, default 20).
Returns:
JSON array of matching notes with their fields, tags, and note IDs.
|