Skip to main content
Glama
obsidian-mcp

obsidian-mcp

by Soleil1043

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

NameRequiredDescriptionDefault
tagNo只搜索包含该标签的笔记(frontmatter tags 或行内 #tag;支持嵌套形式 a/b)
sortNo结果排序:path=按文件路径(默认);modified=按修改时间(新在前);matches=按文件命中数(多在前)
queryYes搜索关键词:纯文本子串匹配(非正则),例如笔记标题、待办字样
cursorNo分页游标:传上一次结果返回的 next_cursor 获取下一页
folderNo限定搜索的目录(vault 内 POSIX 风格相对路径);省略表示整个 vault
max_resultsNo每页最多返回的命中行数;默认 100,上限 1000
case_sensitiveNo是否区分大小写;默认 false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the return shape (file, line number, line content, per-file match count), the next_cursor pagination contract, and explicit scope exclusions (.obsidian/.trash hidden dirs and non-Markdown files). It omits read-only assurance and any performance/limit caveats beyond max_results.

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?

Three dense sentences, front-loaded with what the tool does, then options, then scope exclusions. No filler, though the parenthetical enumerations make it slightly crowded and the folder parameter is left out entirely.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter tool with no annotations and no output schema, the description covers return fields, pagination workflow, and search scope exclusions, which compensates well. Gaps remain around the folder parameter's interaction with tag/sort and any read-only or size-limit guarantees.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter is already documented in the schema, including the sort enum values and the cursor contract. The description mostly restates those semantics rather than adding new meaning (e.g. it never explains the folder parameter or tie-breaking between sort modes). Baseline 3 applies.

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?

States a specific verb and resource ('按关键词全文搜索笔记' in an Obsidian vault), pins down matching semantics ('纯文本子串匹配,非正则'), and enumerates what is returned. An agent can tell this apart from list_notes/read_note because keyword-driven full-text retrieval is explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains operational options (sort modes, tag filtering, cursor paging) but never says when to prefer this over siblings like list_notes or read_note, nor any when-not condition. Usage is implied by the tool's purpose rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.