Skip to main content
Glama

replace_in_note

Search and replace text or regular expressions in an Obsidian note, including $1 capture groups, to update content in place without manual edits.

Instructions

Search and replace in a note with plain text or a regular expression ($1 groups allowed).

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

Input Schema

NameRequiredDescriptionDefault
maxNoMax replacements
fileYesNote path ("Folder/Note.md"), path without .md, note name, alias, or [[wikilink]]
regexNo
vaultNoVault name, id or folder path (see list_vaults). Default: OBSIDIAN_VAULT or the vault open in Obsidian.
searchYes
replaceYes
case_insensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent mutation, and the description usefully adds that regex mode exists and that $1 capture groups are substituted in the replacement. However, it says nothing about what happens when no match is found, whether unmatched calls still rewrite the file, or that expansions like $1 behave differently in plain-text mode.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

A single front-loaded sentence with no filler; the regex capability is parenthetically attached without padding. It is efficient, though the brevity comes at the cost of the omissions noted elsewhere.

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?

For a 7-parameter mutation tool with no output schema and under-half schema coverage, the description is thin: it does not say whether the result reports the number of replacements, how the max cap defaults, or how case sensitivity and regex interact. An agent could call it, but not confidently predict its effect.

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 only 43%, and search, replace, regex and case_insensitive carry no schema descriptions. The description partially compensates by explaining regex mode and $1 group substitution, but leaves case sensitivity, the max-replacement cap, and the search-string matching semantics entirely undocumented.

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 and resource ("Search and replace in a note") plus the two supported matching modes, so the agent knows exactly what operation is performed. It does not distinguish itself from close siblings like batch_replace or replace_lines, so it stops short of a 5.

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 when-to-use or when-not-to-use guidance, no mention of prerequisites (e.g. the note must exist), and no routing to an alternative such as batch_replace for multi-note edits. The agent must infer scope entirely from the name.

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