Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

create_issue

Create GitHub issues from PR analysis to track problems and improvements, automatically linking them in pull request descriptions for better project management.

Instructions

Creates a new issue in the specified GitHub repository. If the issue is created successfully, a link to the issue must be appended in the PR's description. Args: repo_owner (str): The owner of the repository. repo_name (str): The name of the repository. title (str): The title of the issue to be created. body (str): The body content of the issue. labels (list[str]): A list of labels to assign to the issue. The label 'mcp' will always be included. Returns: Dict[str, Any]: A dictionary containing the created issue's data if successful. None: If an error occurs during issue creation. Error Handling: Logs errors and prints the traceback if the issue creation fails, returning None.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_ownerYes
repo_nameYes
titleYes
bodyYes
labelsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function implementing the 'create_issue' MCP tool. It uses the GitHub REST API to create a new issue in the specified repository, automatically adding the 'mcp' label, and handles errors gracefully.
    def create_issue(self, repo_owner: str, repo_name: str, title: str, body: str, labels: list[str]) -> Dict[str, Any]:
        """
        Creates a new issue in the specified GitHub repository.
        If the issue is created successfully, a link to the issue must be appended in the PR's description.
        Args:
            repo_owner (str): The owner of the repository.
            repo_name (str): The name of the repository.
            title (str): The title of the issue to be created.
            body (str): The body content of the issue.
            labels (list[str]): A list of labels to assign to the issue. The label 'mcp' will always be included.
        Returns:
            Dict[str, Any]: A dictionary containing the created issue's data if successful.
            None: If an error occurs during issue creation.
        Error Handling:
            Logs errors and prints the traceback if the issue creation fails, returning None.
        """
        logging.info(f"Creating issue in {repo_owner}/{repo_name}")
        
        # Construct the issues URL
        issues_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/issues"
    
        try:
            # Create the issue
            issue_labels = ['mcp'] if not labels else labels + ['mcp']
            response = requests.post(issues_url, headers=self._get_headers(), json={
                'title': title,
                'body': body,
                'labels': issue_labels
            }, timeout=TIMEOUT)
            response.raise_for_status()
            issue_data = response.json()
            
            logging.info("Issue created successfully")
            return issue_data
    
        except Exception as e:
            logging.error(f"Error creating issue: {str(e)}")
            traceback.print_exc()
            return {"status": "error", "message": str(e)}
  • Dynamic registration of all public methods from GitHubIntegration instance (including create_issue) as MCP tools via FastMCP.add_tool().
    def _register_tools(self):
        self.register_tools(self.gi)
        self.register_tools(self.ip)
    
    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)
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 disclosing several behavioral traits: the automatic inclusion of 'mcp' label, the requirement to append issue links to PR descriptions, error logging behavior, and return value patterns (dictionary on success, None on error). It doesn't mention authentication needs, rate limits, or destructive implications, but provides substantial operational context.

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 efficiently structured with clear sections (Args, Returns, Error Handling) and front-loaded purpose statement. Every sentence serves a specific purpose, though the PR description requirement might be better integrated into the main flow rather than as a separate conditional statement.

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 5-parameter mutation tool with no annotations but with output schema, the description provides comprehensive coverage: clear purpose, parameter explanations, return behavior, error handling, and integration requirements. The existence of an output schema means it doesn't need to detail return structure, and it adequately addresses the mutation nature through behavioral disclosure.

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 for 5 parameters, the description compensates well by explaining the purpose of each parameter in the Args section. It clarifies that 'labels' will always include 'mcp', which isn't evident from the schema alone. The description adds meaningful context about what each parameter represents beyond basic titles.

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 ('Creates a new issue') and resource ('in the specified GitHub repository'), distinguishing it from sibling tools like 'create_pr' or 'update_issue'. It provides a complete verb+resource+scope statement that leaves no ambiguity about what this tool does.

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 context through the mention of appending issue links to PR descriptions, suggesting integration with pull request workflows. However, it doesn't explicitly state when to use this tool versus alternatives like 'update_issue' or 'list_open_issues_prs', nor does it provide clear exclusions or prerequisites for usage.

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