Skip to main content
Glama
Obsidian MCP Server
by Kynlos

regex_search_and_replace

Find and replace text across an Obsidian vault using regex patterns, optionally limiting changes to specific files. Apply bulk edits consistently without manually updating notes one by one.

Instructions

Find and replace with regex across vault

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": {
      "pattern": "<pattern>",
      "replacement": "<replacement>"
    },
    "name": "regex_search_and_replace"
  }
}

Input Schema

NameRequiredDescriptionDefault
patternYesRegex pattern to find
filenamesNoOptional specific files to process
replacementYesReplacement text

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden, and it discloses almost nothing beyond the operation name. For a destructive bulk mutation it says nothing about irreversibility, whether replacing across the entire vault is the default, whether a preview or confirmation exists, or how many files get touched.

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?

A single front-loaded sentence with zero wasted words, which is structurally clean. However, the extreme terseness for a destructive operation reads as under-specification rather than disciplined concision.

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?

With no annotations, no output schema, and a vault-wide mutation, the description should at minimum warn about scope and reversibility. It omits everything an agent needs to call this safely, leaving only the bare operation name.

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%, with all three parameters documented inline, so the baseline is 3. The description adds no syntax hints for the regex flavor, replacement backreference syntax, or the consequence of leaving filenames empty.

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 pair (find and replace) plus the resource and its scope ("across vault"), so an agent knows this mutates content rather than just searching. It doesn't explicitly distinguish itself from siblings like search_regex or multi_file_replace, so the differentiation is only inferable from the word "replace".

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 guidance on when to use this versus search_regex or multi_file_replace, no prerequisites, and no caution about running a vault-wide replacement. The agent must guess whether omission of filenames means 'all files' and whether results are reversible.

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

Deploy Server

Other Tools