Skip to content

feat: add vault_update_properties + properties_only on read#48

Merged
aliasunder merged 12 commits into
mainfrom
feat/properties-tools
May 19, 2026
Merged

feat: add vault_update_properties + properties_only on read#48
aliasunder merged 12 commits into
mainfrom
feat/properties-tools

Conversation

@aliasunder
Copy link
Copy Markdown
Owner

@aliasunder aliasunder commented May 19, 2026

Summary

  • New tool: vault_update_properties — merge frontmatter properties on a single note without touching the body. Same shallow-merge semantics as vault_write_note (new keys added, matching keys overwritten, unmentioned keys preserved), but no body round-trip required. Closes the gap where frontmatter edits required reading + rewriting the entire note body.
  • Extended: vault_read_note gains properties_only: boolean param — returns parsed frontmatter as JSON instead of full note content. Saves tokens when agents only need property values.
  • Standardized naming: renamed vault_write_note's frontmatter param to properties for consistency with vault_list_property_keys, vault_search_by_property, and the new tools. Breaking change acceptable pre-public.
  • 22 → 23 tools

Closes ^frontmatter-tools task.

Test plan

  • npx tsc --noEmit — clean
  • npm test — 480 tests pass (468 existing + 10 new + 2 updated)
  • npm run lint — clean
  • Manual: vault_read_note({ path: "...", properties_only: true }) returns JSON
  • Manual: vault_update_properties({ path: "...", properties: { status: "active" } }) merges without body change

🤖 Generated with Claude Code

aliasunder and others added 12 commits May 18, 2026 21:37
New tool: vault_update_properties — merge frontmatter properties on a
single note without touching the body. Same shallow-merge semantics as
vault_write_note (new keys added, matching keys overwritten, unmentioned
keys preserved), but no body round-trip required.

Extended: vault_read_note gains properties_only boolean param — returns
parsed frontmatter as JSON instead of full note content. Saves tokens
when agents only need property values.

Standardized naming: renamed vault_write_note's `frontmatter` param to
`properties` for consistency with vault_list_property_keys,
vault_search_by_property, and the new tools. Breaking change acceptable
pre-public.

22 → 23 tools. 480 tests (10 new).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- "merges new keys without changing body": parse result with gray-matter
  and assert body content exactly, not just toContain substring
- "preserves unmentioned keys": verify tags array survives the merge,
  not just the title string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ter"

Agent-facing text now consistently uses "properties" when referring to
the data. "Frontmatter" is retained only where it describes the physical
file format (YAML fences, file position, stripping).

Also fixes stale reference to vault_write_note's old `frontmatter`
parameter name in vault_replace_in_note's description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add min(1) to record key validators on vault_write_note and
vault_update_properties to reject empty-string property keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…operties

Shallow merge overwrites array keys entirely — agents should read
current values with properties_only: true before updating tags, related,
or other array properties to avoid data loss.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Agent can't know property types upfront. Guidance now says read first
unconditionally, with a note that arrays are replaced not appended.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches vault_patch_note pattern where the read-first recipe appears
directly after the Example block, before When to use.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Internal doc comments use "frontmatter" when describing the physical
YAML block on disk, "properties" for the data passed as params.
Params and function names stay as "properties" (agent-facing).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
serializeNote is an internal function that builds the YAML block —
its param should use the format term (frontmatter), not the agent
term (properties). writeNote maps at the boundary: receives
params.properties, passes to serializeNote's frontmatter param.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aliasunder aliasunder merged commit 0ec12bb into main May 19, 2026
2 checks passed
@aliasunder aliasunder deleted the feat/properties-tools branch May 19, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant