Skip to content

merge_branch

Merge a head branch into a base branch (direct merge, no review required). If the merge would cause conflicts, returns a human-readable diff showing the conflicting changes so you can resolve them manually. Requires Owner role — only Owners can directly merge branches into main, protecting the base model from unreviewed assumption changes. Editors can create branches and edit models but cannot merge directly; they must open a pull request (create_pull_request) for an Owner to approve and merge via merge_pull_request. Use compare_branches first to see the output diff before deciding to merge. Returns: project (str) — project name; head_branch (str) — branch that was merged; base_branch (str) — branch that received the merge; merged (bool) — true when the merge commit was created; conflict (bool) — true when merge cannot proceed due to conflicts; up_to_date (bool) — true when head was already merged into base; message (str) — human-readable outcome description; diff (str, present when conflict=true) — unified diff of conflicting changes.

NameTypeRequiredDefaultDescription
project_namestrYes
head_branchstrYes
base_branchstrNo'main'
commit_messagestrNo''

Returns a structured object. Top-level fields:

  • project (string)
  • head_branch (string)
  • base_branch (string)
  • merged (boolean)
  • conflict (boolean)
  • up_to_date (boolean)
  • message (string)

See the response example below for the full payload shape.

{
"name": "merge_branch",
"arguments": {
"project_name": "forecasts",
"head_branch": "scenario/aggressive-growth",
"base_branch": "main",
"commit_message": "Merge aggressive-growth scenario"
}
}
{
"project": "forecasts",
"head_branch": "scenario/aggressive-growth",
"base_branch": "main",
"merged": true,
"conflict": false,
"up_to_date": false,
"message": "Successfully merged 'scenario/aggressive-growth' into 'main'."
}
  • Module: Branches
  • Requires authentication via API token or Auth0 JWT.