List pull requests
list_pull_requestsLists pull requests in a repository with filters for state, base/head branch, author, sort order, and pagination. Use it to find open PRs for a branch or browse closed requests.
Instructions
List pull requests in a repository (owner/repo); optional state (open/closed/all), base and head branch, author (login), sort (oldest, recentupdate, recentclose, mostcomment, …; newest first by default), and page/limit. head is a bare branch name, or owner:branch to require the fork it comes from; with state=open it answers whether a branch already has an open pull request. Every answer is checked against base and head, because a forge that lacks a filter ignores it: Gitea has no head filter, and Forgejo had neither before 16. On those the whole list is walked and filtered here (capped at 1000), so page/limit no longer apply. Each pull request is slimmed to number, title, state, merged, draft, mergeable, base, head, head_repo (only for a fork), head_sha, author, labels and dates; get_pull_request has the description and review detail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Only pull requests into this base (target) branch, e.g. `main`. | |
| head | No | Only pull requests from this head (source) branch: a bare branch name, e.g. `fix/login`, or `owner:branch` to require the fork it comes from. | |
| page | No | 1-based page number. | |
| repo | Yes | Repository name, e.g. `forgejo-mcp-rs`. | |
| sort | No | Order: `latest` (the default, newest first), `oldest`, `recentupdate`, `recentclose`, `leastupdate`, `mostcomment`, `leastcomment` or `priority`. | |
| limit | No | Results per page. | |
| owner | Yes | Repository owner — user or organization, e.g. `brechanbech`. | |
| state | No | Filter by state: `open` (default), `closed`, or `all`. | |
| author | No | Only pull requests opened by this login. |