Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

update_pr_description

Modify pull request titles and descriptions on GitHub to reflect changes in scope, requirements, or context during development.

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
resultYes

Implementation Reference

  • The handler function that executes the 'update_pr_description' tool logic. It constructs the GitHub API URL for the specified PR and sends a PATCH request to update the PR's title and body (description). Handles errors by logging and returning an error dict.
    def update_pr_description(self, repo_owner: str, repo_name: str, pr_number: int, new_title: str, new_description: str) -> Dict[str, Any]:
        """
        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).
        """
        logging.info(f"Updating PR description for {repo_owner}/{repo_name}#{pr_number}")
    
        # Construct the PR URL
        pr_url = self._get_pr_url(repo_owner, repo_name, pr_number)
        try:
            # Update the PR description
            response = requests.patch(pr_url, headers=self._get_headers(), json={
                'title': new_title,
                'body': new_description
            }, timeout=TIMEOUT)
            response.raise_for_status()
            pr_data = response.json()
    
            logging.info("PR description updated successfully")
            return pr_data
        except Exception as e:
            logging.error(f"Error updating PR description: {str(e)}")
            traceback.print_exc()
            return {"status": "error", "message": str(e)}
  • The registration code that dynamically discovers and registers all public methods (including 'update_pr_description') from the GitHubIntegration instance as MCP tools using FastMCP's add_tool method. Called via _register_tools(self.gi).
    def register_tools(self, methods: Any = None) -> None:
        for name, method in inspect.getmembers(methods):
            if (inspect.isfunction(method) or inspect.ismethod(method)) and not name.startswith("_"):
                self.mcp.add_tool(method)
  • The entry point for tool registration, which invokes register_tools on the GitHubIntegration instance (self.gi), thereby registering the 'update_pr_description' handler.
    def _register_tools(self):
        self.register_tools(self.gi)
        self.register_tools(self.ip)
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by specifying the mutation nature ('Updates'), error handling behavior (logs errors and prints traceback), and return types (dict on success, None on error). It also mentions potential failure causes like network issues or invalid credentials, adding valuable context beyond basic functionality.

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 well-structured with clear sections (Args, Returns, Error Handling) and uses efficient sentences. However, the 'Error Handling' section could be more concise by summarizing instead of detailing traceback printing, making it slightly verbose but still effective.

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?

For a mutation tool with no annotations, 0% schema coverage, but an output schema, the description does well by covering purpose, parameters, returns, and error handling. It misses some context like authentication requirements or rate limits, but the output schema likely handles return values, making this reasonably complete.

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 description coverage is 0%, so the description must compensate. It explicitly lists all 5 parameters with brief explanations (e.g., 'The owner of the repository'), adding essential semantics that the schema lacks. However, it doesn't provide format details like GitHub username conventions or PR number ranges, leaving some gaps.

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 the specific action ('Updates the title and description'), identifies the resource ('a specific pull request on GitHub'), and distinguishes it from siblings like update_issue or update_assignees by focusing on PR metadata rather than comments, reviews, or issue updates.

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

Usage Guidelines3/5

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

The description implies usage for modifying PR metadata but provides no explicit guidance on when to use this tool versus alternatives like update_issue for issues or update_reviews for reviews. It doesn't mention prerequisites like authentication or permissions, leaving usage context incomplete.

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