Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

update_reviews

Submit a review for a GitHub pull request. Approve, request changes, or comment to provide feedback directly.

Instructions

Submits a review for a specific pull request in a GitHub repository. Args: repo_owner (str): The owner of the repository. repo_name (str): The name of the repository. pr_number (int): The pull request number to review. event (Literal['APPROVE', 'REQUEST_CHANGES', 'COMMENT']): The type of review event. body (str, optional): Required when using REQUEST_CHANGES or COMMENT for the event parameter. Defaults to None. Returns: Dict[str, Any]: The JSON response from the GitHub API containing review information if successful. None: If an error occurs during the review submission process. Error Handling: Logs errors and prints the traceback if the review submission fails, returning None.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_ownerYes
repo_nameYes
pr_numberYes
eventYes
bodyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `update_reviews` handler method in `GitHubIntegration` class. Submits a pull request review via POST to GitHub's /repos/{owner}/{repo}/pulls/{pr_number}/reviews endpoint. Validates event type (APPROVE, REQUEST_CHANGES, COMMENT), optionally includes a body, and returns the API response.
    def update_reviews(
        self,
        repo_owner: str,
        repo_name: str,
        pr_number: int,
        event: Literal["APPROVE", "REQUEST_CHANGES", "COMMENT"],
        body: str | None = None,
    ) -> dict[str, Any]:
        """
        Submits a review for a specific pull request in a GitHub repository.
        Args:
            repo_owner (str): The owner of the repository.
            repo_name (str): The name of the repository.
            pr_number (int): The pull request number to review.
            event (Literal['APPROVE', 'REQUEST_CHANGES', 'COMMENT']): The type of review event.
            body (str, optional): Required when using REQUEST_CHANGES or COMMENT for the event parameter. Defaults to None.
        Returns:
            Dict[str, Any]: The JSON response from the GitHub API containing review information if successful.
            None: If an error occurs during the review submission process.
        Error Handling:
            Logs errors and prints the traceback if the review submission fails, returning None.
        """
        logger.info(f"Submitting review for PR {repo_owner}/{repo_name}#{pr_number}")
    
        # Construct the reviews URL
        reviews_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/pulls/{pr_number}/reviews"
    
        try:
            response = httpx.post(
                reviews_url,
                headers=self._get_headers(),
                json={"body": body, "event": event},
                timeout=TIMEOUT,
            )
            self._raise_for_status(response, f"PR #{pr_number} review")
            review_data = response.json()
    
            logger.info("Review submitted successfully")
            return review_data
    
        except GitHubAuthError:
            raise
        except Exception as e:
            logger.error(f"Error submitting review: {str(e)}")
            traceback.print_exc()
            return {"status": "error", "message": str(e)}
  • Tools are registered dynamically in PRIssueAnalyser._register_tools() which calls self.register_tools(self.gi). The register_tools method iterates over all public methods of the GitHubIntegration instance (including update_reviews) and adds them as MCP tools via self.mcp.add_tool(method).
    def _register_tools(self):
        self.register_tools(self.gi)
        self.register_tools(self.ip)
        self.mcp.add_provider(SkillsDirectoryProvider(Path(__file__).parent / "skills"))
    
    def register_tools(self, methods: Any = None) -> None:
        for name in dir(methods):
            if name.startswith("_"):
                continue
            method = getattr(methods, name)
            if inspect.isroutine(method):
                self.mcp.add_tool(method)
  • The register_tools method dynamically discovers and registers all public methods from a given object as MCP tools. Since GitHubIntegration has an update_reviews method, it gets registered as an MCP tool named 'update_reviews'.
    def register_tools(self, methods: Any = None) -> None:
        for name in dir(methods):
            if name.startswith("_"):
                continue
            method = getattr(methods, name)
            if inspect.isroutine(method):
                self.mcp.add_tool(method)
Behavior3/5

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

With no annotations, the description carries full burden. It discloses error handling (logs, returns None) and parameter constraints, but does not clarify if 'submit' creates a new review or updates an existing one (the name suggests update, description says submit). No mention of side effects or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with clear sections for args, returns, and error handling. Every sentence adds value; no wasted words.

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

Completeness4/5

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

Given the presence of an output schema, the description need not detail return values, but it does summarize them. It covers all parameters and error handling. Missing context like authentication or repository existence, but overall adequate.

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

Parameters4/5

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

Schema coverage is 0%, so the description must add meaning. It explains all five parameters, including the dependency that 'body' is required when event is REQUEST_CHANGES or COMMENT. This adds significant value beyond the schema.

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

Purpose5/5

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

The description clearly states 'Submits a review for a specific pull request in a GitHub repository.' This is a specific verb and resource, and it distinguishes from sibling tools like add_pr_comments or merge_pr.

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?

No guidance is provided on when to use this tool versus alternatives. The description does not mention context, prerequisites, or exclusions, leaving the agent to infer usage from the name and parameters.

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/saidsef/mcp-github-pr-issue-analyser'

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