Skip to main content
Glama

search_notes

Search Anki notes using powerful query syntax to filter by text, deck, tags, card state, and properties. Returns matching notes with 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.

## 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).

Returns:
    JSON array of matching notes with their fields, tags, and note IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAnki search query string
limitNoMaximum number of notes to return

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It explains that results include note IDs for follow-up actions and covers query syntax limitations (e.g., wildcards, exact phrase). However, it does not disclose behavior on invalid queries or case sensitivity.

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 well-structured with headings and bullet points, but it is lengthy. Each section is useful, but it could be more concise without losing essential information.

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 output schema exists, the description appropriately covers return value structure (fields, tags, note IDs). It provides comprehensive search patterns, making it complete for a search tool.

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%, and the description adds significant meaning by explaining the query syntax in detail, including examples for each parameter. This goes far beyond the schema's minimal descriptions.

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 the verb 'Search' and resource 'notes in Anki'. It distinguishes from siblings like add_note or fetch_due_cards_for_review by focusing on finding existing notes using a query language.

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?

Extensive guidance is provided with common search patterns, field-specific searches, deck/tag filters, card state, etc. It implicitly tells the agent when to use this tool (to search for notes) vs alternatives, though it does not explicitly state when not to use it.

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