Skip to main content
Glama
obsidian-mcp-server

obsidian-mcp-server

by mpesavento

Patch Note

vault_patch

Replace a unique string in a note with another string for surgical edits such as updating links, fixing sections, or changing status fields; updates the modified timestamp.

Instructions

Replace a unique string in a note with another string. The old_str must appear exactly once in the file content (not frontmatter). Use for surgical edits: updating links, fixing sections, replacing status fields. Updates modified timestamp.

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>",
      "old_str": "<old_str>",
      "new_str": "<new_str>"
    },
    "name": "vault_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesVault-relative path to the note
new_strYesReplacement string
old_strYesExact string to find and replace (must appear exactly once in content)
agent_nameNoAgent name for attribution

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses the uniqueness constraint, that frontmatter is excluded from the search space, and that the modified timestamp is updated. It does not say what happens when old_str is absent or appears multiple times (error vs. silent no-op), nor whether the file is left unchanged on failure.

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?

Four short sentences with the core operation and the hard constraint front-loaded and the side effect last. Nothing is redundant and no sentence can be removed without losing meaning.

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 4-parameter mutation tool with no annotations and no output schema, the definition covers the essential mechanics: match uniqueness, scope exclusion, and the timestamp side effect. The remaining gap is failure semantics (zero or multiple matches) and whether there is a return value worth inspecting.

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 description coverage is 100%, so the baseline is 3. The description adds a genuine constraint beyond the schema by excluding frontmatter from the match region, but new_str and agent_name receive no additional meaning in the description.

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 precise verb-and-resource pair: replace one unique string with another string inside a note. The stated use cases (updating links, fixing sections, replacing status fields) make plain how it differs from sibling whole-file writers like vault_write or vault_append.

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

Usage Guidelines4/5

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

"Use for surgical edits" gives a clear positive condition with concrete examples, which is what an agent needs to choose this over a full-file rewrite. It stops short of naming an alternative or stating when-not-to-use (e.g. bulk or multi-occurrence replacements), so it is not a full 5.

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