Grep
grepSearch note content in a project to find matching notes by keywords, or rank results by meaning and show surrounding line context.
Instructions
Search note content in one project and return matching notes. Not a regex: pattern is matched as full-text keywords by default, and a pattern found in no note returns no results. semantic=True ranks by meaning instead (hybrid semantic plus full-text, when semantic search is enabled). Add context_lines to get case-insensitive matching lines with surrounding context and line numbers. Requires 'project' when several projects are addressable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (1-indexed). | |
| pattern | Yes | Text to search for. | |
| project | No | Project name. Required when more than one project is addressable. | |
| semantic | No | Rank by meaning with hybrid semantic plus full-text retrieval instead of the default keyword matching. Cannot be combined with context_lines. | |
| page_size | No | Results per page (maximum 100 in line-scanning mode). | |
| project_id | No | Project external_id (UUID); takes precedence over `project`. | |
| max_matches | No | Maximum matching lines to show per candidate in line mode (1-100, default 10). Omitted matches carry next_match_line for a targeted read_note or cat read. Edits between calls can shift line positions. | |
| context_lines | No | Return compact literal match windows with 0-10 surrounding lines (not with semantic=True). Case-insensitive substrings, coordinates including frontmatter, overlapping windows merged. Scans current content of this indexed candidate page; pagination/totals count candidates, not exact matches. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||