search_notes
Search notes in an Obsidian vault using ripgrep with optional filters for folder, tags, or frontmatter conditions. Supports pagination and context lines.
Instructions
Search notes with ripgrep, optionally scoped by folder, tags, or a frontmatter where filter (index-resolved candidates, then rg over just those notes). Paginates over matching files: returns { results, truncated, files_returned, files_skipped, files_omitted, matches_capped_in }. Each match carries line_number (file-absolute, ripgrep's) and body_line (1-based body-relative with frontmatter stripped — the same line convention as get_outline/list_tasks/set_task_state, so a hit can be handed straight to those tools; null for hits inside the frontmatter block or in a file the index does not track).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Restrict to notes carrying these tags (leading '#' optional). | |
| limit | No | Max number of files (result entries) to return (default: 20, 0 = unlimited) | |
| match | No | Semantics of tags: 'any' (default) or 'all'. | |
| where | No | Restrict to notes whose frontmatter satisfies these conditions (query_notes syntax). | |
| folder | No | Restrict to notes under this folder. | |
| offset | No | Matching files to skip, for pagination (default 0). | |
| pattern | Yes | The search pattern to use with ripgrep | |
| multiline | No | Enable multiline matching | |
| whole_word | No | Match whole words only | |
| context_lines | No | Number of context lines to show (default: 5) | |
| case_sensitive | No | Case sensitive search (default: false) | |
| max_matches_per_file | No | Max matches to return per file (default: 20, 0 = unlimited) |