Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

update_issue

Modify GitHub issue details including title, body, labels, and state to reflect current project status and requirements.

Instructions

Updates an existing issue in the specified GitHub repository. Args: repo_owner (str): The owner of the repository. repo_name (str): The name of the repository. issue_number (int): The number of the issue to update. title (str): The new title for the issue. body (str): The new body content for the issue. labels (list[str], optional): A list of labels to assign to the issue. Defaults to an empty list. state (str, optional): The state of the issue ('open' or 'closed'). Defaults to 'open'. Returns: Dict[str, Any]: The updated issue 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
titleYes
bodyYes
labelsNo
stateNoopen

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the 'update_issue' tool logic. It constructs the GitHub API URL for the specific issue and sends a PATCH request with the new title, body, labels, and state. Handles errors by logging and returning an error dictionary.
    def update_issue(self, repo_owner: str, repo_name: str, issue_number: int, title: str, body: str, labels: list[str] = [], state: Literal['open', 'closed'] = 'open') -> Dict[str, Any]:
        """
        Updates an existing issue in the specified GitHub repository.
        Args:
            repo_owner (str): The owner of the repository.
            repo_name (str): The name of the repository.
            issue_number (int): The number of the issue to update.
            title (str): The new title for the issue.
            body (str): The new body content for the issue.
            labels (list[str], optional): A list of labels to assign to the issue. Defaults to an empty list.
            state (str, optional): The state of the issue ('open' or 'closed'). Defaults to 'open'.
        Returns:
            Dict[str, Any]: The updated issue 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.
        """
        logging.info(f"Updating issue {issue_number} in {repo_owner}/{repo_name}")
    
        # Construct the issue URL
        issue_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/issues/{issue_number}"
    
        try:
            # Update the issue
            response = requests.patch(issue_url, headers=self._get_headers(), json={
                'title': title,
                'body': body,
                'labels': labels,
                'state': state
            }, timeout=TIMEOUT)
            response.raise_for_status()
            issue_data = response.json()
            logging.info("Issue updated successfully")
            return issue_data
        except Exception as e:
            logging.error(f"Error updating issue: {str(e)}")
            traceback.print_exc()
            return {"status": "error", "message": str(e)}
  • The registration mechanism that dynamically registers all public methods of the GitHubIntegration instance (including 'update_issue') as MCP tools by iterating over its members and calling mcp.add_tool().
    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)
  • Calls the register_tools method on the GitHubIntegration instance (self.gi), which triggers the registration of 'update_issue' as an MCP tool.
    def _register_tools(self):
        self.register_tools(self.gi)
        self.register_tools(self.ip)
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral context. It mentions error handling (logs errors) and return values, but doesn't disclose critical traits like authentication requirements, rate limits, whether updates are reversible, or what happens to unspecified fields. For a mutation tool with 7 parameters, this is inadequate.

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?

Well-structured with clear sections (Args, Returns, Error Handling) and no redundant information. The opening sentence efficiently states the purpose. Could be slightly more concise by integrating parameter details more fluidly, but overall efficient.

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 the complexity (7 parameters, mutation operation, no annotations) and presence of output schema (implied by Returns section), the description covers parameters well but lacks crucial behavioral context. It doesn't explain authentication, permissions, or what 'updated issue data' contains, leaving gaps for a mutation tool.

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?

With 0% schema description coverage, the description compensates well by documenting all 7 parameters with clear names, types, optionality, defaults, and brief explanations. It adds meaningful context beyond the bare schema, though could benefit from more detail on label/state behavior.

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 an existing issue') and resource ('in the specified GitHub repository'), distinguishing it from siblings like create_issue (creates new) or update_assignees (different resource). The verb+resource combination is precise and unambiguous.

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 like update_assignees or update_pr_description. The description mentions only what the tool does, not when it's appropriate or what prerequisites exist (e.g., authentication, permissions).

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