note_findNotes
Retrieve Anki note IDs based on a specified search query to streamline note management and organization within your Anki flashcards.
Instructions
Returns an array of note IDs for a given Anki search query.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Anki search query (e.g., 'deck:current card:1'). |
Implementation Reference
- src/anki_mcp/note_service.py:11-20 (handler)The handler function for the 'findNotes' tool on note_mcp, which becomes 'note_findNotes' after prefixing during registration. It takes an Anki search query and returns a list of note IDs by calling the underlying anki_call.@note_mcp.tool( name="findNotes", description="Returns an array of note IDs for a given Anki search query.", ) async def find_notes_tool( query: Annotated[ str, Field(description="Anki search query (e.g., 'deck:current card:1').") ], ) -> List[int]: return await anki_call("findNotes", query=query)
- src/anki_mcp/__init__.py:23-27 (registration)Registration of sub-servers into the main anki_mcp server. Specifically, import_server("note", note_mcp) prefixes all tools from note_service.py with 'note_', making 'findNotes' available as 'note_findNotes'.await anki_mcp.import_server("deck", deck_mcp) await anki_mcp.import_server("note", note_mcp) await anki_mcp.import_server("card", card_mcp) await anki_mcp.import_server("model", model_mcp) await anki_mcp.import_server("media", media_mcp)
- src/anki_mcp/note_service.py:11-20 (schema)The tool schema defined by the decorator and function signature: input query:str, output List[int].@note_mcp.tool( name="findNotes", description="Returns an array of note IDs for a given Anki search query.", ) async def find_notes_tool( query: Annotated[ str, Field(description="Anki search query (e.g., 'deck:current card:1').") ], ) -> List[int]: return await anki_call("findNotes", query=query)
- src/anki_mcp/note_service.py:20-20 (helper)Uses the helper anki_call from common.py to invoke the AnkiConnect 'findNotes' API.return await anki_call("findNotes", query=query)