Skip to main content
Glama

patch_note

Destructive

Edit a section of an Obsidian note by targeting a heading or block reference to append, prepend, or replace content while preserving frontmatter and avoiding full-file rewrites.

Instructions

Surgically edit a section of a note — targeted by heading or block reference — without rewriting the whole file. Operations: append (add after section), prepend (add after heading line), replace (swap section content). Frontmatter is never touched.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesVault-relative path to the note.
targetYesExactly one of: { heading: "Section Title" } or { block: "block-id" } (without the ^ prefix).
contentYesContent to insert or replace with.
prevHashNoOptional compare-and-swap guard: the contentHash from a prior read. Fails with hash_conflict if the note changed since.
operationYesappend: insert after section content. prepend: insert after heading line. replace: swap section content.
createIfMissingNoIf the heading target is not found, append a new heading (level 2) + content. Only valid for heading targets. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.25
    • addedInput schema / properties / target / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "heading": {
      +        "description": "Heading text (without # markers).",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "heading"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "block": {
      +        "description": "Block reference ID (without the ^ prefix).",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "block"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / target / type
      Removed value: -"object"
  2. Changed1 schema field changedv0.3.16
    • addedInput schema / properties / prevHash
      Added value: +{
      +  "description": "Optional compare-and-swap guard: the contentHash from a prior read. Fails with hash_conflict if the note changed since.",
      +  "type": "string"
      +}
  3. Addedv0.3.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, so the mutation nature is known. The description adds valuable behavioral context beyond annotations: edits are surgical and localized ('without rewriting the whole file'), and frontmatter is never touched. This meaningfully clarifies the blast radius of a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no filler. It front-loads the core purpose and operation model, then adds a key safety guarantee. Every sentence earns its place.

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

Completeness4/5

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

For a mutating tool with rich schema coverage and annotations, the description covers the essential behavior: targeted section editing, operation types, and frontmatter safety. It could mention failure behavior for missing targets, but the schema already covers createIfMissing and prevHash behavior.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already documents all six parameters thoroughly. The description restates operation semantics in prose but does not add meaning beyond the schema, so the baseline of 3 is appropriate.

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 states a specific verb ('Surgically edit'), a resource ('a section of a note'), and a precise targeting mechanism ('targeted by heading or block reference'). It also distinguishes itself from sibling tools by noting 'without rewriting the whole file' and 'Frontmatter is never touched'.

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?

The description gives clear context for when this tool is appropriate: surgical section edits with append, prepend, or replace operations, and explicitly excludes frontmatter. It does not name sibling alternatives like patch_frontmatter or append_note, but the scope and exclusion are enough to guide selection.

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