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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool adds a comment (implying a mutation/write operation) but doesn't disclose behavioral traits like required permissions, whether the comment is editable/deletable, rate limits, or error conditions. The mention of a JSON return is minimal and doesn't detail the response structure.

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?

The description is appropriately sized and front-loaded, with the purpose stated first. The Args and Returns sections add structure, though they could be more integrated. There's minimal waste, but it could be slightly more polished (e.g., combining sentences).

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

Completeness3/5

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

Given 4 parameters with 0% schema coverage, no annotations, and an output schema (implied by 'Returns: JSON string'), the description is moderately complete. It covers the basic action and parameters but lacks details on behavior, error handling, and output specifics. The output schema reduces the need to explain return values, but more context on usage and constraints is needed for a mutation tool.

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds basic semantics by listing parameters (project, pr_id, comment, namespace) and noting a default for namespace, but it doesn't explain what these mean (e.g., format of project name, what namespace represents). This partially compensates but leaves gaps, aligning with the baseline when schema coverage is low.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Add a comment to a pull request.' It specifies the verb ('Add') and resource ('pull request'), making the action clear. However, it doesn't differentiate from sibling tools like 'close_pull_request' or 'merge_pull_request' beyond the obvious difference in action type.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing pull request), exclusions, or comparisons to sibling tools like 'get_pull_request' for viewing comments. Usage is implied but not explicitly stated.

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

Install Server

Other Tools

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