Skip to main content
Glama
thoreinstein

obsidian-mcp

by thoreinstein

obsidian_replace_in_note

Replace the first occurrence of a specific text string in a note to make surgical inline edits, such as adding a wikilink to existing text.

Instructions

Replace the first occurrence of a specific text string in a note. Use for surgical inline edits, e.g. adding a wikilink to existing text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
new_textNoReplacement text (default: empty string)
old_textYesExact text to find and replace
file_pathYesRelative path to the note
vault_pathNoOptional vault path override

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It helpfully discloses that only the FIRST occurrence is replaced, which is meaningful mutation behavior, but it omits what happens when old_text is not found (error vs no-op), whether the note is created if missing, and any 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.

Conciseness5/5

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

Two tightly written sentences with the core behavior front-loaded and an illustrative example second. Zero waste.

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

Completeness3/5

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

For an edit tool with no annotations and no output schema, the description covers the happy path but leaves edge cases unaddressed (match-not-found behavior, non-destructive guarantee). Schema fully covers parameters, but mutation semantics are only partially disclosed.

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 schema already documents all four parameters (old_text, new_text, file_path, vault_path). The description references old_text/new_text conceptually but adds no syntax or format detail beyond the schema, so baseline 3 applies.

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

Purpose4/5

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

States a specific verb (replace) plus resource (text string in a note) and adds an important scope qualifier ('first occurrence'). It distinguishes itself reasonably from append/insert siblings, but does not explicitly contrast with the closely related obsidian_replace_section, so differentiation is implied rather than stated.

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?

'Use for surgical inline edits, e.g. adding a wikilink to existing text' gives a positive use case, so usage is implied rather than absent. However, it names no alternatives or exclusions despite siblings like obsidian_replace_section and obsidian_insert_at_heading covering overlapping edit territory.

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