note_notesInfo
Retrieve detailed information for specific note IDs from Anki flashcards using a structured query, enabling efficient management and organization of learning content.
Instructions
Returns a list of objects containing information for each note ID provided.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | A list of note IDs. |
Implementation Reference
- src/anki_mcp/note_service.py:23-30 (handler)Handler function for the 'note_notesInfo' tool (internally 'notesInfo' with 'note_' prefix). It accepts a list of note IDs and retrieves detailed information about those notes by calling the AnkiConnect 'notesInfo' API.@note_mcp.tool( name="notesInfo", description="Returns a list of objects containing information for each note ID provided.", ) async def get_notes_info_tool( notes: Annotated[List[int], Field(description="A list of note IDs.")], ) -> List[Dict[str, Any]]: return await anki_call("notesInfo", notes=notes)
- src/anki_mcp/__init__.py:24-24 (registration)Registers all tools from the note service (note_mcp) with the 'note_' prefix on the main AnkiMCP server, making 'notesInfo' available as 'note_notesInfo'.await anki_mcp.import_server("note", note_mcp)
- src/anki_mcp/common.py:8-23 (helper)Shared helper utility that performs the actual HTTP request to the AnkiConnect server. Used by the notesInfo handler to fetch note data.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