Complete task
complete_taskMark an Obsidian task done by checking its checkbox and adding the completion date; for recurring tasks, also write the next occurrence in the same edit.
Instructions
Mark one task done — [x] and ✅ <date> — and, for a recurring task, write its next occurrence in the same edit. Requires write permission (a readwrite API key or OAuth scope).
Arguments: path and id (both from a listing), done_on, dry_run and
the expected_hash precondition.
Every refusal the server raises ends with one machine-readable
MCP-REFUSAL {"code":…} line and writes nothing; an undeclared or
mistyped argument is rejected by protocol validation before the tool runs
and carries no such line.
The id, from a list_tasks or task_agenda row, is re-checked against
the note's current text, never a line number, so the call changes only
the line it names or
refuses. A task's id changes whenever its line changes; the response
returns the new one. An id shaped <key>.<i>of<n> names one of several
identical lines and is accepted only with expected_hash, the note's
content_hash from read_note; without it the call is refused
precondition_required.
Plain checkboxes work; Tasks-plugin emoji fields are optional. Any open
marker ([ ], [/], [>]…) becomes [x]. Whether ✅ is added, where
a next occurrence goes (above the task, or below its indented lines) and
whether it gets ➕ <today> follow your task settings, which default to
the Tasks plugin's. Recurrence rules supported: every day / N days /
weekday / week / N weeks / week on / / month /
N months / month on the / month on the last / year / N years /
on the , each optionally when done. Any other rule refuses
the whole completion: a recurring task is never completed without its
next occurrence.
dry_run=true returns the diff and the new line(s) and writes nothing.
expected_hash is optional otherwise and binds the whole note (refused
stale_precondition if it changed). Without it, a change made by someone
else during the call is retried from a fresh read, at most 3 attempts,
then refused concurrent_write.
The response gives the new line and id, the next occurrence's line,
position and id, content_hash, the timezone and dates resolved, and
index: refreshed (listings already show the change) or
index: may lag (<reason>) (the write stands; the next index pass
catches up).
Codes: task_not_found (the line changed since the listing: list again),
task_ambiguous (lists the suffixed ids), task_changed,
precondition_required, stale_precondition, malformed_precondition,
concurrent_write,
already_completed, task_cancelled (reopen it with
update_task(status="open") first), recurrence_unsupported,
on_completion_unsupported (🏁 delete), task_malformed (fix the line
with edit_note), content_unsafe (a malformed frontmatter block: the
refusal names the repair), size_limit, invalid_argument, not_found,
permission_denied.
Args:
path: The note's vault-relative path, unescaped (a listing shows
\-escapes).
id: The task id from a list_tasks or task_agenda row.
done_on: The completion date: YYYY-MM-DD, today (default),
yesterday, +Nd or -Nd, in your task timezone.
dry_run: Preview the change without writing.
expected_hash: The note's content_hash from read_note; required
with a suffixed id.
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>"
},
"name": "complete_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| path | Yes | ||
| done_on | No | ||
| dry_run | No | ||
| expected_hash | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |