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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Anki search query string | |
| limit | No | Maximum number of notes to return | |
| return_card_content | No | If 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
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |