comment_on_pr
Add comments to pull requests in Pagure git forges to provide feedback, ask questions, or participate in code reviews.
Instructions
Add a comment to a pull request.
Args: project: Project name pr_id: Pull request ID number comment: Comment text to add namespace: Project namespace (default: rpms)
Returns: JSON string with comment creation result
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| pr_id | Yes | ||
| comment | Yes | ||
| namespace | No | rpms |
Implementation Reference
- src/pagure/client.py:224-248 (handler)The actual implementation of comment_on_pr logic using httpx to call the Pagure API.
async def comment_on_pr( self, project: str, pr_id: int, comment: str, namespace: str = "rpms", ) -> Dict[str, Any]: """Add a comment to a pull request. Args: project: Project name pr_id: Pull request ID comment: Comment text namespace: Project namespace Returns: Comment creation result """ response = await self.client.post( f"{self.api_base}/{namespace}/{project}/pull-request/{pr_id}/comment", json={"comment": comment}, headers=self._get_headers(), ) response.raise_for_status() return response.json() - src/pagure/server.py:186-207 (registration)The tool registration and entry point for the MCP tool 'comment_on_pr'.
async def comment_on_pr( project: str, pr_id: int, comment: str, namespace: str = "rpms", ) -> str: """Add a comment to a pull request. Args: project: Project name pr_id: Pull request ID number comment: Comment text to add namespace: Project namespace (default: rpms) Returns: JSON string with comment creation result """ client = get_client() result = await client.comment_on_pr(project, pr_id, comment, namespace) import json return json.dumps(result, indent=2)