Skip to main content
Glama
BiteFoundry Obsidian MCP Server

BiteFoundry Obsidian MCP Server

replace_note_text

Replaces an exact text string in a Markdown note only when it appears once, returning the match count and whether the replacement ran. Use it to make safe, unambiguous edits or deletions.

Instructions

Replace a literal string only when it occurs exactly once in the Markdown body. Return the match count and whether the replacement ran.

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": {
      "note": "<note>",
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "replace_note_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
findYesExact text to find, including spacing and line endings.
noteYesRelative path, note title, or alias.
vaultNoOptional registered vault name, ID, or path (see list_vaults). Unregistered directories are rejected.
replaceYesReplacement text. Use an empty string to delete the match.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 behavioral burden and does disclose the key failure mode: replacement happens only if the match count is exactly one, and the tool reports the match count plus whether the replacement ran, so an agent can detect ambiguity rather than assume success. It also scopes the operation to the Markdown body, implying frontmatter is untouched. It does not say whether zero matches raises an error or simply returns count 0, which is a remaining gap.

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 short sentences, zero filler, with the uniqueness precondition and the return contract front-loaded. Nothing is repeated from the schema and no sentence could be cut without losing information.

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 four-parameter mutation tool with no annotations and no output schema, the description supplies the essential preconditions and return values, so an agent can invoke it correctly and interpret the result. The only material omission is what happens on zero matches or on vault resolution failure, which the vault parameter's schema partially covers via the list_vaults reference.

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 all four parameters (note, find, replace, vault) are already documented with meaning, including using an empty string to delete. The description adds only the 'literal' and 'exactly once' semantics for the find/replace pair; per-parameter meaning is otherwise unchanged, so the 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?

The description names a specific verb and resource ('Replace a literal string ... in the Markdown body') and adds a precise scope constraint (only when it occurs exactly once). It implicitly distinguishes itself from append_note/create_note by being a substitution operation, but never names a sibling to contrast with, so it stops short of full differentiation.

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 single-occurrence rule implies when the tool is appropriate (targeted edits where the anchor text is unique), but there is no explicit when-not guidance and no pointer to alternatives such as append_note or update_frontmatter for edits that aren't literal-string replacements. Usage must be inferred.

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