Skip to main content
Glama

replace_in_note

Replace exact text in a note's body while preserving frontmatter. Specify note path, old and new text, and choose to change only the first match or all occurrences.

Instructions

Replace text in a note's body content.

Performs plain string find-and-replace on the note body (not frontmatter). Fails if old_text is not found.

Args: note_path: Path to the note relative to vault root. old_text: The exact text to find. new_text: The replacement text. count: Number of occurrences to replace. 1 = first match only (default), 0 = replace all.

Returns: Success message or error description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
new_textYes
old_textYes
note_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the failure mode when old_text is not found, the count semantics (first match vs all), and the scope limitation. It does not mention reversibility or permissions, but the core side effects are well described.

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?

Every sentence earns its place. The opening establishes purpose, the caveats clarify edge cases, the Args section adds semantic detail, and the Returns line sets expectations. No filler or redundant restatement of the tool name.

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

Completeness5/5

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

For a small mutation tool, the description covers the operation, the inputs, the failure case, the replacement count behavior, and the return type. Since an output schema is present, explaining return values in more detail is unnecessary. The description is sufficiently complete for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It fully explains every parameter: note_path as a vault-relative path, old_text as exact text, new_text as replacement, and count with its default and special behavior. This adds meaning well beyond the raw schema.

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?

The description clearly states a specific verb ('Replace'), the target resource ('a note's body content'), and precise behavior ('plain string find-and-replace'). The explicit exclusion of frontmatter helps distinguish it from metadata-focused or append-focused sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: it operates on note body content only, not frontmatter, and is appropriate for plain string replacement. It does not explicitly name sibling alternatives, but the scope and constraints make intended usage clear enough for an agent.

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