Skip to main content
Glama

note_deleteNotes

Remove specific notes from Anki flashcards by specifying their IDs. This tool streamlines note management within the Anki-MCP server, ensuring efficient deletion of unwanted or outdated flashcard content.

Instructions

Deletes notes with the given IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesYesA list of note IDs to delete.

Implementation Reference

  • Handler function for the 'deleteNotes' tool (prefixed to 'note_deleteNotes'). Executes by calling AnkiConnect's deleteNotes via anki_call.
    @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)
  • Imports the note_mcp server which contains the note_deleteNotes tool.
    from .note_service import note_mcp
  • Registers the note_mcp tools under the 'note_' prefix in the main anki_mcp server, making 'deleteNotes' available as 'note_deleteNotes'.
    await anki_mcp.import_server("note", note_mcp)
  • Helper function anki_call used by the handler to make HTTP requests 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
  • Input schema definition for the notes parameter using Pydantic.
    notes: Annotated[List[int], Field(description="A list of note IDs to delete.")],

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