Pull Requests

Generated automatically at build time from the madtea repository - do not edit here. Source: docs/reference/pull-requests.md.

CLI Commands

madtea pr body append

Append content to the end of a pull-request body

FlagTypeDefaultDescription
--filestringRead content from file (use - for stdin)

madtea pr body patch

Apply anchored (old -> new) replacements to a pull-request body

FlagTypeDefaultDescription
--filestringRead replacements JSON from file (use - for stdin)
--newstringArray[]Replacement text (repeatable; pairs with –old)
--oldstringArray[]Anchor text to find (repeatable; pairs with –new)
--replace-allboolSlice[]Replace every occurrence for the corresponding –old/–new pair (repeatable, in order)

madtea pr body section-replace

Replace the content of a named marked section in a pull-request body

FlagTypeDefaultDescription
--ensureboolfalseSeed the section (append a fresh marked block) if it does not exist yet
--filestringRead content from file (use - for stdin)

madtea pr body task-toggle

Set the one matched checklist line in a pull-request body to a checked state

FlagTypeDefaultDescription
--checkedboolfalseSet the matched line to checked (- [x])
--uncheckedboolfalseSet the matched line to unchecked (- [ ])

madtea pr cancel-merge

Cancel pending auto-merge on a PR

madtea pr checkout

Check out a PR branch locally

madtea pr checks

Show CI/commit status checks for a PR

madtea pr close

Close one or more pull requests

madtea pr comment

Add comment to pull request

FlagTypeDefaultDescription
--bodystringComment text
--filestringRead content from file (use - for stdin)

madtea pr comment-delete

Delete a PR comment

madtea pr comment-edit

Edit a PR comment (reads from stdin if no text provided)

FlagTypeDefaultDescription
--bodystringComment text
--expected-bodystringExpected current comment body; reject the edit if the comment changed (safety check)
--filestringRead content from file (use - for stdin)

madtea pr comments

List comments on a pull request

madtea pr commits

List commits in a pull request

madtea pr compare

Compare two branches

madtea pr conflicts

Show files with merge conflicts in a PR

madtea pr create

Create a pull request

FlagTypeDefaultDescription
--allow-maintainer-editboolfalseAllow maintainers to edit the PR (Forgejo)
--assigneestringSlice[]Assignees by username (can be repeated)
--basestringBase branch for the PR (defaults to default branch)
--bodystringPR body/description
--draftboolfalseCreate as draft pull request
--filestringRead content from file (use - for stdin)
--fillboolfalseAutofill title and body from commits (first subject → title, rest → body)
--fill-firstboolfalseAutofill from first commit only (subject → title, body → body)
--fill-verboseboolfalseAutofill with full commit messages (first subject → title, all messages → body)
--headstringHead branch for the PR (defaults to current branch)
--labelstringSlice[]Label names or IDs (can be repeated)
--milestoneint640Milestone ID
--reviewerstringSlice[]Request review from users (can be repeated)
--titlestringPR title

madtea pr diff

Get PR diff content

FlagTypeDefaultDescription
--filestringFilter diff to specific file path

madtea pr edit

Edit pull request fields

FlagTypeDefaultDescription
--add-assigneestringSlice[]Add assignees (appends to existing)
--add-labelstringSlice[]Add labels by name or ID (appends to existing)
--add-reviewerstringSlice[]Add reviewers (Gitea only, not Forgejo)
--assigneestringSlice[]Set assignees (replaces existing)
--basestringChange base branch
--filestringRead JSON from file (use - for stdin)
--labelstringSlice[]Set labels by name or ID (replaces existing)
--milestoneint640Set milestone ID (0 to clear)
--remove-assigneestringSlice[]Remove specific assignees
--remove-labelstringSlice[]Remove labels by name or ID
--remove-milestoneboolfalseClear the milestone
--remove-reviewerstringSlice[]Remove reviewers (Gitea only, not Forgejo)
--statestringSet state: open or closed
--titlestringSet PR title

madtea pr files

List files changed in a pull request

madtea pr get

Get pull request details

madtea pr is-merged

Check if a PR is merged

madtea pr list

List pull requests

FlagTypeDefaultDescription
--authorstringFilter by PR author username
--basestringFilter by target base branch (Gitea only)
--labelstringSlice[]Filter by label IDs (comma-separated or repeated)
--limitint0Maximum number of items to return (0 = server default)
--milestonestringFilter by milestone ID
--pageint0Page number for pagination (0 = first page)
--sortstringSort by: oldest, recentupdate, leastupdate, mostcomment, leastcomment, priority
--statestringopenFilter by state: open, closed, all

madtea pr merge

Merge a pull request

