Skip to main content
Merge requests bring changes from a feature branch into a target branch (usually main) for a single document. For coordinating merges across multiple documents, see changesets.

Parameters

ParameterTypeRequiredDescription
actionenumYeslist, get, create, analyze, execute, close, or update
mergeRequestIdUUIDConditionalRequired for get, analyze, execute, close, update
documentIdUUIDConditionalRequired for create; optional for list (filters by document)
sourceBranchstringConditionalSource branch name — required for create
targetBranchstringConditionalTarget branch name — required for create
titlestringConditionalMR title — required for create
descriptionstringNoMR description
reviewerIdsUUID[]NoUser IDs to add as reviewers (find IDs with members)
resolutionsobject[]ConditionalRequired for execute when conflicts exist
tagResolutionsource | targetConditionalRequired for execute when tag conflicts exist
scalarPropertyResolutionsRecord<UUID, source|target>ConditionalPer-column resolution for scalar property conflicts
resolvedPathstringConditionalRequired for execute when path collision exists
documentDeletionResolutiondelete | keepConditionalRequired when document was deleted on one branch
commitMessagestringNoCustom commit message (max 1000 chars)
newTitlestringNoNew title for update
newDescriptionstring | nullNoNew description for update
statusopen | merged | closedNoFilter for list

Actions

ActionNotes
listList MRs; filter by documentId and/or status
getGet a single MR with reviewer details
createCreate a new MR (uses branch names, not IDs)
analyzeGet diffs, conflicts, and tag changes
executeMerge the branch (with resolutions if needed)
closeClose without merging
updateUpdate title or description

Workflow

1. create → mergeRequestId
2. analyze → inspect diffs and conflicts
3. execute → merge (pass resolutions if hasConflicts is true)

Analyze Response

{
  "mergeRequestId": "uuid",
  "hasConflicts": false,
  "hasTagConflicts": false,
  "hasPathCollision": false,
  "hasDocumentDeletionConflict": false,
  "sections": [
    {
      "sectionId": "uuid",
      "name": "Authentication",
      "status": "modified",    // "added" | "deleted" | "modified" | "conflict" | "unchanged"
      "sourceDiff": "...",
      "targetDiff": "..."
    }
  ]
}

Resolving Conflicts

For each conflicting section, choose "source" (incoming branch) or "target" (current main):
{
  "action": "execute",
  "mergeRequestId": "uuid",
  "resolutions": [
    {"sectionId": "uuid", "resolution": "source"},
    {"sectionId": "uuid2", "resolution": "target"}
  ]
}

Fast-Forward Merge

If the source branch contains all commits from the target (no divergence), Moxn merges automatically — no conflicts possible and no resolutions needed.

Commit Message

Auto-generated from source-branch commits. For long-running branches with many commits, the auto-generated message may exceed the 1000-char limit — in that case, the merge will fail with a guidance error. Pass a custom commitMessage to resolve.

Examples

"Create a merge request to merge ai/add-auth into main"
→ merge_requests({action: "create", documentId: "...", sourceBranch: "ai/add-auth", targetBranch: "main", title: "Add authentication section"})

"Check if there are conflicts"
→ merge_requests({action: "analyze", mergeRequestId: "..."})

"Execute the merge"
→ merge_requests({action: "execute", mergeRequestId: "..."})

"Add a reviewer"
→ First: members({action: "search", query: "alice"}) → get userId
  Then: merge_requests({action: "update", mergeRequestId: "...", reviewerIds: ["user-uuid"]})
  • documents — create branches (create_branch)
  • changesets — coordinate merges across multiple documents
  • members — find user IDs for reviewers