Skip to main content
Glama

batch_replace

Destructive

Find and replace text across many Obsidian notes filtered by folder, glob, or tag. Preview changes with dry_run enabled, then apply them with dry_run:false.

Instructions

Find and replace across many notes (filter by folder, glob or tag). dry_run (default true) only reports what would change — run again with dry_run:false to apply.

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": {
      "search": "<search>",
      "replace": "<replace>"
    },
    "name": "batch_replace"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNo
globNo
regexNo
vaultNoVault name, id or folder path (see list_vaults). Default: OBSIDIAN_VAULT or the vault open in Obsidian.
folderNoLimit to this folder (vault-relative)
searchYes
dry_runNo
replaceYes
max_filesNoDefault 500
case_insensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the risk profile is known; the description adds the important behavioral fact that dry_run defaults to true and must be explicitly set to false to apply changes. That is real value beyond the structured fields. It falls short of a 5 because it never mentions that max_files caps the batch or what the dry-run report contains.

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 with zero filler; the scope statement comes first and the safety-relevant dry_run behavior follows. Nothing is redundant with the title or schema.

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 a destructive, 10-parameter batch mutation with no output schema and thin schema descriptions, the definition covers scope and the dry-run safety model but leaves regex/case semantics and the 500-file default cap unexplained. An agent could invoke it correctly in the common case but might silently get regex-literal surprises or truncated batches.

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 coverage is only 30% across 10 parameters, so the description needs to compensate and partly does by covering search, replace, folder, glob, tag and dry_run conceptually. It adds no meaning beyond the parameter names, and critically omits regex mode, case_insensitive, max_files truncation and vault resolution, any of which materially changes results.

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 specific verb and resource ("Find and replace") plus an explicit scope ("across many notes"), which is exactly what separates it from the sibling replace_in_note. An agent can identify the operation and its batch nature without opening the schema.

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?

Usage is implied through the filter options (folder, glob, tag) and the two-step dry_run workflow is spelled out, which is genuine procedural guidance. However, no sibling is named and there is no explicit when-not guidance (e.g. use replace_in_note for a single file), so the agent must infer the boundary itself.

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