Skip to main content
Glama

Vault Write

vault_write

Write Markdown content to project vault files by appending or replacing a section, or creating a new file with generated frontmatter.

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. Requires path, relative to the project directory. Frontmatter is generated (doc_type defaults to "note") unless content opens with its own block, which is kept as is. Inferred automatically when you pass a path with no section, so operation may be omitted.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project": "<project>",
      "content": "<content>"
    },
    "name": "vault_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFile path relative to the project directory (e.g. 'sessions/x.md', not '10_projects/<project>/sessions/x.md'). 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. In create mode, either a body (frontmatter is generated) or a full document with frontmatter.
projectYesProject slug or '_meta' for cross-project content.
sectionNoSection shortcut (context, tasks, roadmap, lessons). For append/replace.
doc_typeNoDocument type for generated frontmatter (create mode). Optional; defaults to "note". Refused if it contradicts the type in content's own frontmatter.
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

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv4.5.0
    • changedInput schema / properties / content / description
      Previous value: -"Markdown content to write (body only for create mode)."New value: +"Markdown content to write. In create mode, either a body\n(frontmatter is generated) or a full document with frontmatter."
    • changedInput schema / properties / doc_type / description
      Previous value: -"Document type for frontmatter (create mode). Optional;\ndefaults to \"note\"."New value: +"Document type for generated frontmatter (create mode).\nOptional; defaults to \"note\". Refused if it contradicts the\ntype in content's own frontmatter."
    • changedInput schema / properties / path / description
      Previous value: -"Relative path for the file. Setting this with no section\ncreates the file (create mode)."New value: +"File path relative to the project directory (e.g.\n'sessions/x.md', not '10_projects/<project>/sessions/x.md').\nSetting this with no section creates the file (create mode)."
  2. 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."
  3. 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)."
  4. 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"
      +}
  5. Addedv1.21.0
  6. Removedv1.13.0
  7. First observedv1.11.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare the safety profile (not read-only, not idempotent, not destructive); the description adds real behavior beyond that, including that frontmatter is auto-generated in create mode, that doc_type defaults to "note", and that a conflicting doc_type is refused. It stops short of stating what happens to an existing section's prior content on "replace" or the failure mode when a required section is missing.

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

Conciseness4/5

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

Front-loaded with the verb and the three modes, then a short mode-keyed list — an agent can scan it in one pass. Slightly redundant tail ("; so operation may be omitted" restates the inference already implied), but overall tight.

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?

With an output schema present, annotations covering safety, and 100% schema coverage, the description supplies what structured fields cannot: the mode taxonomy and the frontmatter-generation contract. It is not fully complete for a mutation tool in that it omits replace-overwrite semantics and any permission or error preconditions, but nothing critical for calling it correctly is absent.

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, but the description goes further by explaining the conditional relationships between parameters: section is required for append/replace, path is required for create and triggers create mode when section is empty, and operation may be omitted because it is inferred. That conditional logic adds meaning beyond the per-parameter descriptions.

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?

States a specific verb and resource ("Write to the vault") and enumerates the three concrete modes (append, replace a section, create a new file), which lets an agent understand the tool's surface without opening the schema. It does not distinguish itself from the closely related vault_patch or vault_commit siblings, which is the main gap at this dimension.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear internal routing rules — section required for append/replace, path required for create, and create inferred when path is set with no section — which is genuinely useful mode-selection guidance. However, it never says when to use this tool versus vault_patch, vault_commit, or vault_delete, leaving the cross-tool decision entirely to inference.

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