list_pull_requests

List the pull requests komrad has stored for a repository, a page at a time: every one opened from a branch when one is named, whatever its state, or every one stored for the repository when none is.

Pull Requestread-onlyidempotentMCP tool

The unfinished ones come first and each group is newest opened first, so the first answered for a branch is the one an agent's row on that branch stands for. Give the repository as a git remote spells it or as its canonical address, and pass the next_page_token back as pagination.cursor for the next page. This reads what the pull request sync has stored rather than asking the forge, so a repository no live agent sits on may be behind or empty; list_forge_pull_requests asks the forge itself.

Calling it#

curl -X POST http://127.0.0.1:8787/pullrequest.v1.PullRequestService/ListPullRequests \
  -H 'Content-Type: application/json' \
  -d '{
  "repositoryUrl": "<repositoryUrl>"
}'

Request#

ListPullRequestsRequest#

FieldTypeDescription
repositoryUrlstring

The repository the pull requests target, as a git remote spells it or as the canonical address komrad stores.

required, at most 2048 characters

headBranchstring

The branch the pull requests were opened from; left empty, every pull request stored for the repository is listed.

at most 512 characters

paginationPagination

Which page to read and how many to a page, twenty when unset and at most a hundred.

Response#

ListPullRequestsResponse#

FieldTypeDescription
pullRequestslist of PullRequest

One page of pull requests, the unfinished ones first and each group newest opened first, so the first is the one an agent's row on the branch stands for.

nextPageTokenstring

The token for the page after this one, unset on the last.

Types#

Pagination#

FieldTypeDescription
limitint32

How many rows to return, capped by the server, and left to the server entirely when unset.

cursorstring

The next_page_token a previous reply carried, or unset to start from the beginning.

at most 2048 characters

PullRequest#

FieldTypeDescription
idstring

The handle komrad keys the row by.

forgestring

Which forge it lives on, such as github.

providerIdstring

The forge's own stable identifier, such as GitHub's node_id.

urlstring

The web address a person opens.

repositoryUrlstring

The canonical address of the repository it targets.

headRepositoryUrlstring

The canonical address of the repository its branch lives in, empty when the forge no longer has it.

numberint32

The number the forge shows a person, which is per repository.

titlestring

The title as the forge has it.

headBranchstring

The branch the pull request was opened from.

headShastring

The commit at the tip of that branch when last read.

baseBranchstring

The branch it targets.

baseShastring

The commit the target branch was at when last read.

draftbool

Whether the forge marks it a draft.

statePullRequestState

Where it stands, decided from the stored row.

openedAtstring

When it was opened on the forge, in RFC 3339.

changedAtstring

When the forge last saw it change, in RFC 3339.

mergedAtstring

When it merged, in RFC 3339, unset while it has not.

closedAtstring

When it closed, in RFC 3339, unset while it is open; a merged one carries this too.

reviewDecisionReviewDecision

Where the forge says the reviews stand.

checksChecks

Where the checks on its head stand.

mergeabilityMergeability

Where the forge says it stands against its base and rules.

PullRequestState#

PullRequestState is where a stored pull request stands, decided on the server from its stamps, its draft flag, the checks on its head, its mergeability and the forge's review decision, finished first.

ValueDescription
PULL_REQUEST_STATE_UNREAD

The repository's first sweep has not completed, so nothing is known.

PULL_REQUEST_STATE_NONE

The repository has been swept and nothing was opened from the branch.

PULL_REQUEST_STATE_OPEN

Open with no review decision that settles it.

PULL_REQUEST_STATE_APPROVED

Open and the forge would merge it now: its rules on reviews and checks are met and the branch is level with its base.

PULL_REQUEST_STATE_CHANGES_REQUESTED

Open with a reviewer asking for changes.

PULL_REQUEST_STATE_DRAFT

Still a draft, whatever its reviews say.

PULL_REQUEST_STATE_MERGED

Merged.

PULL_REQUEST_STATE_CLOSED

Closed without merging.

PULL_REQUEST_STATE_FAILING

Open with a failing check on its head, whatever its reviews say.

PULL_REQUEST_STATE_APPROVED_WAITING

Approved on the forge but not yet mergeable: its checks are still running, its branch is behind, or a branch rule is unmet.

PULL_REQUEST_STATE_CONFLICTING

Open and no longer merging cleanly into its base, whatever its reviews say.

ReviewDecision#

ReviewDecision is where a forge says a pull request's reviews stand.

ValueDescription
REVIEW_DECISION_NONE

The forge has said nothing about the reviews.

REVIEW_DECISION_PENDING

A review the forge requires that nobody has given.

REVIEW_DECISION_APPROVED

The forge counts the pull request as approved.

REVIEW_DECISION_CHANGES_REQUESTED

A reviewer is asking for changes.

Checks#

Checks is where the checks on a pull request's head commit stand, as the forge last reported them.

ValueDescription
CHECKS_NONE

The forge reports no checks on the head.

CHECKS_PENDING

A run is still in flight.

CHECKS_PASSING

Every check passed.

CHECKS_FAILING

At least one check failed.

Mergeability#

Mergeability is where the forge says a pull request stands against its base and its branch rules, as it last computed it.

ValueDescription
MERGEABILITY_UNKNOWN

The forge has not computed it yet.

MERGEABILITY_CLEAN

The forge would merge it now.

MERGEABILITY_UNSTABLE

Its checks are not all passing.

MERGEABILITY_BLOCKED

A branch rule is unmet, such as a required review.

MERGEABILITY_BEHIND

The base has moved past the branch.

MERGEABILITY_CONFLICTING

The branch no longer merges cleanly into its base.