sync

Compute a stateless 3-way merge for a vault file. Server runs `git merge-file --diff3 --stdout` over (base_text, local_text, current remote from file_indices) and returns the merged text plus the exact remote_sha it merged against. NO database mutation — to commit the result, follow up with sync_push(content=merged_text, base_sha=merged_against.remote_sha, resolves_conflict_id=conflict_id).

Compute a stateless 3-way merge for a vault file. Server runs git merge-file --diff3 --stdout over (base_text, local_text, current remote from file_indices) and returns the merged text plus the exact remote_sha it merged against. NO database mutation — to commit the result, follow up with sync_push(content=merged_text, base_sha=merged_against.remote_sha, resolves_conflict_id=conflict_id).

post/api/mcp/tools/sync_merge

Request

  • Base URL: https://api.ainote.dev
  • URL: https://api.ainote.dev/api/mcp/tools/sync_merge
  • Auth: API key in header Authorization

Request body

pathstring required

Relative vault path (e.g., 'global/MEMORY.md').

base_textstring required

Common ancestor text — what the client had cached when it started editing. Source: client state.json baseline. Required.

base_shastring

Optional: git_sha the client believes is the merge base. When supplied, server verifies (informational; merge still runs).

local_textstring required

Current local text on the client (post-edit). Required.

device_idstring

Optional: client device identifier. Recorded on any vault_conflict row created downstream.

Response

Tool executed successfully

Changes

No recorded changes to this operation across all 1 revision of this API.