approve_merge
Approve and merge a reviewed story's PR: rebase, re-run CI and tests, then merge and update the manifest.
Instructions
Merge a reviewed story's PR into the default branch, right now, on the caller's explicit approval — this is the human/overlord merge decision itself, not a status check.
plan_name: the plan's name, as returned by list_plans or passed to save_plan/ingest_plan. story_key: the story's key within that plan's manifest. Must currently be "parked" or "pr_open" with review_verdict == "APPROVE" — any other state (not yet reviewed, still in progress, already merged) returns {"ok": False, "error": ...} without changing anything.
On success this: rebases the story's branch onto the current default branch, force-pushes it (--force-with-lease) to origin, polls real CI (gh pr checks) — auto-retrying once on a cancelled run, and failing closed on a fail/cancelled/still-pending result — re-runs the story's acceptance fixtures and a build check against the rebased code, then merges the PR, deletes the branch/worktree, marks the story "done" in the manifest and its ticket, and notifies the user to restart the MCP server if the story touched the pipeline's own source. Any failure at any of those steps aborts the merge and returns the specific reason instead of partially completing it.
This does more than a plain gh pr merge (which skips the rebase,
force-push, and re-verification) — prefer this tool over a manual
merge for exactly that reason. It force-pushes and merges regardless
of any local test run you've done yourself, so only call it once you
actually want this specific story merged now; there is no separate
confirmation step after this call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_name | Yes | ||
| story_key | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||