Skip to main content
Glama
zoeynine

Obsidian Server MCP

by zoeynine

vault_patch

Destructive

Patch Obsidian vault notes by updating headings, blocks, or frontmatter properties only when a supplied version guard matches, preventing overwrites when content has changed.

Instructions

Patch a heading/block/property with ifMatch or ifMatchGuard (copy versionGuard) from a read/map. Copy map keys unchanged. Heading content without within: # is one level below the target for content (default), or the target's actual parent for markerAndContent prepend/append. No automatic retry.

Input Schema

NameRequiredDescriptionDefault
pathYes
scopeNo
valueNo
targetYes
withinNo
contentNo
ifMatchNo
operationYes
targetTypeYes
destinationNoHeading move only: operation=replace, scope=parent; omit content.
ifMatchGuardNo
createTargetIfMissingNo
allowSubtreeReplacementNoExplicitly allow heading content/whole-section replace to remove child sections; the version precondition still applies.
rejectIfContentPreexistsNo

Output Schema

NameRequiredDescriptionDefault
pathYes
createdYes
messageYes
versionYes
warningsNo
sizeBytesYes
versionGuardYes
beforeSizeBytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.2.0
    • addedInput schema / properties / allowSubtreeReplacement
      Added value: +{
      +  "description": "Explicitly allow heading content/whole-section replace to remove child sections; the version precondition still applies.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / content / description
      Removed value: -"Heading target without within: # is a child in content scope, a sibling with markerAndContent prepend/append."
    • addedInput schema / properties / ifMatchGuard
      Added value: +{
      +  "maxLength": 16,
      +  "minLength": 16,
      +  "pattern": "^[0-9a-f]{16}$",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "path",
      -  "targetType",
      -  "target",
      -  "operation",
      -  "ifMatch"
      -]New value: +[
      +  "path",
      +  "targetType",
      +  "target",
      +  "operation"
      +]
    • addedOutput schema / properties / beforeSizeBytes
      Added value: +{
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / versionGuard
      Added value: +{
      +  "maxLength": 16,
      +  "minLength": 16,
      +  "pattern": "^[0-9a-f]{16}$",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "message",
      -  "path",
      -  "version",
      -  "sizeBytes",
      -  "created"
      -]New value: +[
      +  "message",
      +  "path",
      +  "version",
      +  "versionGuard",
      +  "beforeSizeBytes",
      +  "sizeBytes",
      +  "created"
      +]
  2. First observedv0.1.0

TDQS

C2.6/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true, idempotentHint=false, and openWorldHint=false. The description adds useful context that a version precondition (ifMatch/ifMatchGuard) must be copied from a read/map and that no automatic retry occurs, but omits conflict/error behavior and permission requirements.

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

Conciseness3/5

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

It is short, but structured as a dense run-on of cryptic clauses like 'Copy map keys unchanged' and 'markerAndContent prepend/append' that are not interpretable without additional context. The core verb/resource is front-loaded, but the rest is hard to parse.

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

Completeness2/5

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

For a complex mutation tool with 14 parameters, nested objects, and very low schema coverage, the description does not explain most parameter semantics, prerequisites for obtaining the version guard, or error/conflict behavior. An output schema exists, so return values needn't be covered, but the input-side gaps are large.

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

Parameters2/5

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

Schema description coverage is only 14% across 14 parameters, so the description must compensate, but it only touches ifMatch, ifMatchGuard, within, and some scope semantics. Most parameters (path, target, targetType, operation, value, content, destination, createTargetIfMissing, allowSubtreeReplacement, rejectIfContentPreexists) get no explanatory help.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

It states a verb ('Patch') and resource types (heading/block/property), but 'property' does not match the schema's targetType enum (heading/block/frontmatter), and the phrasing is cryptic. It does not clearly distinguish itself from siblings such as vault_replace_text, vault_append, or vault_write.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to use this tool versus vault_replace_text or vault_write. Only oblique hints exist ('from a read/map', 'No automatic retry') without a clear decision rule.

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