Skip to main content
Glama

note_addNotes

Add multiple notes to Anki flashcards in one action using a structured list of note objects. Returns IDs for successfully created notes, simplifying note management for efficient learning.

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
NameRequiredDescriptionDefault
notesYesA list of note objects to add.

Implementation Reference

  • The handler function implementing the 'note_addNotes' tool. It defines the input schema via Annotated and Field, and executes by calling the AnkiConnect 'addNotes' API through anki_call.
    @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)
  • Registers all tools from note_mcp (including 'addNotes') under the 'note_' prefix in the main AnkiConnectMCP server, making it available as 'note_addNotes'.
    await anki_mcp.import_server("note", note_mcp)
  • Supporting utility that performs HTTP requests to the AnkiConnect server (localhost:8765) for actions like 'addNotes', handling errors and responses.
    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