Skip to main content
Glama
obsidian-mcp

obsidian-mcp

by Soleil1043

manage_frontmatter

Read, set, or delete YAML frontmatter fields in Obsidian notes, automatically creating frontmatter when needed and refusing changes if YAML is invalid.

Instructions

管理 Obsidian 笔记的 YAML frontmatter:get 读取整个 frontmatter 或指定字段(key 省略返回全部);set 写入字段(支持字符串/数字/布尔/null/数组/嵌套对象,无 frontmatter 时自动创建);delete 删除字段(删到空时整块移除 frontmatter)。YAML 损坏时拒绝操作且文件不变。set/delete 支持 if_match 乐观锁。

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": {
      "path": "<path>",
      "action": "<action>"
    },
    "name": "manage_frontmatter"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyNofrontmatter 字段名;get 省略 key 时返回整个 frontmatter 对象
pathYes笔记路径(vault 内 POSIX 风格相对路径,需以 .md 结尾)
valueNoset 时写入的值:字符串/数字/布尔/null/数组/嵌套对象均可(YAML 表达)
actionYesget=读取字段;set=写入字段(无 frontmatter 时自动创建);delete=删除字段(删到空时整块移除)
if_matchNo乐观锁:上次 read_note 返回的 etag,与当前内容不符时拒绝修改(set/delete 可用)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/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 load and does well: it discloses auto-creation of missing frontmatter, whole-block removal when the last field is deleted, refusal with the file left unchanged on corrupted YAML, and optimistic locking via if_match. It does not cover permission requirements or whether reads are cheap/side-effect free, which keeps it below 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense paragraph with the resource first, then the three actions, then failure mode and locking — every clause carries information and nothing is repeated verbatim across sentences.

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 5-parameter mutation tool with no annotations, the definition covers the destructive semantics and the locking contract well. The gap is that it never says whether set or delete returns a new etag, which matters for chaining if_match on successive edits.

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 the baseline is 3; the description largely restates schema facts (key omission returns all, value accepts scalar/array/nested types, if_match is the etag from read_note). It adds little syntax or format meaning beyond what the schema already documents.

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?

The description names a specific verb set (get/set/delete) over a specific resource (YAML frontmatter of Obsidian notes) and enumerates what each action does. An agent can distinguish it from siblings like edit_note or manage_tags based on this text alone.

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 implies when to use it by listing the three actions and their edge cases, such as omitting key to return all fields, but it never states when NOT to use it. There is no explicit guidance that tag edits should go through manage_tags or that body-text edits go through edit_note, which are the real alternatives.

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