Skip to main content
Glama
lemenkov
by lemenkov

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
NameRequiredDescriptionDefault
projectYes
pr_idYes
commentYes
namespaceNorpms

Implementation Reference

  • 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()
  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lemenkov/mcp-pagure'

If you have feedback or need assistance with the MCP directory API, please join our Discord server