Skip to main content
Glama

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 }) }

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