Skip to the content

Capsid menu

capsid_close_pr

Merge, close, delete, tag and release, on Capsid. Needs the write grant.

Can change or removeReaches GitHub or Cloudflare

What it does

The changes that end or publish work: merge or close a pull request, delete a branch, tag a commit, or publish a release from a CHANGELOG section. Needs the write grant; merge, close, tag, release and a forced branch delete also need the can_merge flag, because each can trigger a deploy or destroy the only copy of a branch.

What a client is told

The MCP hints it carries, so a client can ask before it acts (src/tool-annotations.ts).

Its 5 actions

Chosen by the action argument.

merge Merge a pull request.

Merge, close or comment on an open pull request in a namespace's repo. action 'merge' uses merge_method (default 'squash') and needs the can_merge flag; with sha, it merges only if the head is still that commit and is otherwise refused with nothing merged. action 'close' closes it and needs the can_merge flag. action 'comment' posts comment and changes nothing else; it needs the can_comment_pr flag. Merge and close delete the head branch and return head_branch and head_branch_deleted, plus head_branch_note when the delete was declined: the default branch and a fork's branch are never deleted, and a failed delete does not fail the merge or close. A merge can trigger a deploy workflow. Needs the write grant.

Takes namespace, number, merge_method, sha, repo.

close Close a pull request and delete its head branch.

Merge, close or comment on an open pull request in a namespace's repo. action 'merge' uses merge_method (default 'squash') and needs the can_merge flag; with sha, it merges only if the head is still that commit and is otherwise refused with nothing merged. action 'close' closes it and needs the can_merge flag. action 'comment' posts comment and changes nothing else; it needs the can_comment_pr flag. Merge and close delete the head branch and return head_branch and head_branch_deleted, plus head_branch_note when the delete was declined: the default branch and a fork's branch are never deleted, and a failed delete does not fail the merge or close. A merge can trigger a deploy workflow. Needs the write grant.

Takes namespace, number, repo.

delete_branch Delete a branch.

Delete a branch in a namespace's GitHub repo. REFUSES, naming the refusal: the default branch, always; a branch with an open pull request; and a branch that does not exist. force:true lifts the open-PR refusal and needs the can_merge flag. Pass merged:true instead of branch to prune every branch whose latest pull request merged and whose tip is the commit that pull request merged from (so work pushed after the merge is kept): it PREVIEWS by default, deleting nothing, and deletes only with confirm:true, at most 40 per call (it reports how many remain); keep:[names] leaves named branches alone. It keeps the default branch, protected branches, release/*, screenshots, results, gh-pages, branches with an open or unmerged pull request and branches with no pull request, and lists why. Give branch or merged, not both; merged does not take force. Needs the write grant; audit-logged with the list.

Takes namespace, branch, force, merged, confirm, keep, repo.

tag Tag a commit.

Tag a commit, and with action release also publish its GitHub release, whose notes are the section of the repo's CHANGELOG that names the tag (a heading such as "## [1.4.0]" or "## v1.4.0"), read at the tagged commit. The commit is sha, or the head of ref, or the default branch's head. A release whose CHANGELOG has no section for the tag is refused before anything is tagged. A tag that exists is refused. Needs the write grant and the can_merge flag, because a tag or a release can start a deploy; audit-logged.

Takes namespace, tag, sha, ref, changelog, repo.

release Tag a commit and publish its GitHub release.

Tag a commit, and with action release also publish its GitHub release, whose notes are the section of the repo's CHANGELOG that names the tag (a heading such as "## [1.4.0]" or "## v1.4.0"), read at the tagged commit. The commit is sha, or the head of ref, or the default branch's head. A release whose CHANGELOG has no section for the tag is refused before anything is tagged. A tag that exists is refused. Needs the write grant and the can_merge flag, because a tag or a release can start a deploy; audit-logged.

Takes namespace, tag, sha, ref, changelog, repo.

Arguments

The arguments of capsid_close_pr
ArgumentTypeNeededWhat it is
actionone of: merge, close, delete_branch, tag, releasealwaysmerge | close | delete_branch | tag | release.
namespacestringalways
numberwhole numberno
merge_methodone of: merge, squash, rebaseno
shastringnoFor action 'merge': the full head sha you reviewed; the merge is refused if the head moved. Refused for the other actions.
repostringnoA repo label or mapped "owner/name". Defaults to the primary repo.
branchstringnoThe branch to delete. Omit when merged is true.
forcebooleannoLift the open-PR refusal. Requires the can_merge flag. Does NOT lift the default-branch refusal.
mergedbooleannoPrune the merged branches instead of deleting one: a preview unless confirm is true.
confirmbooleannoWith merged: actually delete the branches the preview lists. Without it nothing is deleted.
keeplist of stringnoWith merged: branch names to leave alone this call even if they would be pruned.
tagstringnoThe version to tag, such as v1.4.0 or 1.4.0-rc.1.
refstringnoA branch whose head is tagged. Defaults to the default branch.
changelogstringnoThe CHANGELOG path for a release's notes. Defaults to CHANGELOG.md.