Start Merge
start_mergeMerge sourceProjectId into projectId (the target). This changes the target: its code becomes the merged code, and the migration script runs on its database and storage. Only when the user asked to merge.
targetVersion / sourceVersion: from the latest compare_branches. conflictSides: conflict path → "source" | "target" (that branch's current file wins). addKeys: new env vars from compare to add to the target. keyChoices: env var → "target" | "source" for every key conflict ("source" overwrites the target's value). appIcon: take the source's app icon (default: as compare says).
Waits up to ~40 s for the pre-merge checks ("Checks still running" → call again), then starts the merge and returns its mergeId for get_merge_status.
A started merge ends done (code + migration applied) or failed (nothing changed on the target).
Into a protected main: not started; the user presses Merge in the card it shows, then get_job_status gives the mergeId.
Refused, with the reason, on failed checks, unresolved conflicts, changed versions, an already merged branch or a running merge.
Migration script: static/__dev/migration.js on the branch the merge edits (never main); dry-run, then run in one transaction on the target on every merge, so idempotent; ctx.sourceQuery / targetQuery / storageCopy / storageDelete only, no network, ~7 min per run. get_guides("fork").
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": {
"projectId": "<projectId>",
"sourceProjectId": "<sourceProjectId>",
"targetVersion": "<targetVersion>",
"sourceVersion": "<sourceVersion>"
},
"name": "start_merge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| addKeys | No | ||
| appIcon | No | ||
| projectId | Yes | ||
| keyChoices | No | ||
| conflictSides | No | ||
| sourceVersion | Yes | ||
| targetVersion | Yes | ||
| sourceProjectId | Yes |