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

Obsidian MCP (pgvector + Ollama, self-hosted)

by maxkuminov

Complete task

complete_task
Destructive

Mark 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

NameRequiredDescriptionDefault
idYes
pathYes
done_onNo
dry_runNo
expected_hashNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.0

TDQS

A4.7/5.0
Behavior5/5

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

Far exceeds the annotations: it discloses the write-permission requirement, that ids are re-validated against note text rather than line numbers, that ids change after every edit, the 3-attempt concurrency retry, the `expected_hash` precondition binding, recurrence-rule coverage, and that an unsupported recurrence refuses the whole completion. Consistent with destructiveHint=true and idempotentHint=false.

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 action and the permission requirement, then organized into behavior, dry-run/precondition, response, codes, and args. It is long and the trailing Args block partly repeats body text (dry_run, expected_hash), but nearly every sentence carries operational information.

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 destructive, multi-branch mutation with a 0%-covered schema, the definition covers permissions, preconditions, failure taxonomy, recurrence behavior, and index lag. Output formatting is additionally described even though an output schema exists, leaving no material gap before invocation.

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 coverage is 0%, so the description must carry the load, and it does: `done_on` accepts YYYY-MM-DD, 'today', 'yesterday', or ±Nd in the task timezone; `dry_run` returns the diff and writes nothing; `expected_hash` binds the whole note and is mandatory with a suffixed id. It also explains where `path` and `id` come from.

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 and resource ('Mark one task done') plus the exact mutations performed (`[x]` and `✅ <date>`) and the recurring-task side effect of writing the next occurrence. An agent can distinguish this from update_task, edit_note, or add_task without opening 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?

Routing is embedded throughout: use list_tasks/task_agenda to obtain the id, list again on `task_not_found`, reopen with `update_task(status="open")` on `task_cancelled`, and repair with `edit_note` on `task_malformed`. It never states upfront when to prefer this over update_task or how to cancel, so it falls just short of full when/when-not guidance.

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