Skip to main content
Glama
jagoff

obsidian-mcp-complete

by jagoff

obsidian_update_task

Idempotent

Modify a Markdown task's status, checked state, or text in an Obsidian note using its path and line number.

Instructions

Update one Markdown task by note path and 1-based line number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vaultNoOptional configured vault name. Defaults to the server default vault.
pathYesVault-relative path. Absolute paths and traversal are rejected.
lineYes
checkedNo
statusNo
textNo

Implementation Reference

  • src/tools.ts:941-959 (registration)
    Registration of the 'obsidian_update_task' tool. It calls the helper function 'replaceTaskLine' to update a task on a specific line of a note.
    tool(
      "obsidian_update_task",
      "Update one Markdown task by note path and 1-based line number.",
      {
        vault: vaultArg,
        path: pathArg,
        line: z.number().int().min(1),
        checked: z.boolean().optional(),
        status: z.string().length(1).optional(),
        text: z.string().optional(),
      },
      async (args) => {
        const read = await vaults.readText(args.path, args.vault);
        const next = replaceTaskLine(read.text, args.line, args);
        await vaults.writeText(read.path, next, args.vault, { overwrite: true });
        return { path: read.path, line: args.line, updated: true };
      },
      { idempotentHint: true },
    );
  • Input schema for obsidian_update_task: requires vault (optional), path, line (1-based), and optional checked, status, or text fields.
      vault: vaultArg,
      path: pathArg,
      line: z.number().int().min(1),
      checked: z.boolean().optional(),
      status: z.string().length(1).optional(),
      text: z.string().optional(),
    },
  • Handler function for obsidian_update_task. Reads the note, calls replaceTaskLine to update the task, then writes the result back.
    async (args) => {
      const read = await vaults.readText(args.path, args.vault);
      const next = replaceTaskLine(read.text, args.line, args);
      await vaults.writeText(read.path, next, args.vault, { overwrite: true });
      return { path: read.path, line: args.line, updated: true };
    },
    { idempotentHint: true },
  • replaceTaskLine function: parses a task line at the given 1-based line number, updates status/checked/text, and returns the modified markdown.
    export function replaceTaskLine(
      markdown: string,
      lineNumber: number,
      update: { checked?: boolean; status?: string; text?: string },
    ): string {
      const lines = markdown.replace(/\r\n/g, "\n").split("\n");
      const idx = lineNumber - 1;
      const line = lines[idx];
      if (!line) throw new Error(`Line ${lineNumber} does not exist`);
      const match = /^(\s*[-*]\s+\[)([^\]])(\]\s+)(.*)$/.exec(line);
      if (!match) throw new Error(`Line ${lineNumber} is not a Markdown task`);
      const status = update.status ?? (update.checked === undefined ? match[2] : update.checked ? "x" : " ");
      const text = update.text ?? match[4];
      lines[idx] = `${match[1]}${status}${match[3]}${text}`;
      return lines.join("\n");
    }
Behavior2/5

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

The description adds little beyond the annotations. Annotations already indicate idempotentHint=true, readOnlyHint=false, destructiveHint=false. The description does not disclose what happens if the task or line doesn't exist, or whether the operation is atomic. It only restates the basic function.

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?

The description is a single concise sentence that is front-loaded with the action. However, it could include a brief list of modifiable fields (checked, status, text) without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is incomplete for a tool with 6 parameters and no output schema. It does not mention the optional vault parameter or the three modifiable fields (checked, status, text). An agent cannot fully understand the tool's capabilities from the description alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 33% (only vault and path have descriptions). The description adds meaning for 'line' (1-based) but does not explain the purpose of 'checked', 'status', or 'text'. With low schema coverage, the description should compensate by describing the modifiable fields, but it does not.

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?

The description clearly states the action (update), the resource (one Markdown task), and the identification method (by note path and 1-based line number). This distinguishes it from sibling tools like obsidian_list_tasks (list) or obsidian_create_note (create).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for updating a specific task, but it does not provide explicit guidance on when to use this tool versus alternatives (e.g., obsidian_list_tasks for viewing tasks, or other update tools). No exclusions or context for when not to use are given.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jagoff/obsidian-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server