Skip to main content
Glama

List pull requests

list_pull_requests
Read-only

Lists 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

NameRequiredDescriptionDefault
baseNoOnly pull requests into this base (target) branch, e.g. `main`.
headNoOnly 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.
pageNo1-based page number.
repoYesRepository name, e.g. `forgejo-mcp-rs`.
sortNoOrder: `latest` (the default, newest first), `oldest`, `recentupdate`, `recentclose`, `leastupdate`, `mostcomment`, `leastcomment` or `priority`.
limitNoResults per page.
ownerYesRepository owner — user or organization, e.g. `brechanbech`.
stateNoFilter by state: `open` (default), `closed`, or `all`.
authorNoOnly pull requests opened by this login.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.26.0
    • addedInput schema / properties / author
      Added value: +{
      +  "default": null,
      +  "description": "Only pull requests opened by this login.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / sort
      Added value: +{
      +  "default": null,
      +  "description": "Order: `latest` (the default, newest first), `oldest`, `recentupdate`, `recentclose`,\n`leastupdate`, `mostcomment`, `leastcomment` or `priority`.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. First observedv0.22.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover readOnly/openWorld, but the description goes well beyond: it discloses that unsupported filters are emulated client-side on Gitea/Forgejo, that the whole list is walked and capped at 1000, and that page/limit stop applying in that mode. That is exactly the kind of hidden behavior an agent needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and filters before the cheaper-to-skip caveats, and nearly every clause carries information. The single dense paragraph with the emulation caveat mid-stream makes it slightly harder to scan than ideal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by listing the exact returned fields (number, title, state, merged, draft, mergeable, base, head, head_repo, head_sha, author, labels, dates) and pointing at get_pull_request for the trimmed detail. Nothing essential is missing for a 9-param read tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so baseline is 3; the description still adds value by clarifying that `head` accepts a bare branch or owner:branch and by spelling out the default sort (newest first) and the interaction between page/limit and emulated filtering.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('List pull requests in a repository (owner/repo)') and enumerates the filter axes, which lets an agent distinguish it from get_pull_request, list_pull_request_reviews and list_pull_request_files without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete usage contexts — 'with state=open it answers whether a branch already has an open pull request' — and routes detail-seekers to get_pull_request. No explicit exclusion of the reviewer/file/comment listing siblings, so not a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.