Skip to main content
Glama

search_notes

Search Anki notes using powerful query syntax to find specific flashcards by text, deck, tags, or card state. Returns note IDs for follow-up actions.

Instructions

Search for notes in Anki using the powerful built-in search syntax.

This tool allows you to find existing notes/flashcards using Anki's query language.
Results include note IDs which can be used for follow-up actions.

Tiered access — call this first to narrow by query, then drill in by ID:
- Default (`return_card_content=False`): cheap response with noteId + a
  ~80-char Front preview, so you can pick which IDs matter.
- `return_card_content=True`: full cleaned field content for every match.
- For scheduling/state details (queue, ease, interval, lapses, review
  history) on specific IDs, call `inspect_cards(note_ids=[...])`. Pass
  `properties=["fields"]` there if you also want the cleaned note content
  alongside the per-card stats in one call.

## Common Search Patterns

**Simple text search:**
- `dog` - notes containing "dog" (matches "doggy", "underdog")
- `dog cat` - notes with both "dog" AND "cat"
- `dog or cat` - notes with "dog" OR "cat"
- `-cat` - notes WITHOUT "cat"
- `"a dog"` - exact phrase match
- `w:dog` - whole word match only

**Field-specific search:**
- `front:dog` - Front field exactly equals "dog"
- `front:*dog*` - Front field contains "dog"
- `front:` - Front field is empty
- `front:_*` - Front field is non-empty

**Deck and tag filters:**
- `deck:French` - cards in French deck (including subdecks)
- `deck:French -deck:French::*` - only top-level French deck
- `tag:vocab` - notes with "vocab" tag
- `tag:none` - notes without any tags
- `note:Basic` - notes using "Basic" note type

**Card state:**
- `is:due` - cards due for review
- `is:new` - new cards not yet studied
- `is:learn` - cards in learning phase
- `is:review` - review cards
- `is:suspended` - suspended cards
- `is:buried` - buried cards

**Card properties:**
- `prop:ivl>=10` - interval >= 10 days
- `prop:due=0` - due today
- `prop:due=1` - due tomorrow
- `prop:lapses>3` - lapsed more than 3 times
- `prop:ease<2.5` - easier than default
- `prop:reps<10` - reviewed fewer than 10 times

**Recent activity:**
- `added:7` - added in last 7 days
- `edited:3` - edited in last 3 days
- `rated:1` - answered today
- `rated:7:1` - answered "Again" in last 7 days
- `introduced:30` - first answered in last 30 days

**Combining searches:**
- `deck:Spanish tag:verb is:due` - due Spanish verbs
- `added:7 -is:review` - new cards added this week
- `(dog or cat) deck:Animals` - dog or cat in Animals deck

Args:
    query: The Anki search query string.
    limit: Maximum notes to return (1-100, default 20).
    return_card_content: If True, returns full cleaned field content per
        note. If False (default), returns a short Front preview per note.

Returns:
    JSON object with `query`, `total_found`, `returned`, and `notes`.
    Each note has `noteId`, `modelName`, `tags`, and either `preview`
    (default) or `fields` (when `return_card_content=True`).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAnki search query string
limitNoMaximum number of notes to return
return_card_contentNoIf False (default), each result returns noteId/modelName/tags plus a short cleaned preview of the Front field. If True, each result returns cleaned, non-empty field content for the whole note.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description explains that results include note IDs for follow-up actions, describes the difference between return_card_content=false (preview) and true (full fields), and references inspect_cards for state details. However, it does not mention any potential limitations on query complexity or rate limits, though as a search tool, destructive behavior is not expected.

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

Conciseness4/5

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

The description is thorough but well-structured with clear sections: an overview, tiered access guidance, and a comprehensive search pattern reference. It is front-loaded with key usage instructions. The length is justified by the complexity of the query syntax, but some redundancy could be trimmed.

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

Completeness5/5

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

Given the tool's complexity, the description fully covers input parameters (with examples), output format (referenced to output schema), and usage scenarios. It provides a complete guide for the agent to use the tool effectively, including boundaries for when to switch to sibling tools.

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

Parameters5/5

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

Schema coverage is 100% (all parameters documented in schema). The description adds significant meaning: it explains the query parameter with dozens of search pattern examples, clarifies the limit default and range, and elaborates on the return_card_content parameter's effect on output.

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

Purpose5/5

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

The description clearly states it's for searching notes in Anki using a built-in search syntax. It specifies the verb 'search' and the resource 'notes', and distinguishes itself from sibling tools like inspect_cards by explaining when to use each.

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

Usage Guidelines5/5

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

Provides explicit guidance on tiered access: using the tool with default parameters for cheap preview, then drilling into specific IDs, and when to call inspect_cards for scheduling details. Also includes extensive search pattern examples, making it clear when to use different query constructs.

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/samefarrar/mcp-ankiconnect'

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