FlagTypeDefaultDescription
--adminboolfalseUse admin privileges to merge even if checks haven’t passed
--autoboolfalseAuto-merge when all checks succeed
--delete-branchboolfalseDelete branch after merge
--ff-onlyboolfalseFast-forward only (fails if not possible)
--match-head-commitstringExpected head commit SHA (safety check)
--messagestringCustom merge commit message
--rebaseboolfalseRebase commits onto base branch
--rebase-mergeboolfalseRebase then create merge commit
--squashboolfalseSquash commits into one
--titlestringCustom merge commit title

madtea pr patch

Get PR as diff or patch text

FlagTypeDefaultDescription
--formatstringdiffOutput format: diff or patch

madtea pr pinned

List pinned pull requests

madtea pr ready

Mark a draft PR as ready for review

FlagTypeDefaultDescription
--undoboolfalseConvert a ready PR back to a draft (gh pr ready –undo)

madtea pr resolve-comment

Resolve a PR review comment

madtea pr revert

Create a revert PR for a merged PR

FlagTypeDefaultDescription
--bodystringCustom body for the revert PR
--titlestringCustom title for the revert PR

madtea pr review

Get specific review with comments

madtea pr review-comment-add

Add a comment to a specific review

FlagTypeDefaultDescription
--bodystringComment text (required)
--lineint0Line number in the new (post-image) file
--old-lineint0Line number in the old (pre-image) file (for commenting on deleted lines)
--pathstringFile path for the comment

madtea pr review-comment-delete

Delete a review comment

madtea pr review-comment-get

Get a specific review comment

madtea pr review-comments

List comments on a specific review

madtea pr review-create

Create/submit a review

FlagTypeDefaultDescription
--bodystringReview body/comment
--eventstringReview event: APPROVE, REQUEST_CHANGES, COMMENT (required)
--filestringRead content from file (use - for stdin)

madtea pr review-delete

Delete a review

madtea pr review-dismiss

Dismiss a review

FlagTypeDefaultDescription
--messagestringDismissal message (required)

madtea pr review-submit

Submit a pending review

FlagTypeDefaultDescription
--bodystringReview body/comment
--eventstringReview event: APPROVE, REQUEST_CHANGES, COMMENT (required)

madtea pr review-undismiss

Undismiss a previously dismissed review

madtea pr reviewer add

Request review from users

madtea pr reviewer list

List requested reviewers

madtea pr reviewer remove

Remove reviewer from PR

madtea pr reviews

List reviews on a pull request

madtea pr unresolve-comment

Unresolve a PR review comment

madtea pr update-branch

Update PR branch from base branch

MCP Tools

madt_prs

Manage pull requests (current repo by default): list/CRUD, merge, conflicts, files/commits/diff/patch, checks, reviews, checkout, revert, pinned, comments. To complete a branch use madt_finish, not action=merge.

Output schema: declared

One tool, action-dispatched. Set action to one of:

action="body"

Safely edit the body via anchored, conflict-checked ops (no wholesale overwrite). Set op to choose the operation.

Required: op

One of: number | numbers

action="body" op="append"

Append content to the END of the body (no anchor). Conflict-checked (412 if the body changed since read). See madt_help(topic=“body”).

Required: content

action="body" op="patch"

Apply anchored (old→new) replacements to the body. Conflict-checked: a drifted/ambiguous anchor or a 412 body-changed-since-read is rejected. See madt_help(topic=“body”).

Required: replacements

action="body" op="section_replace"

Replace the content between the named section markers (ensure seeds them if absent). Conflict-checked (412 if the body changed since read). See madt_help(topic=“body”).

Required: section, content

Optional: ensure

action="body" op="task_toggle"

Set the one - [ ] / - [x] checklist line matched by match to an explicit checked state (not a blind flip). Idempotent; a 412 lost-update is rejected. See madt_help(topic=“body”).

Required: match, checked

action="cancel_auto_merge"

Cancel a scheduled auto-merge for the PR.

One of: number | numbers

action="checkout"

Check out the PR branch locally (fetch + checkout).

One of: number | numbers

action="checks"

Show CI / commit status checks for the PR head SHA.

One of: number | numbers

action="close"

Close pull request(s) without merging (abandon). Batch multiple via numbers in one call (never loop). To merge instead, use madt_finish; to reopen, use action=edit state=open.

One of: number | numbers

action="comment"

Add a comment to a PR.

Required: body

One of: number | numbers

action="comment_delete"

Delete a PR/issue comment by comment ID.

Required: comment_id

action="comment_edit"

Edit a PR/issue comment by comment ID (full-body replace). expected_body is required — a comment changed since you read it is never silently overwritten. Read it first, pass its body.

Required: comment_id, body, expected_body

action="comments"

List comments on a PR.

One of: number | numbers

action="commits"

List commits in a PR.

One of: number | numbers

action="compare"

