Skip to main content
Glama

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
NameRequiredDescriptionDefault
notesYesA list of note IDs.

Implementation Reference

  • 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)
  • 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)
  • Creates the note_mcp FastMCP instance where note tools like notesInfo are registered.
    note_mcp = FastMCP(name="AnkiNoteService")
  • 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
  • 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]]:

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