Skip to main content
Glama

Update Frontmatter

update_frontmatter
DestructiveIdempotent

Merge key-value pairs into a note's YAML frontmatter while preserving existing keys and body content; creates a frontmatter block if missing.

Instructions

Merge new key-value pairs into a note's YAML frontmatter, preserving any keys not mentioned and leaving the body content untouched. Keys in the payload overwrite existing values. Creates a frontmatter block if the note has none. Returns a count of properties written. Use to set status fields, tags arrays, or other metadata without rewriting the body.

Note: The YAML block is regenerated on each update — comments, custom quoting, multi-line scalar style, blank lines, and key ordering inside the block are normalized. Key presence and values are preserved; formatting is not.

Input Schema

NameRequiredDescriptionDefault
pathYesRelative path from vault root to the note (e.g., 'projects/alpha.md'). Extension optional.
propertiesYesJSON object string of frontmatter keys to set, e.g., '{"status":"done","priority":1,"tags":["review"]}'. Existing keys not in the payload are preserved.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.1.1
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv2.0.0
  3. Removedv1.9.0
  4. Addedv0.1.6
  5. Removedv0.1.4
  6. Changed2 schema fields changedv0.1.2
    • changedInput schema / properties / path / description
      Previous value: -"Relative path to the note"New value: +"Relative path from vault root to the note (e.g., 'projects/alpha.md'). Extension optional."
    • changedInput schema / properties / properties / description
      Previous value: -"JSON string of key-value pairs to set in frontmatter"New value: +"JSON object string of frontmatter keys to set, e.g., '{\"status\":\"done\",\"priority\":1,\"tags\":[\"review\"]}'. Existing keys not in the payload are preserved."
  7. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing merge-vs-overwrite semantics, creation of a block when absent, and — critically — that the YAML block is regenerated so comments, quoting, multi-line style, blank lines, and key ordering are normalized. This explains exactly what the destructiveHint=true means in practice, which is the single most decision-relevant fact here.

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?

Core behavior is front-loaded in the first two sentences, with the formatting-loss caveat isolated in a clearly marked note. Every sentence carries distinct information; nothing is redundant with the name or title.

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 two-parameter mutation tool with no output schema, the description covers the mutation semantics, the preservation guarantee, the destructive side effect, and the return value (a count of properties written). Nothing an agent needs to invoke it safely is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds value by clarifying that payload keys overwrite while unmentioned keys persist, and that the properties argument is a payload rather than a path. It does not add format or edge-case detail (e.g., null values to delete a key) beyond the schema.

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 (merge) and resource (YAML frontmatter of a note), and immediately delimits scope: body content untouched, keys not mentioned preserved. This clearly separates it from siblings like update_section, replace_in_note, and append_to_note, which act on body content rather than metadata.

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?

Provides a concrete usage context ("Use to set status fields, tags arrays, or other metadata without rewriting the body"), which gives the agent a clear selection criterion against body-editing siblings. It does not, however, name specific alternatives or state when not to use it (e.g., removing keys, which this tool apparently cannot do).

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