Skip to main content
Glama

Create GitHub Issue

create_github_issue

Create GitHub issues with structured templates, summaries, technical notes, and labels automatically generated from code changes.

Instructions

Cria uma issue no GitHub usando Octokit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneesNo
bodyNo
labelsNo
ownerNo
repoNo
titleYes

Implementation Reference

  • The asynchronous handler function that creates a GitHub issue using the Octokit client. It takes owner, repo, title, body, labels, and assignees as input, posts to the GitHub API, and returns the issue URL.
    async ({ owner, repo, title, body, labels, assignees }) => {
      const octokit = getOctokit()
      const res = await octokit.request('POST /repos/{owner}/{repo}/issues', {
        owner,
        repo,
        title,
        body,
        labels,
        assignees,
      })
    
      const url = res.data.html_url
      return {
        content: [{ type: 'text', text: `Issue criada: #${url}` }],
      }
    }
  • Zod input schema for the create_github_issue tool, defining parameters like owner, repo, title, body, labels, and assignees with defaults from environment variables.
    inputSchema: {
      owner: z.string().default(process.env.DEFAULT_OWNER || ''),
      repo: z.string().default(process.env.DEFAULT_REPO || ''),
      title: z.string(),
      body: z.string().default(''),
      labels: z.array(z.string()).default([]),
      assignees: z
        .array(z.string())
        .default(
          process.env.DEFAULT_ASSIGNEE ? [process.env.DEFAULT_ASSIGNEE] : []
        ),
    },
  • src/index.ts:101-135 (registration)
    Registration of the 'create_github_issue' tool with the MCP server, including title, description, input schema, and the handler function.
    server.registerTool(
      'create_github_issue',
      {
        title: 'Create GitHub Issue',
        description: 'Cria uma issue no GitHub usando Octokit',
        inputSchema: {
          owner: z.string().default(process.env.DEFAULT_OWNER || ''),
          repo: z.string().default(process.env.DEFAULT_REPO || ''),
          title: z.string(),
          body: z.string().default(''),
          labels: z.array(z.string()).default([]),
          assignees: z
            .array(z.string())
            .default(
              process.env.DEFAULT_ASSIGNEE ? [process.env.DEFAULT_ASSIGNEE] : []
            ),
        },
      },
      async ({ owner, repo, title, body, labels, assignees }) => {
        const octokit = getOctokit()
        const res = await octokit.request('POST /repos/{owner}/{repo}/issues', {
          owner,
          repo,
          title,
          body,
          labels,
          assignees,
        })
    
        const url = res.data.html_url
        return {
          content: [{ type: 'text', text: `Issue criada: #${url}` }],
        }
      }
    )
  • Helper function that initializes and returns an authenticated Octokit instance using the GITHUB_TOKEN from environment variables.
    export function getOctokit() {
      const token = env('GITHUB_TOKEN')
    
      if (!token) {
        throw new Error('Missing GITHUB_TOKEN env')
      }
    
      return new Octokit({ auth: token })
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool creates an issue (implying a write/mutation operation) but doesn't mention authentication requirements, rate limits, error conditions, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single sentence that directly states the tool's function. It's appropriately brief and front-loaded with the core purpose. While it could be more informative, it doesn't waste words or include unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 6 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain parameter meanings, behavioral expectations, or return values. The agent would struggle to use this tool correctly without additional context or trial-and-error.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 6 parameters (5 with defaults, 1 required), the description provides no information about any parameters. It doesn't explain what 'owner', 'repo', 'title', 'body', 'labels', or 'assignees' mean or how they should be formatted. The description fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('Cria uma issue no GitHub') which translates to 'Creates an issue on GitHub', providing a clear verb+resource. However, it doesn't differentiate from the sibling tool 'git_diff' or specify what makes this tool unique. The mention of 'usando Octokit' adds implementation detail but doesn't enhance functional distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, when-not-to-use scenarios, or comparison with the sibling tool 'git_diff'. The agent must infer usage from the tool name alone.

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/gustavodetoni/mcp-issue'

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