Move task
move_taskMove 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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| path | Yes | ||
| resume | No | ||
| dry_run | No | ||
| to_path | Yes | ||
| to_section | No | ||
| expected_hash | No | ||
| allow_duplicate | No | ||
| to_expected_hash | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |