Skip to main content
Glama

find-notes

Locate specific notes in Anki by querying the Anki MCP Server, enabling quick access to stored content for efficient note management.

Instructions

Find notes matching a query in Anki

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The handler function for the 'find-notes' tool. It sends a 'notesInfo' request to Anki with the query, processes the notes by formatting fields, tags, and modification time, and returns formatted text content.
    async def find_notes(query: str) -> list[types.TextContent]:
        result = await make_anki_request("notesInfo", query=query)
        
        if result["success"]:
            notes = result["result"]
            
            if not notes:
                return [
                    types.TextContent(
                        type="text",
                        text=f"No notes found matching query: '{query}'",
                    )
                ]
            
            notes_info = []
            for note in notes:
                note_id = note["noteId"]
                model_name = note["modelName"]
                tags = ", ".join(note["tags"]) if note["tags"] else "(no tags)"
                
                # Format fields
                fields_text = []
                for field_name, field_data in note["fields"].items():
                    field_value = field_data["value"]
                    # Truncate very long field values for display
                    if len(field_value) > 100:
                        field_value = field_value[:97] + "..."
                    fields_text.append(f"  - {field_name}: {field_value}")
                
                # Format modification time
                mod_time = datetime.fromtimestamp(note["mod"]).strftime("%Y-%m-%d %H:%M:%S")
                
                note_text = (
                    f"Note ID: {note_id}\n"
                    f"Model: {model_name}\n"
                    f"Tags: {tags}\n"
                    f"Modified: {mod_time}\n"
                    f"Fields:\n" + "\n".join(fields_text) + "\n"
                )
                notes_info.append(note_text)
            
            return [
                types.TextContent(
                    type="text",
                    text=f"Found {len(notes)} notes matching query: '{query}'\n\n" + "\n\n".join(notes_info),
                )
            ]
        else:
            return [
                types.TextContent(
                    type="text",
                    text=f"Failed to retrieve notes: {result['error']}",
                )
            ]
  • Registers the 'find-notes' tool with the FastMCP app, linking it to the find_notes handler function.
    app.tool(name='find-notes', description='Find notes matching a query in Anki')(find_notes)
  • Type annotations define the input schema (query: str) and output schema (list[types.TextContent]) for the tool.
    async def find_notes(query: str) -> list[types.TextContent]:
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'finds notes matching a query', which implies a read-only search operation, but doesn't disclose critical details like whether it returns all matches or paginates, what format the results are in, error conditions, or performance characteristics. This is a significant gap for a search tool with zero annotation coverage.

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 with zero waste. It's appropriately sized and front-loaded, stating the core purpose immediately without unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (a search operation with one parameter), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what 'notes' are in Anki context, how results are returned, or any behavioral traits, making it inadequate for an agent to use the tool effectively.

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

Parameters2/5

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

The schema description coverage is 0%, with one parameter 'query' undocumented in the schema. The description mentions 'matching a query' but doesn't add any meaning beyond the parameter name—it doesn't explain query syntax, examples, or constraints. With low schema coverage, the description fails to compensate, leaving the parameter semantics unclear.

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 action ('find notes matching a query') and resource ('in Anki'), providing specific verb+resource. However, it doesn't distinguish from sibling tools like 'get-cards-reviewed' or 'get-collection-overview', which might also retrieve note-related information, so it doesn't fully differentiate from alternatives.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'add-or-update-notes' or 'get-cards-reviewed'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage based on the tool name alone.

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

Related 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/johwiebe/anki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server