Add task
add_taskInsert 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
| Name | Required | Description | Default |
|---|---|---|---|
| due | No | ||
| path | Yes | ||
| tags | No | ||
| text | Yes | ||
| start | No | ||
| context | No | ||
| dry_run | No | ||
| section | No | ||
| priority | No | ||
| scheduled | No | ||
| recurrence | No | ||
| expected_hash | No | ||
| allow_duplicate | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |