Skip to main content
Glama

note_addNote

Add a new note to an Anki deck by specifying deck name, model, fields, and optional tags or media attachments.

Instructions

Creates a new note using the given deck, model, fields, and tags. Returns the ID of the created note or null if the note could not be created.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteYesA dictionary representing the note to add. Should include 'deckName', 'modelName', 'fields', and optionally 'tags', 'options', 'audio', 'video', 'picture'.

Implementation Reference

  • Handler for the 'note_addNote' tool. Defines the tool logic which proxies to AnkiConnect's 'addNote' via anki_call. The prefix 'note_' is added during registration.
    @note_mcp.tool( name="addNote", description="Creates a new note using the given deck, model, fields, and tags. Returns the ID of the created note or null if the note could not be created.", ) async def add_note_tool( note: Annotated[ Dict[str, Any], Field( description="A dictionary representing the note to add. Should include 'deckName', 'modelName', 'fields', and optionally 'tags', 'options', 'audio', 'video', 'picture'." ), ], ) -> Optional[int]: return await anki_call("addNote", note=note)
  • Registers the note service tools with prefix 'note', transforming 'addNote' into 'note_addNote'.
    await anki_mcp.import_server("note", note_mcp)
  • Shared helper function that performs HTTP POST requests to the AnkiConnect server, used by all tool handlers including note_addNote.
    async def anki_call(action: str, **params: Any) -> Any: async with httpx.AsyncClient() as client: payload = {"action": action, "version": 6, "params": params} result = await client.post(ANKICONNECT_URL, json=payload) result.raise_for_status() result_json = result.json() error = result_json.get("error") if error: raise Exception(f"AnkiConnect error for action '{action}': {error}") response = result_json.get("result") if "result" in result_json: return response return result_json

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ujisati/anki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server