Skip to main content
Glama

Vault Write

vault_write

Append, replace, or create files in an Obsidian project vault, with automatic frontmatter and optional synchronous commit for durable writes.

Instructions

Write to the vault: append, replace a section, or create a new file.

Modes:

  • append/replace: Update a project section. Requires section.

  • create: Create a new file with auto-generated frontmatter. Requires path; doc_type defaults to "note". Inferred automatically when you pass a path with no section, so operation may be omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRelative path for the file. Setting this with no section creates the file (create mode).
commitNoIf True, commit synchronously before returning — the escape hatch for a caller that needs the commit to exist by the time the call ends. Defaults to False, which queues the path for the reconciler to commit on its next tick (a few seconds). Durability contract: the file is persisted to disk regardless; only the *commit* is deferred, so a crash before the next flush loses the commit, not the content.
contentYesMarkdown content to write (body only for create mode).
projectYesProject slug or '_meta' for cross-project content.
sectionNoSection shortcut (context, tasks, roadmap, lessons). For append/replace.
doc_typeNoDocument type for frontmatter (create mode). Optional; defaults to "note".
operationNo'append', 'replace', or 'create'. Default 'append'. 'create' is inferred when path is set and section is empty.append
idempotency_keyNoOptional at-most-once token. If set, a retry with the same key is a no-op (safe for transparent retries after a daemon restart cuts an in-flight write — ADR-013). Empty (default) disables idempotency.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.0.0
    • changedInput schema / properties / commit / default
      Previous value: -trueNew value: +false
    • changedInput schema / properties / commit / description
      Previous value: -"If True (default), auto-commit to git. If False, write to\ndisk but leave the file dirty so the caller can batch many\nwrites into one commit via the ``vault_commit`` tool, or let\nobsidian-git's auto-commit pick it up. Durability contract:\nfiles are persisted to disk regardless; only the *commit* is\ndeferred. A crash before the next flush loses the commit, not\nthe file content."New value: +"If True, commit synchronously before returning — the\nescape hatch for a caller that needs the commit to exist by\nthe time the call ends. Defaults to False, which queues the\npath for the reconciler to commit on its next tick (a few\nseconds). Durability contract: the file is persisted to disk\nregardless; only the *commit* is deferred, so a crash before\nthe next flush loses the commit, not the content."
  2. Changed3 schema fields changedv1.41.1
    • changedInput schema / properties / doc_type / description
      Previous value: -"Document type for frontmatter. For create mode."New value: +"Document type for frontmatter (create mode). Optional;\ndefaults to \"note\"."
    • changedInput schema / properties / operation / description
      Previous value: -"'append', 'replace', or 'create'. Default 'append'."New value: +"'append', 'replace', or 'create'. Default 'append'.\n'create' is inferred when path is set and section is empty."
    • changedInput schema / properties / path / description
      Previous value: -"Relative path for new file. For create mode."New value: +"Relative path for the file. Setting this with no section\ncreates the file (create mode)."
  3. Changed1 schema field changedv1.32.2
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "default": "",
      +  "description": "Optional at-most-once token. If set, a retry with\nthe same key is a no-op (safe for transparent retries after a\ndaemon restart cuts an in-flight write — ADR-013). Empty\n(default) disables idempotency.",
      +  "type": "string"
      +}
  4. Addedv1.21.0
  5. Removedv1.13.0
  6. First observedv1.11.0

TDQS

A3.8/5.0
Behavior3/5

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

The description adds meaningful behavioral context beyond the annotations: auto-generated frontmatter, mode-specific requirements, and operation inference. However, it does not disclose the deferred-commit behavior (only present in the schema) or explicitly note that 'replace' overwrites existing section content. No contradiction with the annotations was found.

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 front-loaded with the core purpose and then uses a compact bulleted mode list that maps cleanly to parameters. Every sentence earns its place; there is no filler or redundant restatement of the schema.

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

Completeness3/5

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

Given 8 parameters and a rich output schema, the description covers the key mode-selection logic well. However, it omits the important deferred-commit/durability behavior and does not contrast the tool with siblings like vault_patch, which would help an agent choose the correct tool at a glance. The schema fills many gaps, but the description itself is not fully complete.

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 description coverage is 100%, so the baseline is 3. The description adds value by clarifying that section is behaviorally required for append/replace and path for create, even though these are not schema-level required fields, and by explaining the operation inference rule. This exceeds what the schema alone provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Write to the vault') and enumerates the three operation modes (append, replace, create), making the core purpose clear. It does not explicitly distinguish itself from siblings like vault_patch, so it misses the top-tier differentiator required for a 5.

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 when-to-use context within the tool: append/replace requires a section, create requires a path, and operation is inferred when path is set with no section. It does not state when to prefer an alternative sibling tool, but the internal mode guidance is strong and unambiguous.

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