Anki — Tool Reference
Create, search, review, and schedule Anki flashcards on your computer (via the Toolforest Bridge add-on).
Your AI assistant discovers and invokes these tools through the
MCP Server's meta tools —
it calls execute_tool with the tool name and arguments below.
# add_media_file write
Import an image, audio, or video file into Anki media for local notes.
Full description
Import an image, audio, or video file into Anki media. Provide exactly one source: base64 data, an absolute local path on the Anki computer, or a public http(s) URL. Use the returned filename in note fields, e.g. `<img src="returned.png">` or `[sound:returned.mp3]`. Call sync when you want the media pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | Basename to store in Anki media, e.g. image.png or audio.mp3. Must be an image, audio, or video filename. |
data | string | null | No | Base64-encoded media bytes. Use exactly one of data, path, or url. |
path | string | null | No | Absolute local file path on the computer running Anki. The path basename must match filename. Use exactly one of data, path, or url. |
url | string | null | No | Public http(s) URL to fetch from the computer running Anki. Private, reserved, and redirect-to-private addresses are blocked. Use exactly one of data, path, or url. |
Parameter schema (JSON)
{
"properties": {
"filename": {
"description": "Basename to store in Anki media, e.g. image.png or audio.mp3. Must be an image, audio, or video filename.",
"title": "Filename",
"type": "string"
},
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Base64-encoded media bytes. Use exactly one of data, path, or url.",
"title": "Data"
},
"path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Absolute local file path on the computer running Anki. The path basename must match filename. Use exactly one of data, path, or url.",
"title": "Path"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Public http(s) URL to fetch from the computer running Anki. Private, reserved, and redirect-to-private addresses are blocked. Use exactly one of data, path, or url.",
"title": "Url"
}
},
"required": [
"filename"
],
"title": "AddMediaFileParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"filename": {
"description": "Actual filename stored in Anki media.",
"title": "Filename",
"type": "string"
}
},
"required": [
"filename"
],
"title": "AddMediaFileResult",
"type": "object"
} # add_note write
Add one flashcard note locally. Call get_model_schema first, and sync when ready.
Full description
Add one flashcard note locally. Call get_model_schema first if you are unsure of the note type's fields. Call sync when you want the new note pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
deck | string | Yes | Target deck name. |
model | string | null | No | Note type / model name (e.g. 'Basic', 'Basic (and reversed card)', 'Cloze'). Default: "Basic" |
fields | object | Yes | Field name → value. For 'Basic': {'Front': ..., 'Back': ...}. For 'Cloze': {'Text': 'The {{c1::capital}} of France', 'Back Extra': ...}. |
tags | array<string> | null | No | Optional tags. |
allow_duplicate | boolean | null | No | Allow creating a duplicate note. Default: false |
Parameter schema (JSON)
{
"properties": {
"deck": {
"description": "Target deck name.",
"title": "Deck",
"type": "string"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "Basic",
"description": "Note type / model name (e.g. 'Basic', 'Basic (and reversed card)', 'Cloze').",
"title": "Model"
},
"fields": {
"additionalProperties": {
"type": "string"
},
"description": "Field name → value. For 'Basic': {'Front': ..., 'Back': ...}. For 'Cloze': {'Text': 'The {{c1::capital}} of France', 'Back Extra': ...}.",
"title": "Fields",
"type": "object"
},
"tags": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional tags.",
"title": "Tags"
},
"allow_duplicate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Allow creating a duplicate note.",
"title": "Allow Duplicate"
}
},
"required": [
"deck",
"fields"
],
"title": "NoteInput",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"note_id": {
"title": "Note Id",
"type": "integer"
}
},
"required": [
"note_id"
],
"title": "AddNoteResult",
"type": "object"
} # add_notes write
Add many flashcards at once. Call sync when you want local changes pushed to AnkiWeb.
Full description
Add many flashcard notes locally. Returns one note id, or null, per input note. Call sync when you want the accepted notes pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
notes | array<NoteInput> | Yes | Notes to add in one batch. |
Parameter schema (JSON)
{
"$defs": {
"NoteInput": {
"properties": {
"deck": {
"description": "Target deck name.",
"title": "Deck",
"type": "string"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "Basic",
"description": "Note type / model name (e.g. 'Basic', 'Basic (and reversed card)', 'Cloze').",
"title": "Model"
},
"fields": {
"additionalProperties": {
"type": "string"
},
"description": "Field name → value. For 'Basic': {'Front': ..., 'Back': ...}. For 'Cloze': {'Text': 'The {{c1::capital}} of France', 'Back Extra': ...}.",
"title": "Fields",
"type": "object"
},
"tags": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional tags.",
"title": "Tags"
},
"allow_duplicate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Allow creating a duplicate note.",
"title": "Allow Duplicate"
}
},
"required": [
"deck",
"fields"
],
"title": "NoteInput",
"type": "object",
"additionalProperties": false
}
},
"properties": {
"notes": {
"description": "Notes to add in one batch.",
"items": {
"$ref": "#/$defs/NoteInput"
},
"title": "Notes",
"type": "array"
}
},
"required": [
"notes"
],
"title": "AddNotesParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"note_ids": {
"description": "New note id per input note, in order. null = that note was rejected (e.g. duplicate).",
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"title": "Note Ids",
"type": "array"
},
"added": {
"title": "Added",
"type": "integer"
},
"rejected": {
"title": "Rejected",
"type": "integer"
},
"partial_error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Non-fatal detail when some inputs were rejected or later chunks could not be attempted.",
"title": "Partial Error"
}
},
"required": [
"note_ids",
"added",
"rejected"
],
"title": "AddNotesResult",
"type": "object"
} # answer_cards write
Submit review ratings for due cards (1=Again,2=Hard,3=Good,4=Easy). Call sync after.
Full description
Submit review ratings for due cards locally. Ease values are 1=Again, 2=Hard, 3=Good, and 4=Easy. Call sync when you want the review changes pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
answers | array<CardAnswer> | Yes | One rating per card being reviewed. |
Parameter schema (JSON)
{
"$defs": {
"CardAnswer": {
"properties": {
"card_id": {
"description": "Card id (from get_due_cards/find_cards).",
"title": "Card Id",
"type": "integer"
},
"ease": {
"description": "Review rating: 1=Again, 2=Hard, 3=Good, 4=Easy.",
"maximum": 4,
"minimum": 1,
"title": "Ease",
"type": "integer"
}
},
"required": [
"card_id",
"ease"
],
"title": "CardAnswer",
"type": "object",
"additionalProperties": false
}
},
"properties": {
"answers": {
"description": "One rating per card being reviewed.",
"items": {
"$ref": "#/$defs/CardAnswer"
},
"title": "Answers",
"type": "array"
}
},
"required": [
"answers"
],
"title": "AnswerCardsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"answered": {
"description": "Per-card success flag, in order.",
"items": {
"type": "boolean"
},
"title": "Answered",
"type": "array"
}
},
"required": [
"answered"
],
"title": "AnswerCardsResult",
"type": "object"
} # check_bridge_status read
Check whether the Toolforest Bridge (Anki) is connected for this user.
Full description
Check whether the Toolforest Bridge is connected for Anki. This meta tool reports whether the current user has a live Anki bridge connection.
No parameters.
Parameter schema (JSON)
{
"properties": {},
"title": "Empty",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"connected": {
"title": "Connected",
"type": "boolean"
},
"device_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Device Id"
},
"agent_version": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Agent Version"
},
"protocol_version": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Protocol Version"
},
"update_required": {
"default": false,
"title": "Update Required",
"type": "boolean"
},
"message": {
"title": "Message",
"type": "string"
}
},
"required": [
"connected",
"message"
],
"title": "BridgeStatusResult",
"type": "object"
} # create_deck write
Create a new Anki deck. Call sync when you want local changes pushed to AnkiWeb.
Full description
Create a new Anki deck locally. Call sync when you want the local deck change pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Deck name. Use '::' for nested decks, e.g. 'Spanish::Verbs'. |
Parameter schema (JSON)
{
"properties": {
"name": {
"description": "Deck name. Use '::' for nested decks, e.g. 'Spanish::Verbs'.",
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "CreateDeckParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"deck_id": {
"title": "Deck Id",
"type": "integer"
}
},
"required": [
"name",
"deck_id"
],
"title": "CreateDeckResult",
"type": "object"
} # create_model write
Create a new note type locally with custom fields/templates. Call sync when ready.
Full description
Create a new note type locally with custom fields and templates. Call sync when you want the new note type pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Name for the new note type. |
fields | array<string> | Yes | Ordered field names, e.g. ['Question', 'Answer']. |
card_templates | array<CardTemplate> | Yes | One or more card templates. |
css | string | null | No | Optional shared CSS for the cards. |
is_cloze | boolean | null | No | Create a cloze-deletion note type. Default: false |
Parameter schema (JSON)
{
"$defs": {
"CardTemplate": {
"properties": {
"name": {
"description": "Template name, e.g. 'Card 1'.",
"title": "Name",
"type": "string"
},
"front": {
"description": "Front template HTML, e.g. '{{Question}}'.",
"title": "Front",
"type": "string"
},
"back": {
"description": "Back template HTML, e.g. '{{FrontSide}}<hr>{{Answer}}'.",
"title": "Back",
"type": "string"
}
},
"required": [
"name",
"front",
"back"
],
"title": "CardTemplate",
"type": "object",
"additionalProperties": false
}
},
"properties": {
"model": {
"description": "Name for the new note type.",
"title": "Model",
"type": "string"
},
"fields": {
"description": "Ordered field names, e.g. ['Question', 'Answer'].",
"items": {
"type": "string"
},
"title": "Fields",
"type": "array"
},
"card_templates": {
"description": "One or more card templates.",
"items": {
"$ref": "#/$defs/CardTemplate"
},
"title": "Card Templates",
"type": "array"
},
"css": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional shared CSS for the cards.",
"title": "Css"
},
"is_cloze": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Create a cloze-deletion note type.",
"title": "Is Cloze"
}
},
"required": [
"model",
"fields",
"card_templates"
],
"title": "CreateModelParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"default": true,
"title": "Ok",
"type": "boolean"
}
},
"title": "OkResult",
"type": "object"
} # delete_deck write
Delete an Anki deck locally. Requires confirm=true; call sync to push changes.
Full description
Delete an Anki deck locally. Requires confirm=true. If the deck contains cards, delete_cards=true is also required. Call sync when you want the deletion pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
deck | string | Yes | Deck name to delete. |
confirm | boolean | null | No | Must be true to actually delete — deck deletion is permanent. Default: false |
delete_cards | boolean | null | No | Delete cards/notes in the deck. Required when the deck contains cards. Default: false |
include_subdecks | boolean | null | No | Also delete subdecks whose names start with '<deck>::'. Default: false |
Parameter schema (JSON)
{
"properties": {
"deck": {
"description": "Deck name to delete.",
"title": "Deck",
"type": "string"
},
"confirm": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Must be true to actually delete — deck deletion is permanent.",
"title": "Confirm"
},
"delete_cards": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Delete cards/notes in the deck. Required when the deck contains cards.",
"title": "Delete Cards"
},
"include_subdecks": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Also delete subdecks whose names start with '<deck>::'.",
"title": "Include Subdecks"
}
},
"required": [
"deck"
],
"title": "DeleteDeckParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"deleted": {
"description": "Decks actually removed from the collection.",
"items": {
"type": "string"
},
"title": "Deleted",
"type": "array"
},
"cards_deleted": {
"description": "Number of cards matched before deletion.",
"title": "Cards Deleted",
"type": "integer"
}
},
"required": [
"deleted",
"cards_deleted"
],
"title": "DeleteDeckResult",
"type": "object"
} # delete_media_file write
Delete an Anki media file locally. Requires confirm=true; call sync to push changes.
Full description
Delete an Anki media file locally. Requires confirm=true. Call sync when you want the deletion pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | Anki media basename to delete. |
confirm | boolean | null | No | Must be true to actually delete — media deletion is permanent. Default: false |
Parameter schema (JSON)
{
"properties": {
"filename": {
"description": "Anki media basename to delete.",
"title": "Filename",
"type": "string"
},
"confirm": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Must be true to actually delete — media deletion is permanent.",
"title": "Confirm"
}
},
"required": [
"filename"
],
"title": "DeleteMediaFileParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"filename": {
"title": "Filename",
"type": "string"
},
"deleted": {
"title": "Deleted",
"type": "boolean"
}
},
"required": [
"filename",
"deleted"
],
"title": "DeleteMediaFileResult",
"type": "object"
} # delete_model write
Delete an unused note type locally. Requires confirm=true; call sync to push changes.
Full description
Delete an unused note type locally. Requires confirm=true. The note type must have zero notes; delete or move its notes first. Call sync when you want the deletion pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Name of the note type / model to delete. |
confirm | boolean | null | No | Must be true to actually delete — note type deletion is permanent. Default: false |
Parameter schema (JSON)
{
"properties": {
"model": {
"description": "Name of the note type / model to delete.",
"title": "Model",
"type": "string"
},
"confirm": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Must be true to actually delete — note type deletion is permanent.",
"title": "Confirm"
}
},
"required": [
"model"
],
"title": "DeleteModelParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"model": {
"title": "Model",
"type": "string"
},
"model_id": {
"title": "Model Id",
"type": "integer"
},
"deleted": {
"title": "Deleted",
"type": "boolean"
}
},
"required": [
"model",
"model_id",
"deleted"
],
"title": "DeleteModelResult",
"type": "object"
} # delete_notes write
Permanently delete notes and cards. Requires confirm=true; call sync to push changes.
Full description
Permanently delete notes and their cards. Requires confirm=true. Call sync when you want the deletion pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
note_ids | array<integer> | Yes | Notes to permanently delete. |
confirm | boolean | null | No | Must be true to actually delete — deletion is permanent and not undoable via this tool. Default: false |
Parameter schema (JSON)
{
"properties": {
"note_ids": {
"description": "Notes to permanently delete.",
"items": {
"type": "integer"
},
"title": "Note Ids",
"type": "array"
},
"confirm": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "Must be true to actually delete — deletion is permanent and not undoable via this tool.",
"title": "Confirm"
}
},
"required": [
"note_ids"
],
"title": "DeleteNotesParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"deleted": {
"title": "Deleted",
"type": "integer"
}
},
"required": [
"deleted"
],
"title": "DeleteNotesResult",
"type": "object"
} # find_cards read
Search cards with Anki query syntax and return card detail incl. scheduling state (paginated by limit).
Full description
Search cards with Anki query syntax and return card details. The initial search can match many cards; limit controls how many matching cards are hydrated with scheduling/detail fields.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Anki search query, e.g. 'deck:Spanish tag:verb', 'is:due', 'front:hola', 'added:7'. Same syntax as Anki's Browse screen. |
limit | integer | null | No | Max items to return full detail for (1-100). Default: 25 |
Parameter schema (JSON)
{
"properties": {
"query": {
"description": "Anki search query, e.g. 'deck:Spanish tag:verb', 'is:due', 'front:hola', 'added:7'. Same syntax as Anki's Browse screen.",
"title": "Query",
"type": "string"
},
"limit": {
"anyOf": [
{
"maximum": 100,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": 25,
"description": "Max items to return full detail for (1-100).",
"title": "Limit"
}
},
"required": [
"query"
],
"title": "SearchParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"total_matched": {
"title": "Total Matched",
"type": "integer"
},
"returned": {
"title": "Returned",
"type": "integer"
},
"cards": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Cards",
"type": "array"
}
},
"required": [
"total_matched",
"returned",
"cards"
],
"title": "FindCardsResult",
"type": "object"
} # find_notes read
Search notes with Anki query syntax and return their fields/tags (paginated by limit).
Full description
Search notes with Anki query syntax and return their fields and tags. The initial search can match many notes; limit controls how many matching notes are hydrated with full details.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Anki search query, e.g. 'deck:Spanish tag:verb', 'is:due', 'front:hola', 'added:7'. Same syntax as Anki's Browse screen. |
limit | integer | null | No | Max items to return full detail for (1-100). Default: 25 |
Parameter schema (JSON)
{
"properties": {
"query": {
"description": "Anki search query, e.g. 'deck:Spanish tag:verb', 'is:due', 'front:hola', 'added:7'. Same syntax as Anki's Browse screen.",
"title": "Query",
"type": "string"
},
"limit": {
"anyOf": [
{
"maximum": 100,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": 25,
"description": "Max items to return full detail for (1-100).",
"title": "Limit"
}
},
"required": [
"query"
],
"title": "SearchParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"total_matched": {
"title": "Total Matched",
"type": "integer"
},
"returned": {
"title": "Returned",
"type": "integer"
},
"notes": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Notes",
"type": "array"
}
},
"required": [
"total_matched",
"returned",
"notes"
],
"title": "FindNotesResult",
"type": "object"
} # get_deck_stats read
Get per-deck due-today queue counts and uncapped composition totals across subdecks.
Full description
Get due-today queue counts and uncapped composition totals for decks. due_today is Anki's scheduler queue for that deck today. composition is the whole deck subtree, including subdecks, counted by card state.
| Parameter | Type | Required | Description |
|---|---|---|---|
decks | array<string> | Yes | Deck names to fetch stats for. |
Parameter schema (JSON)
{
"properties": {
"decks": {
"description": "Deck names to fetch stats for.",
"items": {
"type": "string"
},
"title": "Decks",
"type": "array"
}
},
"required": [
"decks"
],
"title": "GetDeckStatsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"$defs": {
"DeckCompositionStats": {
"properties": {
"total": {
"description": "Total cards in the deck and its subdecks.",
"title": "Total",
"type": "integer"
},
"new": {
"description": "Uncapped new-card count in the deck and its subdecks.",
"title": "New",
"type": "integer"
},
"learning": {
"description": "Uncapped learning/relearning-card count in the deck and its subdecks.",
"title": "Learning",
"type": "integer"
},
"review": {
"description": "Uncapped review-card count in the deck and its subdecks.",
"title": "Review",
"type": "integer"
},
"suspended": {
"description": "Suspended-card count in the deck and its subdecks.",
"title": "Suspended",
"type": "integer"
},
"buried": {
"description": "Buried-card count in the deck and its subdecks.",
"title": "Buried",
"type": "integer"
}
},
"required": [
"total",
"new",
"learning",
"review",
"suspended",
"buried"
],
"title": "DeckCompositionStats",
"type": "object"
},
"DeckStats": {
"properties": {
"deck": {
"title": "Deck",
"type": "string"
},
"due_today": {
"$ref": "#/$defs/DueTodayStats"
},
"composition": {
"$ref": "#/$defs/DeckCompositionStats"
}
},
"required": [
"deck",
"due_today",
"composition"
],
"title": "DeckStats",
"type": "object"
},
"DueTodayStats": {
"properties": {
"new": {
"description": "New cards available to study today, capped by deck options.",
"title": "New",
"type": "integer"
},
"learning": {
"description": "Learning cards due now/today.",
"title": "Learning",
"type": "integer"
},
"review": {
"description": "Review cards due today.",
"title": "Review",
"type": "integer"
}
},
"required": [
"new",
"learning",
"review"
],
"title": "DueTodayStats",
"type": "object"
}
},
"properties": {
"stats": {
"additionalProperties": {
"$ref": "#/$defs/DeckStats"
},
"title": "Stats",
"type": "object"
}
},
"required": [
"stats"
],
"title": "GetDeckStatsResult",
"type": "object"
} # get_due_cards read
Get cards due for review now (optionally for one deck), with their question/answer detail.
Full description
Get cards due for review now, optionally limited to one deck. Returns hydrated question/answer card detail for up to limit matching cards.
| Parameter | Type | Required | Description |
|---|---|---|---|
deck | string | null | No | Limit to this deck (optional). |
limit | integer | null | No | Default: 25 |
Parameter schema (JSON)
{
"properties": {
"deck": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Limit to this deck (optional).",
"title": "Deck"
},
"limit": {
"anyOf": [
{
"maximum": 100,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": 25,
"title": "Limit"
}
},
"title": "GetDueCardsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"total_matched": {
"title": "Total Matched",
"type": "integer"
},
"returned": {
"title": "Returned",
"type": "integer"
},
"cards": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Cards",
"type": "array"
}
},
"required": [
"total_matched",
"returned",
"cards"
],
"title": "FindCardsResult",
"type": "object"
} # get_media_file read
Read a file from Anki media as base64.
Full description
Read a file from Anki media as base64. This is intended for small media files. The bridge refuses files that are too large to return reliably through the tool response.
| Parameter | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | Anki media basename to read. |
Parameter schema (JSON)
{
"properties": {
"filename": {
"description": "Anki media basename to read.",
"title": "Filename",
"type": "string"
}
},
"required": [
"filename"
],
"title": "GetMediaFileParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"filename": {
"title": "Filename",
"type": "string"
},
"data": {
"description": "Base64-encoded media bytes.",
"title": "Data",
"type": "string"
},
"mime_type": {
"title": "Mime Type",
"type": "string"
},
"size_bytes": {
"title": "Size Bytes",
"type": "integer"
}
},
"required": [
"filename",
"data",
"mime_type",
"size_bytes"
],
"title": "GetMediaFileResult",
"type": "object"
} # get_model_schema read
Get a note type's field names and card templates, so you can build valid notes for it.
Full description
Get a note type's field names and card templates. Use this before creating notes when you are unsure which fields the model requires.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model / note type name, e.g. 'Basic' or 'Cloze'. |
Parameter schema (JSON)
{
"properties": {
"model": {
"description": "Model / note type name, e.g. 'Basic' or 'Cloze'.",
"title": "Model",
"type": "string"
}
},
"required": [
"model"
],
"title": "GetModelSchemaParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"model": {
"title": "Model",
"type": "string"
},
"fields": {
"items": {
"type": "string"
},
"title": "Fields",
"type": "array"
},
"card_templates": {
"additionalProperties": true,
"title": "Card Templates",
"type": "object"
}
},
"required": [
"model",
"fields",
"card_templates"
],
"title": "GetModelSchemaResult",
"type": "object"
} # list_decks read
List the names of all decks in the user's Anki collection.
No parameters.
Parameter schema (JSON)
{
"properties": {},
"title": "Empty",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"decks": {
"items": {
"type": "string"
},
"title": "Decks",
"type": "array"
}
},
"required": [
"decks"
],
"title": "ListDecksResult",
"type": "object"
} # list_media_files read
List filenames in Anki media, optionally filtered by a glob pattern.
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | null | No | Optional filename glob, e.g. '*.png'. Path separators are not allowed. |
Parameter schema (JSON)
{
"properties": {
"pattern": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional filename glob, e.g. '*.png'. Path separators are not allowed.",
"title": "Pattern"
}
},
"title": "ListMediaFilesParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"filenames": {
"items": {
"type": "string"
},
"title": "Filenames",
"type": "array"
}
},
"required": [
"filenames"
],
"title": "ListMediaFilesResult",
"type": "object"
} # list_models read
List all note type (model) names available in the collection.
Full description
List all note type, or model, names available in the collection.
No parameters.
Parameter schema (JSON)
{
"properties": {},
"title": "Empty",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"models": {
"items": {
"type": "string"
},
"title": "Models",
"type": "array"
}
},
"required": [
"models"
],
"title": "ListModelsResult",
"type": "object"
} # manage_note_tags write
Add and/or remove tags on one or more notes locally. Call sync when ready.
Full description
Add and/or remove tags on one or more notes locally. Omit add_tags or remove_tags when only doing one operation. Call sync when you want the tag changes pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
note_ids | array<integer> | Yes | Notes to modify. |
add_tags | array<string> | null | No | Tags to add. |
remove_tags | array<string> | null | No | Tags to remove. |
Parameter schema (JSON)
{
"properties": {
"note_ids": {
"description": "Notes to modify.",
"items": {
"type": "integer"
},
"title": "Note Ids",
"type": "array"
},
"add_tags": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Tags to add.",
"title": "Add Tags"
},
"remove_tags": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Tags to remove.",
"title": "Remove Tags"
}
},
"required": [
"note_ids"
],
"title": "ManageNoteTagsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"default": true,
"title": "Ok",
"type": "boolean"
}
},
"title": "OkResult",
"type": "object"
} # move_cards_to_deck write
Move cards into a different deck locally. Call sync when ready.
Full description
Move cards into a different deck locally. Anki creates the destination deck if needed. Call sync when you want the move pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
card_ids | array<integer> | Yes | Cards to move. |
deck | string | Yes | Destination deck name (created by Anki if it doesn't exist). |
Parameter schema (JSON)
{
"properties": {
"card_ids": {
"description": "Cards to move.",
"items": {
"type": "integer"
},
"title": "Card Ids",
"type": "array"
},
"deck": {
"description": "Destination deck name (created by Anki if it doesn't exist).",
"title": "Deck",
"type": "string"
}
},
"required": [
"card_ids",
"deck"
],
"title": "MoveCardsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"default": true,
"title": "Ok",
"type": "boolean"
}
},
"title": "OkResult",
"type": "object"
} # reschedule_cards write
Set cards' next due date locally. Call sync when ready.
Full description
Set cards' next due date locally. days is a number or range of days from today. Call sync when you want the scheduling change pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
card_ids | array<integer> | Yes | Cards to reschedule. |
days | string | Yes | Days from today until next review. A number ('3') or a range ('1-7' = random in range). '0' = due today. |
Parameter schema (JSON)
{
"properties": {
"card_ids": {
"description": "Cards to reschedule.",
"items": {
"type": "integer"
},
"title": "Card Ids",
"type": "array"
},
"days": {
"description": "Days from today until next review. A number ('3') or a range ('1-7' = random in range). '0' = due today.",
"title": "Days",
"type": "string"
}
},
"required": [
"card_ids",
"days"
],
"title": "RescheduleCardsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"default": true,
"title": "Ok",
"type": "boolean"
}
},
"title": "OkResult",
"type": "object"
} # set_cards_suspended write
Suspend or unsuspend cards locally. Call sync when ready.
Full description
Suspend or unsuspend cards locally. Suspended cards are skipped in review. Call sync when you want the change pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
card_ids | array<integer> | Yes | Cards to suspend or unsuspend. |
suspended | boolean | Yes | true = suspend (remove from review), false = unsuspend. |
Parameter schema (JSON)
{
"properties": {
"card_ids": {
"description": "Cards to suspend or unsuspend.",
"items": {
"type": "integer"
},
"title": "Card Ids",
"type": "array"
},
"suspended": {
"description": "true = suspend (remove from review), false = unsuspend.",
"title": "Suspended",
"type": "boolean"
}
},
"required": [
"card_ids",
"suspended"
],
"title": "SetSuspendedParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"default": true,
"title": "Ok",
"type": "boolean"
}
},
"title": "OkResult",
"type": "object"
} # sync write
Sync local Anki changes to AnkiWeb so they appear on the user's other devices.
Full description
Sync local Anki changes to AnkiWeb. Use this after local write operations when you want changes to appear on the user's other devices.
No parameters.
Parameter schema (JSON)
{
"properties": {},
"title": "Empty",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"title": "Ok",
"type": "boolean"
}
},
"required": [
"ok"
],
"title": "SyncResult",
"type": "object"
} # update_note_fields write
Update one or more fields of an existing note locally. Call sync when ready.
Full description
Update one or more fields of an existing note locally. Only the provided fields are changed. Call sync when you want the edit pushed to AnkiWeb.
| Parameter | Type | Required | Description |
|---|---|---|---|
note_id | integer | Yes | Note id (from add_note/find_notes). |
fields | object | Yes | Field name → new value (only the fields to change). |
Parameter schema (JSON)
{
"properties": {
"note_id": {
"description": "Note id (from add_note/find_notes).",
"title": "Note Id",
"type": "integer"
},
"fields": {
"additionalProperties": {
"type": "string"
},
"description": "Field name → new value (only the fields to change).",
"title": "Fields",
"type": "object"
}
},
"required": [
"note_id",
"fields"
],
"title": "UpdateNoteFieldsParams",
"type": "object",
"additionalProperties": false
} Result schema (JSON)
{
"properties": {
"ok": {
"default": true,
"title": "Ok",
"type": "boolean"
}
},
"title": "OkResult",
"type": "object"
}