close_pull_request
Close a pull request without merging it in Pagure git forges. Use this tool to end pull request workflows when changes are not needed.
Instructions
Close a pull request without merging.
Args: project: Project name pr_id: Pull request ID number to close namespace: Project namespace (default: rpms)
Returns: JSON string with close result
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| pr_id | Yes | ||
| namespace | No | rpms |
Implementation Reference
- src/pagure/client.py:273-294 (handler)The core API logic for closing a pull request, implemented in the PagureClient class.
async def close_pull_request( self, project: str, pr_id: int, namespace: str = "rpms", ) -> Dict[str, Any]: """Close a pull request without merging. Args: project: Project name pr_id: Pull request ID namespace: Project namespace Returns: Close result """ response = await self.client.post( f"{self.api_base}/{namespace}/{project}/pull-request/{pr_id}/close", headers=self._get_headers(), ) response.raise_for_status() return response.json() - src/pagure/server.py:234-253 (registration)MCP tool registration and wrapper function for closing a pull request.
async def close_pull_request( project: str, pr_id: int, namespace: str = "rpms", ) -> str: """Close a pull request without merging. Args: project: Project name pr_id: Pull request ID number to close namespace: Project namespace (default: rpms) Returns: JSON string with close result """ client = get_client() result = await client.close_pull_request(project, pr_id, namespace) import json return json.dumps(result, indent=2)