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

Obsidian MCP (pgvector + Ollama, self-hosted)

by maxkuminov

Move task

move_task
Destructive

Move a task and all lines indented beneath it to another note or section, with duplicate checks, dry-run previews, and interrupted-move resume support.

Instructions

Move one task, with every line indented under it, to another note or to another section of its note. Requires write permission (a readwrite API key or OAuth scope).

Arguments: path and id (the task, both from a listing), to_path (an existing note; never created), to_section, allow_duplicate, resume, dry_run, and the preconditions expected_hash (binds the source note) and to_expected_hash (binds the destination). 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.

The id is re-checked against the source's current text, never a line number. An id shaped <key>.<i>of<n> is accepted only with expected_hash (the source's content_hash from read_note). Only a top-level, unquoted task moves: a nested task, a task in a callout, a block holding a quote, fence or heading line, or a destination whose last top-level task is quoted is refused task_malformed (edit_note can move it by hand). The lines arrive byte for byte; only their line endings follow the destination. They go where add_task would put a new task: after the last top-level task of to_section (or the whole note) and everything under it.

The destination is written first. Immediately before the source is written, in the same step, the destination is re-read and must still hold the moved lines; otherwise the source is left alone. A stop after the destination was written answers task_move_incomplete (partial, never nothing_written): its destination: and source: lines state only what was checked, its complete with: line names the exact call that finishes the move, and the sentinel carries destination_path, source_id, destination_id and reason. One window remains: an outside save of an older destination while the source is being written can lose the task.

A destination task with the same id (an identical copy included), or an open task with the same description, is refused duplicate_task; allow_duplicate=true keeps both. resume=true finishes an interrupted move: it inserts nothing and removes the source copy, only when the destination holds exactly one byte-identical copy (else resume_unmatched); never with allow_duplicate, to_section or one note.

dry_run=true returns both diffs and writes nothing. Each hash is optional (where preconditions are required, a bare id satisfies them and the destination is exempt); a change by someone else during the call is retried from a fresh read, at most 3 attempts, unless that note's hash was given. The response gives the moved task's new line and id (the key is kept; .<i>of<n> suffixes may renumber), each content_hash and index (destination): … / index (source): ….

Codes: task_move_incomplete, publication_uncertain, duplicate_task, resume_unmatched, block_id_conflict, task_not_found, task_ambiguous, task_changed, task_malformed, precondition_required, stale_precondition, malformed_precondition, concurrent_write, selector_unresolved, content_unsafe, size_limit, invalid_argument, not_found, io_failure, permission_denied.

Args: path: The source note, unescaped. id: A list_tasks / task_agenda row's task id. to_path: The destination note; it must exist. to_section: A destination heading, as add_task takes section. allow_duplicate: Keep both copies of a duplicate. resume: Finish an interrupted move. dry_run: Preview both changes without writing. expected_hash: The source's content_hash; required with a suffixed id. to_expected_hash: The destination's content_hash.

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": {
      "path": "<path>",
      "id": "<id>",
      "to_path": "<to_path>"
    },
    "name": "move_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
pathYes
resumeNo
dry_runNo
to_pathYes
to_sectionNo
expected_hashNo
allow_duplicateNo
to_expected_hashNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare destructive=true and readOnly=false, and the description goes well beyond them: write permission requirement, id re-validation against current text, byte-identical line transfer, destination-written-first with re-read verification, the residual outside-save window, retry policy (3 attempts), and partial-write refusal semantics. Its only weakness is density, not omission.

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 operation, and nearly every sentence carries real behavioral content (atomicity, refusals, resume rules). However, it is a dense wall of prose with no paragraph breaks or lists, making the refusal codes and the Args block harder to scan than necessary.

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 9-parameter destructive tool with 0% schema coverage, the definition covers permissions, preconditions, failure modes, atomicity guarantees, and the exact refusal vocabulary. Output schema exists, so not explaining return values further is acceptable.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the burden, and the Arguments block mostly does: expected_hash is tied to read_note's content_hash and to suffixed ids, to_section is tied to add_task's section, to_path 'never created'. A few entries (allow_duplicate, dry_run) are near-restatements, leaving a small gap.

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, resource, and scope: 'Move one task, with every line indented under it, to another note or to another section of its note.' This distinguishes it from move_note and add_task, and the later text reinforces the boundary.

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

Usage Guidelines5/5

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

Explicitly routes the agent: nested tasks, tasks in callouts, or blocks with quote/fence/heading lines are refused and 'edit_note can move it by hand'. Also lays out when resume applies, when dry_run applies, when allow_duplicate applies, and how the insert position matches add_task.

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