Skip to main content
Glama
Obsidian MCP (pgvector + Ollama, self-hosted)

Obsidian MCP (pgvector + Ollama, self-hosted)

by maxkuminov

Move note

move_note
Destructive

Relocate or rename a vault note and optionally rewrite incoming links in source notes so backlinks keep pointing to the new path, with an optional hash precondition that blocks the move if the note changed.

Instructions

Move or rename a note inside the vault. Requires write permission — a readwrite API key, or an OAuth token carrying the readwrite scope.

Arguments: from_path, to_path (must not exist; parent directories are created), rewrite_links (default False) and the optional expected_hash precondition. The index follows the move, so backlinks keep working without rewriting source notes. Every refusal the server raises ends with one machine-readable MCP-REFUSAL {"code":…} line; an undeclared or mistyped argument is rejected by protocol validation before the tool runs and carries no such line.

expected_hash binds from_path's own bytes and nothing else: pass the content_hash a read returned, verbatim, and the move is refused with nothing written if that note changed since. It is compared at preflight, before the rename and before any rewrite; the rename then pins inode identity but does not compare the bytes again, so an in-place edit landing after that comparison is still moved. The backlink sources a rewrite_links=True move rewrites are not bound, because you never read them. Optional by default — omitted, the move proceeds — unless the deployment requires it, when an omitted hash is refused precondition_required. Codes: stale_precondition, concurrent_write, no_incumbent, malformed_precondition, precondition_unavailable, precondition_required.

With rewrite_links=True, every source note that links to this note is rewritten in place — wikilinks, embeds, path-style links, and bare-href markdown links [text](Old.md), whose new href is written relative to the linking note's own folder; angle-bracket hrefs [text](<Old.md>) are not rewritten. Aliases and anchors survive. The moved note's own body is rewritten as well, so a self-reference does not end up pointing at the old path. The rewrites are planned before anything changes: if one would push a source past the note size limit, or the planning would exceed the aggregate memory bound, the whole move is refused before any file is touched, naming the source or the count.

The same preflight refuses the whole move, before the rename, when any source it would rewrite — the moved note's own body included — contains a fence opener indented by one to three spaces that nothing below it closes. The refusal names each such source and where its opener sits. Move with rewrite_links=False (unaffected by this refusal) and fix the links yourself, or close the fences first.

A rewrite can still fail after the move has committed. The move is one rename and the rewrites follow it, so an I/O failure or a lost vault assignment stops the remaining rewrites and the result reads partial success: …, naming the sources that still link to the old path. The move is not rolled back; treat the link graph as agreeing with the vault bytes only on plain success, and fix the named sources with edit_note.

Success reports the content_hash of the bytes actually published at to_path — the moved bytes for a plain move, the post-rewrite bytes when the moved note's own body was rewritten — and that value binds a following edit_note(to_path, …, expected_hash=…). A failed rewrite stays a partial success and never claims nothing was written; if another writer changed to_path in between, no hash is reported and the result says to re-read to_path first.

Writes are atomic; a symlinked final component on either path is refused. See get_vault_guide for vault folder conventions.

Args: from_path: Vault-relative path of the existing note. to_path: Vault-relative path of the destination. rewrite_links: Also rewrite incoming links in source notes (off by default). expected_hash: from_path's content_hash as you last read it.

Input Schema

NameRequiredDescriptionDefault
to_pathYes
from_pathYes
expected_hashNo
rewrite_linksNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.2
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed1 schema field changedv0.8.1
    • addedInput schema / properties / expected_hash
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Expected Hash"
      +}
  3. Addedv0.7.0
  4. Removedv0.5.4
  5. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations flag destructiveHint=true and non-idempotency, but the description adds substantially more: preflight-before-rename semantics, that a failed rewrite leaves a *partial success* with no rollback, that no hash is reported on concurrent modification, atomicity, and symlink refusal. The expected_hash precondition window (compared once at preflight, not re-compared after) is exactly the kind of subtlety annotations cannot convey.

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 purpose and permission note, then per-concern paragraphs — well organized for a behavior-heavy tool. It is long (~450 words) and repeats the 'nothing was written' vs. 'partial success' contrast more than once, plus the fence-indentation edge case gets a full paragraph, so not every sentence is maximally efficient.

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?

Output schema exists, yet the description still usefully summarizes what success reports (the published content_hash, and when it is omitted). Combined with the refusal-code contract and the non-rollback behavior, an agent has everything needed to invoke this correctly and recover from failures.

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 carry all four parameters — and it does: from_path is the existing note, to_path must not already exist with parent directories auto-created, rewrite_links defaults off and what it triggers, and expected_hash is bound to from_path's bytes with a full list of refusal codes. Each parameter's constraints and failure modes are spelled out.

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?

Opens with a specific verb+resource+scope: "Move or rename a note inside the vault." That cleanly distinguishes it from edit_note, create_note, and delete_note without requiring the agent to open any schema.

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 real routing guidance: state the write-permission prerequisite, tell the agent to use rewrite_links=False plus edit_note when the fence refusal fires, and point to get_vault_guide for folder conventions. It never explicitly contrasts with a sibling mover (there is none) and doesn't say when *not* to move vs. e.g. edit_note, so it falls short of a 5.

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