search_notes
Search Obsidian vault notes by keyword substring and return matching files, line numbers, and hit counts; filter by tag or folder, sort results, and paginate large result sets.
Instructions
在 Obsidian vault 中按关键词全文搜索笔记(纯文本子串匹配,非正则),返回命中文件、行号、行内容与该文件命中总次数。支持 sort 排序(path/modified/matches)、tag 标签过滤(frontmatter 或行内标签)、cursor 游标分页(结果超过 max_results 时用返回的 next_cursor 翻页)。点开头的隐藏目录(.obsidian、.trash 等)与非 Markdown 文件不在搜索范围。
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_notes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | 只搜索包含该标签的笔记(frontmatter tags 或行内 #tag;支持嵌套形式 a/b) | |
| sort | No | 结果排序:path=按文件路径(默认);modified=按修改时间(新在前);matches=按文件命中数(多在前) | |
| query | Yes | 搜索关键词:纯文本子串匹配(非正则),例如笔记标题、待办字样 | |
| cursor | No | 分页游标:传上一次结果返回的 next_cursor 获取下一页 | |
| folder | No | 限定搜索的目录(vault 内 POSIX 风格相对路径);省略表示整个 vault | |
| max_results | No | 每页最多返回的命中行数;默认 100,上限 1000 | |
| case_sensitive | No | 是否区分大小写;默认 false |