note_deleteNotes
Remove notes from Anki flashcards by specifying their IDs to manage your study materials effectively.
Instructions
Deletes notes with the given IDs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | A list of note IDs to delete. |
Implementation Reference
- src/anki_mcp/note_service.py:72-76 (handler)Handler function `delete_notes_tool` for the `note_deleteNotes` tool. It calls the AnkiConnect `deleteNotes` action with the provided note IDs.@note_mcp.tool(name="deleteNotes", description="Deletes notes with the given IDs.") async def delete_notes_tool( notes: Annotated[List[int], Field(description="A list of note IDs to delete.")], ) -> None: return await anki_call("deleteNotes", notes=notes)
- src/anki_mcp/__init__.py:24-24 (registration)Registers all tools from `note_mcp` (including `deleteNotes`) into the main `anki_mcp` server with the 'note_' prefix, resulting in the tool name `note_deleteNotes`.await anki_mcp.import_server("note", note_mcp)
- src/anki_mcp/common.py:8-23 (helper)Helper function `anki_call` that performs HTTP POST requests to the AnkiConnect server, used by the tool handler to execute the `deleteNotes` action.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