list_pull_requests
Retrieve pull requests from Pagure projects with filtering by status and pagination controls to manage code review workflows.
Instructions
List pull requests for a Pagure project.
Args: project: Project name namespace: Project namespace (default: rpms) status: PR status - Open, Merged, Closed, or all (default: Open) page: Page number (default: 1) per_page: Results per page (default: 20)
Returns: JSON string with PR list and pagination info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| namespace | No | rpms | |
| status | No | Open | |
| page | No | ||
| per_page | No |
Implementation Reference
- src/pagure/client.py:166-198 (handler)The API client method that performs the actual network request to list pull requests from the Pagure API.
async def list_pull_requests( self, project: str, namespace: str = "rpms", status: str = "Open", page: int = 1, per_page: int = 20, ) -> Dict[str, Any]: """List pull requests. Args: project: Project name namespace: Project namespace status: PR status (Open, Merged, Closed, all) page: Page number per_page: Results per page Returns: Dict with PRs and pagination info """ params = { "status": status, "page": page, "per_page": per_page, } response = await self.client.get( f"{self.api_base}/{namespace}/{project}/pull-requests", params=params, headers=self._get_headers(), ) response.raise_for_status() return response.json() - src/pagure/server.py:137-160 (registration)The MCP tool handler registration for list_pull_requests, which invokes the PagureClient method.
async def list_pull_requests( project: str, namespace: str = "rpms", status: str = "Open", page: int = 1, per_page: int = 20, ) -> str: """List pull requests for a Pagure project. Args: project: Project name namespace: Project namespace (default: rpms) status: PR status - Open, Merged, Closed, or all (default: Open) page: Page number (default: 1) per_page: Results per page (default: 20) Returns: JSON string with PR list and pagination info """ client = get_client() result = await client.list_pull_requests(project, namespace, status, page, per_page) import json return json.dumps(result, indent=2)