capsid_close_pr
Merge, close, delete, tag and release, on Capsid. Needs the write grant.
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).
- Writes: some action changes state.
- Can overwrite or remove what exists.
- A repeat can change things again.
- Reaches GitHub, Cloudflare or a live site.
Its 5 actions
Chosen by the action argument.
mergeMerge 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' postscommentand 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.closeClose 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' postscommentand 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.delete_branchDelete 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.tagTag 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.
releaseTag 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.
Arguments
| Argument | Type | Needed | What it is |
|---|---|---|---|
action | one of: merge, close, delete_branch, tag, release | always | merge | close | delete_branch | tag | release. |
namespace | string | always | |
number | whole number | no | |
merge_method | one of: merge, squash, rebase | no | |
sha | string | no | For action 'merge': the full head sha you reviewed; the merge is refused if the head moved. Refused for the other actions. |
repo | string | no | A repo label or mapped "owner/name". Defaults to the primary repo. |
branch | string | no | The branch to delete. Omit when merged is true. |
force | boolean | no | Lift the open-PR refusal. Requires the can_merge flag. Does NOT lift the default-branch refusal. |
merged | boolean | no | Prune the merged branches instead of deleting one: a preview unless confirm is true. |
confirm | boolean | no | With merged: actually delete the branches the preview lists. Without it nothing is deleted. |
keep | list of string | no | With merged: branch names to leave alone this call even if they would be pruned. |
tag | string | no | The version to tag, such as v1.4.0 or 1.4.0-rc.1. |
ref | string | no | A branch whose head is tagged. Defaults to the default branch. |
changelog | string | no | The CHANGELOG path for a release's notes. Defaults to CHANGELOG.md. |