Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

update_assignees

Change the assignees of a GitHub issue or pull request by specifying the repository owner, repository name, issue number, and list of assignee usernames.

Instructions

Updates the assignees for a specific issue or pull request in a GitHub repository. Args: repo_owner (str): The owner of the repository. repo_name (str): The name of the repository. issue_number (int): The issue or pull request number to update. assignees (list[str]): A list of usernames to assign to the issue or pull request. Returns: Dict[str, Any]: The updated issue or 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 request fails or an exception is raised.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_ownerYes
repo_nameYes
issue_numberYes
assigneesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'update_assignees' tool. Makes a PATCH request to the GitHub API to update assignees on an issue/PR, logs missing assignees that couldn't be applied, and returns the updated issue data or an error.
    def update_assignees(
        self, repo_owner: str, repo_name: str, issue_number: int, assignees: list[str]
    ) -> dict[str, Any]:
        """
        Updates the assignees for a specific issue or pull request in a GitHub repository.
        Args:
            repo_owner (str): The owner of the repository.
            repo_name (str): The name of the repository.
            issue_number (int): The issue or pull request number to update.
            assignees (list[str]): A list of usernames to assign to the issue or pull request.
        Returns:
            Dict[str, Any]: The updated issue or 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 request fails or an exception is raised.
        """
        logger.info(f"Updating assignees for issue/PR {repo_owner}/{repo_name}#{issue_number}")
        # Construct the issue URL
        issue_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/issues/{issue_number}"
        try:
            # Update the assignees
            response = httpx.patch(
                issue_url,
                headers=self._get_headers(),
                json={"assignees": assignees},
                timeout=TIMEOUT,
            )
            self._raise_for_status(response, f"issue/PR #{issue_number} assignees")
            issue_data = response.json()
    
            # GitHub silently drops assignees it cannot apply (non-collaborators, unknown users).
            # Compare requested vs actually assigned and surface any discrepancy.
            actual_logins = {u["login"] for u in issue_data.get("assignees", [])}
            requested = set(assignees)
            missing = requested - actual_logins
    
            if missing:
                logger.warning(f"Some assignees were not applied: {missing}")
                return {
                    "status": "partial",
                    "message": f"The following assignees could not be applied (not a collaborator or user does not exist): {sorted(missing)}",
                    "assignees_requested": sorted(requested),
                    "assignees_applied": sorted(actual_logins),
                    "issue": issue_data,
                }
    
            logger.info("Assignees updated successfully")
            return issue_data
        except GitHubAuthError:
            raise
        except Exception as e:
            logger.error(f"Error updating assignees: {str(e)}")
            traceback.print_exc()
            return {"status": "error", "message": str(e)}
  • The registration mechanism: _register_tools() calls register_tools(self.gi), which iterates over all public methods on the GitHubIntegration instance and adds them as MCP tools via self.mcp.add_tool(). This is how update_assignees gets registered.
    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 generic register_tools method that dynamically discovers all public methods on an object and registers them 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)
Behavior3/5

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

No annotations provided, so description carries full burden. It mentions return type (Dict or None) and error handling (logs error, returns None). However, it does not disclose whether assignees are replaced or appended, nor permissions required.

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?

Structured as docstring with Args and Returns sections. Efficiently conveys purpose, parameters, return, and error handling without unnecessary fluff.

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?

Covers purpose, all parameters, return behavior, and error handling. Given no annotations and simple parameter structure, it provides adequate context for an agent to use the tool correctly. Could mention whether assignees replace or add.

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%, but the description lists all four parameters with types and brief descriptions. This adds meaning beyond the raw schema, though descriptions are minimal (e.g., assignees described as 'list of usernames').

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?

Clearly states the verb 'updates' and the resource 'assignees for a specific issue or pull request'. Differentiates from siblings like update_issue or update_pr_description by focusing on assignees.

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 explicit guidance on when to use this tool vs. alternatives like update_issue (which might also assign) or when not to use it. Only describes basic functionality.

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