Skip to main content
Glama
markdown-vault-mcp

markdown-vault-mcp

by pvliesdonk

Edit Note

edit

Replace text in an existing note by exact string match, by line range, or within a line range. Read the note first, then apply precise edits and deletions.

Instructions

Replace text in an existing note, chosen by an exact old_text, by a range of lines, or by an old_text within a range of lines.

Read the note first for its current text. When old_text has no exact match, a unique match after normalising Unicode, dashes, quotes and whitespace is used and reported as match_type "normalized".

Input Schema

NameRequiredDescriptionDefault
pathYesPath of the note.
if_matchNoEtag from read. Pass it, one edit per read, when line_start and line_end are given; omit it for several old_text-only edits to one note at once.
line_endNoLast line to replace, inclusive; pass with line_start.
new_textNoReplacement text; empty deletes the matched text or the lines.
old_textNoText to replace, occurring once in the note or in the line range; omit to replace the whole line range.
line_startNoFirst line to replace, counting from 1 over the content read returns, frontmatter included; pass with line_end.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv6.1.0
    • changedInput schema / properties / if_match / description
      Previous value: -"Optional etag obtained from a previous 'read' call.\nWhen provided, the edit only proceeds if the file has not\nbeen modified since that read (optimistic concurrency)."New value: +"Etag from read. Pass it, one edit per read, when line_start and\nline_end are given; omit it for several old_text-only edits to one note\nat once."
    • changedInput schema / properties / line_end / description
      Previous value: -"Last line to replace (1-based, inclusive).\nMust be provided together with line_start."New value: +"Last line to replace, inclusive; pass with line_start."
    • changedInput schema / properties / line_start / description
      Previous value: -"First line to replace (1-based, inclusive).\nMust be provided together with line_end."New value: +"First line to replace, counting from 1 over the content read\nreturns, frontmatter included; pass with line_end."
    • changedInput schema / properties / new_text / description
      Previous value: -"Replacement text. May be longer or shorter."New value: +"Replacement text; empty deletes the matched text or the lines."
    • changedInput schema / properties / old_text / description
      Previous value: -"Text to replace. Must appear exactly once in the\ndocument or line range. Get this via 'read'. Optional\nwhen using line-range mode."New value: +"Text to replace, occurring once in the note or in the line range;\nomit to replace the whole line range."
    • changedInput schema / properties / path / description
      Previous value: -"Relative path to the document."New value: +"Path of the note."
  2. Addedv4.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so the safety profile is partly covered. The description adds genuinely new behavior — Unicode/dash/quote/whitespace normalisation matching and that such a match is reported as match_type "normalized" — but says nothing about failure when no unique match exists, what is returned, or why edits are not idempotent.

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?

Front-loaded with the core action and the three modes, then the operational prerequisite, then the normalisation caveat — a sensible ordering. Slightly dense in the second sentence and the awkward mid-sentence line breaks make it marginally harder to scan, but no sentence is filler.

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?

With a full schema and an output schema present, return values need not be explained, and the description covers the modes plus one non-obvious edge case (normalised matching). It is slightly incomplete on the no-match/ambiguous-match error path and on why repeat calls are not idempotent, which matter for an edit tool.

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 six parameters (including the if_match concurrency rules and line_start/line_end pairing) are already documented in the schema; baseline is 3. The description reinforces the matching semantics of old_text and adds the uniqueness-after-normalisation rule, but does not extend meaning for path, new_text or if_match beyond what the schema states.

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 ('Replace text in an existing note') and enumerates the three selection modes (exact old_text, line range, old_text within a range). Together with the title 'Edit Note' this readily separates it from sibling mutation tools like write, append, rename and delete, though none of those siblings are named explicitly.

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?

Gives a clear prerequisite ('Read the note first for its current text') and a conditional fallback rule for when an exact old_text match does not exist. It stops short of stating when to prefer this over append/write or when a line-range edit is preferable to an old_text edit, so the alternative-selection guidance is only implied.

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