Compare two branches. Returns forge compare JSON (total_commits, commits), NOT a textual diff — for diff/patch text use action=diff or patch. Output is JSON in both modes; raw_json is a no-op.

Required: base, head

action="conflicts"

Show merge conflict files for a PR.

One of: number | numbers

action="create"

Create a PR without merging — the review-only alternative to madt_finish (draft=true for a draft). Head defaults to the current branch and must already exist on the remote (push first with madt_push). One of title/fill/fill_first/fill_verbose is required.

One of: title | fill | fill_first | fill_verbose

Optional: body, head, base, labels, assignees, milestone, reviewers, draft, allow_maintainer_edit

action="diff"

Get the PR diff (unified diff text). file limits output to one file’s hunks (matched by path substring) so a large-PR review needn’t pull the whole diff.

One of: number | numbers

Optional: file

action="edit"

Update PR fields (title, state, base, draft, milestone, assignees, reviewers). Body edits use action=body.

One of: number | numbers

Optional: data, title, state, base, draft, milestone, remove_milestone, assignees, add_assignees, remove_assignees, add_reviewers, remove_reviewers

action="files"

List files changed in a PR.

One of: number | numbers

action="get"

Get PR details — full body and metadata, complete and never truncated. Batch multiple via numbers (never loop); a number that fails to fetch is silently dropped. PR comments are separate — use action=comments.

One of: number | numbers

action="is_merged"

Check if a PR is merged.

One of: number | numbers

action="list"

List pull requests in the current repo. Filter by state, sort, milestone, labels, base branch, author. sort: oldest|recentupdate|leastupdate|mostcomment|leastcomment|priority. Paginated: limit default 30 (max 200), page is 1-based.

Optional: state, sort, milestone_filter, labels_filter, base_branch, author, limit, page

action="merge"

Merge a PR. Strategy: merge, squash, rebase, rebase-merge, fast-forward-only; omit to honor the repo’s configured default merge style. Idempotent: already-merged skips. delete_branch removes head; force_merge bypasses checks; auto_merge only schedules, not to mainline (use madt_finish). For N PRs use madt_orchestrate.

One of: number | numbers

Optional: strategy, title, message, delete_branch, force_merge, auto_merge, head_commit_id

action="patch"

Get PR contents as diff or patch text.

One of: number | numbers

Optional: format

action="pinned"

List pinned pull requests in the repository.

action="resolve_comment"

Resolve a PR review comment.

Required: comment_id

action="revert"

Open a revert PR for a merged PR. Applies git revert in a DISPOSABLE linked worktree off the up-to-date default branch (run madt_pull first), never your primary checkout, then opens the PR and removes the worktree. On conflict the worktree is parked (primary untouched) with dir= resolve/abandon rails.

One of: number | numbers

Optional: title, body

action="review"

Get a single review by ID.

Required: review_id

One of: number | numbers

action="review_comment_add"

Add a comment to an existing pending review (review_id). For an inline comment pass path + new_line (post-image) or old_line (pre-image); omit for a review-level comment. Create the pending review first via madt_api_call POST …/reviews with no event.

Required: review_id, body

One of: number | numbers

Optional: path, old_line, new_line

action="review_comment_delete"

Delete a comment from a review.

Required: review_id, comment_id

One of: number | numbers

action="review_comment_get"

Get a single review comment by ID.

Required: review_id, comment_id

One of: number | numbers

action="review_comments"

List comments on a specific review.

Required: review_id

One of: number | numbers

action="review_create"

Create and submit a review on a PR. event must be APPROVE, REQUEST_CHANGES, or COMMENT (not COMMENTED).

Required: event

One of: number | numbers

Optional: body

action="review_delete"

Delete a review.

Required: review_id

One of: number | numbers

action="review_dismiss"

Dismiss a review with a message.

Required: review_id, message

One of: number | numbers

action="review_submit"

Submit an existing pending review by review_id. event must be APPROVE, REQUEST_CHANGES, or COMMENT (not COMMENTED). Create a pending review first via madt_api_call POST …/reviews with no event, or use action=review_create to do both in one step.

Required: review_id, event

One of: number | numbers

Optional: body

action="review_undismiss"

Undismiss a previously dismissed review.

Required: review_id

One of: number | numbers

action="reviewer_add"

Request review from one or more users.

Required: reviewers

One of: number | numbers

action="reviewer_list"

List requested reviewers on a PR.

One of: number | numbers

action="reviewer_remove"

Remove review requests from one or more users.

Required: reviewers

One of: number | numbers

action="reviews"

List reviews on a PR.

One of: number | numbers

action="unresolve_comment"

Unresolve a previously resolved PR review comment.

Required: comment_id

action="update_branch"

Update PR branch by merging or rebasing the base branch into it.

One of: number | numbers

Canonical source: docs/reference/pull-requests.md in the madtea repo.