Skip to main content
Glama

note_findNotes

Find Anki note IDs using search queries to locate specific flashcards for review or management.

Instructions

Returns an array of note IDs for a given Anki search query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAnki search query (e.g., 'deck:current card:1').

Implementation Reference

  • The handler function for the 'note_findNotes' tool. It wraps the AnkiConnect 'findNotes' API call, providing input validation via Pydantic and prefixes to 'note_findNotes' upon registration.
    @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)
  • Registers the note_mcp server into the main anki_mcp instance with 'note' prefix, transforming 'findNotes' tool to 'note_findNotes'.
    async def setup(run_server: bool = True):
        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)
        if run_server:
            await anki_mcp.run_async()
  • Helper function that performs the actual HTTP POST request to AnkiConnect API, handling errors and invoked by the note_findNotes handler.
    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                                                                        
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the return type ('array of note IDs') without detailing behavioral aspects like error handling, rate limits, permissions needed, or whether the search is case-sensitive. It mentions the query example but doesn't explain search limitations or result formatting.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core functionality ('Returns an array of note IDs') and includes a practical example. There is no wasted verbiage or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read operation with no output schema, the description is minimally adequate but lacks completeness. It doesn't explain the return format (e.g., array structure), error cases, or how results relate to other tools like 'note_notesInfo', leaving gaps for an AI agent to infer behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single 'query' parameter with an example. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Returns') and resource ('array of note IDs'), specifying it's for an Anki search query. It distinguishes from sibling tools like 'note_notesInfo' (which returns full note info) by focusing on IDs only, but doesn't explicitly contrast with 'card_findCards' (which finds cards rather than notes).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for searching notes via Anki queries, but provides no explicit guidance on when to use this tool versus alternatives like 'card_findCards' or 'note_notesInfo'. It mentions the query format example but lacks context on prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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