Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

update_pr_description

Update the title and description of a GitHub pull request by specifying the repository, pull request number, new title, and new description.

Instructions

Updates the title and description (body) of a specific pull request on GitHub. 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 update. new_title (str): The new title for the pull request. new_description (str): The new description (body) for the pull request. Returns: Dict[str, Any]: The updated pull request data as returned by the GitHub API if the update is successful. None: If an error occurs during the update process. Error Handling: Logs an error message and prints the traceback if the update fails due to an exception (e.g., network issues, invalid credentials, or API errors).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_ownerYes
repo_nameYes
pr_numberYes
new_titleYes
new_descriptionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
descriptionYes
authorYes
created_atYes
updated_atYes
stateYes

Implementation Reference

  • The actual handler function `update_pr_description` that performs the PR description update via a PATCH request to the GitHub API.
    def update_pr_description(
        self,
        repo_owner: str,
        repo_name: str,
        pr_number: int,
        new_title: str,
        new_description: str,
    ) -> PRContent:
        """
        Updates the title and description (body) of a specific pull request on GitHub.
        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 update.
            new_title (str): The new title for the pull request.
            new_description (str): The new description (body) for the pull request.
        Returns:
            Dict[str, Any]: The updated pull request data as returned by the GitHub API if the update is successful.
            None: If an error occurs during the update process.
        Error Handling:
            Logs an error message and prints the traceback if the update fails due to an exception (e.g., network issues, invalid credentials, or API errors).
        """
        logger.info(f"Updating PR description for {repo_owner}/{repo_name}#{pr_number}")
    
        # Construct the PR URL
        pr_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/pulls/{pr_number}"
        try:
            # Update the PR description
            response = httpx.patch(
                pr_url,
                headers=self._get_headers(),
                json={"title": new_title, "body": new_description},
                timeout=TIMEOUT,
            )
            self._raise_for_status(response, f"PR #{pr_number}")
            pr_data = response.json()
    
            logger.info("PR description updated successfully")
            return pr_data
        except GitHubAuthError:
            raise
        except Exception as e:
            logger.error(f"Error updating PR description: {str(e)}")
            traceback.print_exc()
            return {"status": "error", "message": str(e)}
  • The `register_tools` method that dynamically registers all public methods from GitHubIntegration (including `update_pr_description`) as MCP tools.
    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 PRContent TypedDict used as the return type for `update_pr_description`.
    type PRContent = TypedDict(
        "PRContent",
        {  # pyright: ignore[reportInvalidTypeForm]
            "title": str,
            "description": str | None,
            "author": str,
            "created_at": str,
            "updated_at": str,
            "state": str,
        },
    )
Behavior3/5

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

No annotations are provided, so the description carries the burden. It notes that the tool mutates state by updating title and body, returns updated data or None on error, and logs errors. However, it doesn't disclose potential side effects like triggering CI, sending notifications, or required permissions.

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 structured into sections (Args, Returns, Error Handling), making it easy to scan. It is somewhat verbose but each sentence adds value. Could be slightly more concise by removing redundant parts.

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 tool has 5 parameters and no annotations, the description covers parameters, return values, and error handling. An output schema exists, so return type is mentioned. It lacks mention of prerequisites like authentication or access, which is acceptable for this context.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by listing all 5 parameters with types and brief explanations in the docstring (e.g., 'repo_owner (str): The owner of the repository'). This adds meaning beyond the bare 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 explicitly states it updates the title and description of a specific pull request. This is a specific verb+resource combination that clearly distinguishes it from siblings like merge_pr or add_pr_comments.

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 does not provide any guidance on when to use this tool versus alternatives (e.g., update_issue for issues, or using GitHub UI). No exclusions or prerequisites are mentioned.

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