search
[Workflow: search → grep or outline → read] Search indexed documents with a natural-language question. Returns the most relevant documents with titles, paths, types, and text snippets.
After finding target documents, use 'outline' to get summaries in batch or 'grep' to find specific patterns, then use 'read' to read specific sections of interest. When the user names a container by a fuzzy or cross-language word ("WeChat", "Notion notes"), call find_paths first to discover what path_glob to pass.
Scope: omit library to search across your local indexed content (default — Desktop tunnel must be online; cloud libraries are NOT included). Pass library="local://<id>" to scope to one local library, or library="cloud://<owner>/<slug>" to query a linked cloud library. To search across cloud libraries, call list_libraries first to see what is available, then call search once per cloud library.
Set scope="notes" to full-text search the user's markdown card notes instead of indexed documents (use tags to narrow by note tag). Notes live only on the Desktop, so that always rides the tunnel and cannot be combined with a cloud:// library.
Size fields (Desktop-local documents): word_count counts words (one per CJK character or Latin word; whitespace/punctuation/markup excluded) and reads well below a Chinese user's 字数; char_count counts Unicode characters of the extracted body (whitespace/punctuation/markup included, CR excluded) — the figure to match what the user sees. null/omitted char_count = not yet computed (or an older Desktop), not an empty body; read on a local document returns it whenever the Desktop supports it. cloud:// items do not carry char_count.
User annotations: the user's own highlights, notes and comments on clips are searched too. Each result carries matched_in ("content" and/or "annotations"); the Markdown output marks such snippets with "(in annotations)". Pass scope="annotations" to search only the annotation text (keyword-only, no field-qualified clauses). Annotations exist only on the Desktop; cloud:// results do not carry matched_in.
Match source: each result carries matched_by: "keyword" (keyword search found it), "both" (keyword and semantic search), or "semantic" (only semantic search found it; it may not contain the query's words, so treat it as weaker evidence). A query that is only a number of six or more digits, such as an ID or a tax or phone number, runs keyword search only, so it gets no semantic-only hits; separators (.,-/()+, spaces) and up to two letters in a row may be part of it. A shorter number such as a year, or a number with a word (CNPJ 98.765.432/0001-10), runs both searches. Both hold for Desktop results only: cloud:// results do not carry matched_by, and a number query on a cloud library may still run semantic search.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Filter results to documents carrying ALL of the given note tags (AND semantics). Tags are normalized (leading '#' stripped, ASCII lowercased). For OR semantics, issue one call per tag and union the results yourself. Most useful together with scope="notes". | |
| limit | No | Maximum number of results to return (default: 20, max: 50) | |
| query | Yes | One complete natural-language question that states what you are looking for, keeping the names, dates and terms the user gave. If the document may be in a different language from the user's, write the question in the user's language and then again in that other language, in the same query string. Prefer this over a keyword list: search is hybrid (keyword + semantic), and the semantic side works on meaning, so a full sentence usually finds more than a bag of keywords. Keyword queries are also supported: use the distinctive words the document itself would contain (names, terms, an exact identifier, code or error message), in the document's language. Unfiltered searches use hybrid BM25 + vector retrieval. When a backend cannot apply requested filters before ANN Top-K, it uses winner-first BM25 instead so filtered-out rows cannot consume the candidate window. A query that is only a number of six or more digits, such as an ID or a tax or phone number (`98.765.432/0001-10`), runs keyword search only on the Desktop; a shorter number, or one with a word, runs both, and a cloud library may still run semantic search for it. | |
| scope | No | Search scope. "folder" (default) searches all indexed content with the existing `library`/`path_glob` semantics. "notes" restricts results to the local Notes folder (markdown card notes) and ignores `library`/`path_glob`. Notes exist only on the user's Desktop — there is no cloud notes store — so scope="notes" always rides the Desktop tunnel and cannot be combined with a `cloud://` library. "annotations" matches only the text of the user's own annotations (notes and comments written in the clip reader, stored next to the Markdown as `<stem>.annotations.json`), so only documents that carry annotations are returned; `library`, `path_glob` and the other filters still apply, and field-qualified query clauses such as `content:x` are rejected in this scope. Annotations likewise exist only on the user's Desktop — cloud libraries carry none, their results do not carry `matched_in`, and scope="annotations" is rejected when combined with a `cloud://` library. Every result carries `matched_in` ("content" and/or "annotations") telling which part of the document produced a keyword hit (empty when only semantic search found it; `matched_by` says which search did); the default scope searches annotations as well. Unknown values are rejected. Sending `null` or omitting the field both yield the default. | |
| library | No | Restrict search to a specific library. Use `local://<library-id>` to target a local library or `cloud://<owner>/<slug>` to target a cloud library. Plain string is interpreted as a local library name for backward compatibility. Cloud library identifiers must use the `owner/slug` form (e.g. `cloud://acme/handbook`); a single-segment name is rejected. Use list_libraries to see available libraries. Omit to search all your local indexed content (default scope). | |
| doc_types | No | Filter by document type name, as reported in the doc_type field of each result (e.g. ["pdf", "md", "docx"]). Type name, not extension. This is not a closed set — newly supported types appear there without a schema change. | |
| path_glob | No | Glob pattern to filter by file path, matched as a SUBSTRING of the path — the pattern may appear anywhere, you do NOT need leading or trailing wildcards. Syntax: * matches any characters (including /), ? matches exactly one character, [...] matches a character class. Always case-sensitive. Examples: '*.pdf' for all PDFs, 'papers' for paths containing 'papers', '/Users/me/notes/' to scope to everything under that directory (a full absolute directory path works directly — keep the trailing '/'). When the user names a specific folder/container by a fuzzy or cross-language word and the actual path is unknown, call `find_paths` first and use a distinctive segment of the returned path here. | |
| time_sort | No | Reorder the matched candidate set by modification time. "default" (default) preserves the backend relevance order (hybrid when eligible, otherwise BM25); "newest" puts the most recently modified first; "oldest" puts the earliest first. Use "newest" for "recent / latest / most-recent" intent without a fixed time window. Combine with `modified_after`/`modified_before` for "latest in 2024" style queries. Sending `null` or omitting the field both yield the default. | |
| output_format | No | Output format. Defaults to "markdown" (human-readable); set to "json" for structured JSON (machine-parseable). Sending `null` or omitting the field both yield the default. | |
| modified_after | No | Inclusive lower bound on file modification time. Accepts an ISO 8601 string interpreted as UTC: either a bare date (e.g. "2024-01-01", expanded to 00:00:00Z) or a full RFC 3339 datetime (e.g. "2024-01-01T00:00:00Z"). Use for explicit windows like "after January 2024" or "in 2024". For "recent" / "latest" without a fixed window, prefer `time_sort=newest`. Read the current time from any tool response's `[meta] now=…` line / `_meta.now` field to compute relative dates ("last month"). | |
| modified_before | No | Inclusive upper bound on file modification time. Same format as `modified_after` (ISO 8601 UTC; bare date or RFC 3339). |