note_addNotes
Add multiple notes to Anki flashcards using AnkiConnect. Create notes in batches for efficient flashcard management.
Instructions
Creates multiple notes. See 'addNote' for the structure of each note object in the list. Returns a list of new note IDs, or null for notes that couldn't be created.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | A list of note objects to add. |
Implementation Reference
- src/anki_mcp/note_service.py:79-88 (handler)Handler function for 'note_addNotes' tool. Decorated with @note_mcp.tool(name='addNotes'), it invokes AnkiConnect's 'addNotes' API via anki_call to create multiple notes.@note_mcp.tool( name="addNotes", description="Creates multiple notes. See 'addNote' for the structure of each note object in the list. Returns a list of new note IDs, or null for notes that couldn't be created.", ) async def add_notes_tool( notes: Annotated[ List[Dict[str, Any]], Field(description="A list of note objects to add.") ], ) -> List[Optional[int]]: return await anki_call("addNotes", notes=notes)
- src/anki_mcp/__init__.py:24-24 (registration)Registers all tools from note_mcp (including 'addNotes') into the main anki_mcp server with the 'note_' prefix, resulting in 'note_addNotes'.await anki_mcp.import_server("note", note_mcp)
- src/anki_mcp/common.py:8-23 (helper)Helper function used by note_addNotes handler to make HTTP calls to AnkiConnect API.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