mindwiki_write_page

Create or update a page in your vault. Provide the full markdown content including any frontmatter.

Scope: write

Parameters

ParameterTypeRequiredDescription
pathstringYesPage path (e.g. capture/idea.md)
contentstringYesFull markdown content including frontmatter
messagestringNoLog message describing the change
base_hashstringFor editsExact content_hash from the latest read. Omitted or empty means create only.
idempotency_keystringNoUnique operation key, 1–128 characters. Reuse it with identical arguments after a timeout.

Example Request

json
{
  "tool": "mindwiki_write_page",
  "arguments": {
    "path": "patterns/feedback-loops.md",
    "content": "---\ntitle: Feedback Loops\narea: patterns\ntype: pattern\nupdated: 2026-05-09\n---\n\n# Feedback Loops\n\nA self-reinforcing cycle where the output of a system feeds back as input.",
    "message": "Created feedback loop note",
    "base_hash": "",
    "idempotency_key": "feedback-loops-create-001"
  }
}

Example Response

json
{
  "path": "patterns/feedback-loops.md",
  "content_hash": "9d4f2c8...",
  "seq": 412
}

For an edit, read the page first and pass its full content_hash as base_hash. A stale revision returns an MCP tool result with isError: true and code REVISION_CONFLICT, including the current hash. Read again and reconcile the newer text before using a new operation key. Never retry by dropping the hash.

The same key and arguments return the original path, hash and sequence without applying a second write. Reusing a key with different arguments returns IDEMPOTENCY_CONFLICT. Keys are isolated by account and tool. Without a key, a repeated request is a separate operation.

Page content, links, revision checks and sync events commit together. Search indexing and the storage mirror may catch up afterward; their failure does not invalidate a committed save.

The REST counterpart is POST /vault/page. REST has its own request contract and HTTP 409 conflict response; MCP's idempotency key applies to the tool interface documented here.