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

Obsidian MCP (pgvector + Ollama, self-hosted)

by maxkuminov

Add task

add_task

Insert a new task line into an existing note's task list, with optional due date, priority, tags, and recurrence, plus duplicate detection and dry-run preview.

Instructions

Insert one new task line (- [ ] <text>) into an existing note, next to its task list. Requires write permission (a readwrite API key or OAuth scope).

Arguments: path, text, section; the fields due, scheduled, start, priority, tags, recurrence; context, allow_duplicate, dry_run and the optional 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 note must exist; this tool never creates one (use create_note). The line is placed after the last top-level task of the region — the section heading's body, or the whole note — and after everything indented under that task, copying its list marker and quote prefix; with no task there it goes after the region's last line, and in an empty section right under the heading. Nothing else in the note changes.

Plain checkboxes work; Tasks-plugin fields are written only for the arguments you give, in the plugin's order: #tags, priority, šŸ” rule, āž• created (per your task settings), šŸ›« start, ā³ scheduled, šŸ“… due. context adds one indented - <text> line under the new task. Under a filter task rule your global filter text is put at the start of text when the line lacks it; under fields, a line with no task field or task tag is still written and the response says default listings will not show it.

An open task with the same description (case, spacing and Unicode form ignored; tags count) in this note, or elsewhere in your default scope, is refused duplicate_task, naming up to 5 matches; allow_duplicate=true adds it anyway. Up to 5 similar open tasks are listed in the response and the dry run, and never block. The response gives the new line and its id (for complete_task / update_task), content_hash, the timezone and dates resolved, and index: refreshed or index: may lag (<reason>) (the write stands).

dry_run=true returns the diff, the new line(s) and the similar tasks, and writes nothing. expected_hash is optional, even where the deployment requires preconditions (adding a line removes nothing); when given it 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.

Codes: duplicate_task, not_found, selector_unresolved (no such section), content_unsafe (a malformed frontmatter block or an unclosed indented fence: the refusal names the repair), recurrence_unsupported, stale_precondition, concurrent_write, task_malformed, size_limit, invalid_argument, permission_denied.

Args: path: The existing note's vault-relative path. text: The task description: one line, 1–1,000 characters, no field emoji (pass dates and the rest as arguments). section: A heading, as edit_note addresses one (Parent/Child, or a #N ordinal); omit for the whole note. due: Due date (šŸ“…): YYYY-MM-DD, today, tomorrow, yesterday, +Nd or -Nd, in your task timezone. scheduled: Scheduled date (ā³), same forms. start: Start date (šŸ›«), same forms. priority: highest, high, medium, low or lowest. tags: Tags for the task, e.g. ["errand"] (at most 32). recurrence: A šŸ” rule from the grammar complete_task lists. context: One line of context under the task. allow_duplicate: Add even if an identical open task exists. dry_run: Preview the change without writing. expected_hash: Optional; the note's content_hash from read_note.

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>",
      "text": "<text>"
    },
    "name": "add_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
dueNo
pathYes
tagsNo
textYes
startNo
contextNo
dry_runNo
sectionNo
priorityNo
scheduledNo
recurrenceNo
expected_hashNo
allow_duplicateNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes far beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false) by disclosing write-permission requirements, all refusal codes, placement algorithm, duplicate semantics with a 5-match cap, retry-on-concurrent-write behavior, and index lag reporting. It explicitly notes that a changed note removes nothing and that dry_run writes nothing.

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 purpose and write-permission constraint, then organized into placement, duplicate, dry-run/precondition, and codes paragraphs. It is dense for 13 params, but some of the placement detail could be trimmed; overall it is appropriately sized for the tool's complexity.

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?

Given a mutation with 13 params, an output schema, and non-trivial duplicate/precondition logic, the description is complete: it covers placement, dupes, dry run, hashing, refusal codes, and index-lag behavior. Nothing an agent needs to invoke it correctly is omitted.

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 carries the full load. The Args block documents every one of the 13 parameters with formats (dates as `YYYY-MM-DD`/`today`/`+Nd`, priority enum values, tags cap of 32, text length 1–1,000, context adds an indented line), which the schema alone does not provide.

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 (insert) and resource (one new task line, `- [ ] <text>`) into an existing note, quoting the exact line format. It explicitly distinguishes from `create_note`, so an agent can route correctly without opening a schema.

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?

Says explicitly 'The note must exist; this tool never creates one (use `create_note`)'. It also names `dry_run` for preview, `allow_duplicate` behavior, and `expected_hash` optionality, so the when/when-not is clear.

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