note_notesInfo
Retrieve detailed information for specific Anki note IDs to manage and analyze flashcard content effectively.
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 implementation for the 'notesInfo' tool (becomes 'note_notesInfo' after prefixing). Calls AnkiConnect API to fetch info for given note IDs.@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 the note_mcp tools with 'note_' prefix into the main anki_mcp server, resulting in tool name 'note_notesInfo'.await anki_mcp.import_server("note", note_mcp)
- src/anki_mcp/note_service.py:8-9 (registration)Creates the note_mcp FastMCP instance where note tools like notesInfo are registered.note_mcp = FastMCP(name="AnkiNoteService")
- src/anki_mcp/common.py:8-23 (helper)Common helper function used by all tools to invoke AnkiConnect API actions, including 'notesInfo'.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
- src/anki_mcp/note_service.py:28-29 (schema)Pydantic schema for input (list of note IDs) and output (list of note info dicts).notes: Annotated[List[int], Field(description="A list of note IDs.")], ) -> List[Dict[str, Any]]: