update_frontmatter
Modify metadata properties in Obsidian notes while preserving the main content, using JSON-formatted updates for structured data management.
Instructions
Update frontmatter properties of a note without changing the body content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative path to the note | |
| properties | Yes | JSON string of key-value pairs to set in frontmatter |
Implementation Reference
- src/lib/markdown.ts:23-30 (handler)The actual implementation of `updateFrontmatter` that parses markdown, merges updates into the frontmatter, and reconstructs the markdown string.
export function updateFrontmatter( content: string, updates: Record<string, unknown>, ): string { const parsed = matter(content); const merged = { ...parsed.data, ...updates }; return matter.stringify(parsed.content, merged); }