Skip to main content
Glama

create_issue

Create new GitHub issues directly by specifying repository, title, and optional body content to track tasks, bugs, or feature requests.

Instructions

Create a new GitHub issue.

Args:
    owner: The GitHub organization or user name
    repo: The repository name
    title: The issue title
    body: The issue body (optional)

Returns:
    A formatted string with the created issue details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYes
repoYes
titleYes
bodyNo

Implementation Reference

  • MCP tool handler decorated with @mcp.tool(). Calls GitHubClient.create_issue and formats the response.
    @mcp.tool()
    async def create_issue(owner: str, repo: str, title: str, body: str = "") -> str:
        """Create a new GitHub issue.
    
        Args:
            owner: The GitHub organization or user name
            repo: The repository name
            title: The issue title
            body: The issue body (optional)
    
        Returns:
            A formatted string with the created issue details
        """
        try:
            issue = await github_client.create_issue(owner, repo, title, body)
            return (
                f"Issue created successfully!\n\n"
                f"Repository: {owner}/{repo}\n"
                f"Issue Number: #{issue['number']}\n"
                f"Title: {issue['title']}\n"
                f"URL: {issue['url']}\n"
            )
        except GitHubClientError as e:
            logger.error(f"Error creating issue in {owner}/{repo}: {e}")
            return f"Error: Could not create issue in {owner}/{repo}. Details: {e}"
  • Helper function in GitHubClient that performs the GraphQL mutation to create the issue after fetching repository ID.
    async def create_issue(
        self, owner: str, repo: str, title: str, body: str = ""
    ) -> Dict[str, Any]:
        """Create a new GitHub issue.
    
        Args:
            owner: The GitHub organization or user name
            repo: The repository name
            title: The issue title
            body: The issue body (optional)
    
        Returns:
            The created issue data
    
        Raises:
            GitHubClientError: If repository is not found or issue creation fails.
        """
        query = """
        mutation CreateIssue($repositoryId: ID!, $title: String!, $body: String) {
          createIssue(input: {
            repositoryId: $repositoryId,
            title: $title,
            body: $body
          }) {
            issue {
              id
              number
              title
              url
              state
            }
          }
        }
        """
    
        # First get the repository ID
        repo_query = """
        query GetRepositoryId($owner: String!, $name: String!) {
          repository(owner: $owner, name: $name) {
            id
          }
        }
        """
    
        repo_variables = {"owner": owner, "name": repo}
    
        try:
            repo_result = await self.execute_query(repo_query, repo_variables)
            if not repo_result.get("repository"):
                raise GitHubClientError(f"Repository {owner}/{repo} not found")
        except GitHubClientError as e:
            logger.error(f"Failed to get repository ID for {owner}/{repo}: {e}")
            raise
    
        repository_id = repo_result["repository"]["id"]
    
        variables = {"repositoryId": repository_id, "title": title, "body": body}
    
        try:
            result = await self.execute_query(query, variables)
            if not result.get("createIssue") or not result["createIssue"].get("issue"):
                raise GitHubClientError(f"Failed to create issue in {owner}/{repo}")
            return result["createIssue"]["issue"]
        except GitHubClientError as e:
            logger.error(f"Failed to create issue in {owner}/{repo}: {e}")
            raise
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool creates an issue (implying a write/mutation operation) and mentions the return format, but doesn't disclose critical behavioral traits like required permissions (e.g., write access to repo), whether the operation is idempotent, rate limits, error conditions, or what happens on duplicate titles. For a mutation tool with zero annotation coverage, this is a significant gap.

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 (purpose, args, returns) and uses bullet points for readability. It's appropriately sized for a 4-parameter tool, though the 'Args' and 'Returns' labels are slightly redundant given the schema. Every sentence adds value, with no wasted words.

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 tool's complexity (mutation with 4 params), lack of annotations, and no output schema, the description is moderately complete. It covers purpose and parameters well but lacks behavioral context (permissions, errors, side effects) and detailed return value explanation beyond 'formatted string'. For a GitHub API tool, more context about authentication or API constraints would be helpful.

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 provides clear semantic meaning for all 4 parameters: 'owner' as organization/user name, 'repo' as repository name, 'title' as issue title, and 'body' as optional issue body. This adds substantial value beyond the bare schema, though it doesn't specify format constraints (e.g., character limits) or examples.

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 ('Create a new GitHub issue') and identifies the resource (GitHub issue). It distinguishes from siblings like 'create_draft_issue' by specifying it creates a regular issue, not a draft, and from 'add_issue_to_project' by focusing on creation rather than project association.

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 creating GitHub issues, but doesn't explicitly state when to use this vs. alternatives like 'create_draft_issue' or 'add_issue_to_project'. It provides basic context (GitHub platform) but lacks explicit guidance on prerequisites, exclusions, or comparative scenarios with sibling tools.

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/Arclio/github-projects-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server