create_issue
Create and manage GitHub repository issues by specifying an owner, repository, title, description, assignees, milestones, and labels directly through the server.
Instructions
Create a new issue in a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignees | No | ||
| body | No | ||
| labels | No | ||
| milestone | No | ||
| owner | Yes | ||
| repo | Yes | ||
| title | Yes |
Implementation Reference
- operations/issues.ts:79-91 (handler)Core handler function that executes the GitHub API POST request to create a new issue in the repository.export async function createIssue( owner: string, repo: string, options: z.infer<typeof CreateIssueOptionsSchema> ) { return githubRequest( `https://api.github.com/repos/${owner}/${repo}/issues`, { method: "POST", body: options, } ); }
- index.ts:400-407 (handler)MCP CallTool handler case that parses input schema, extracts parameters, calls the core createIssue function, and formats the response.case "create_issue": { const args = issues.CreateIssueSchema.parse(request.params.arguments); const { owner, repo, ...options } = args; const issue = await issues.createIssue(owner, repo, options); return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }], }; }
- index.ts:96-99 (registration)Tool registration in the ListToolsRequestHandler response array, defining name, description, and input JSON schema.name: "create_issue", description: "Create a new issue in a GitHub repository", inputSchema: zodToJsonSchema(issues.CreateIssueSchema), },
- operations/issues.ts:26-30 (schema)Composite Zod schema for the full create_issue input, including owner, repo, and options.export const CreateIssueSchema = z.object({ owner: z.string(), repo: z.string(), ...CreateIssueOptionsSchema.shape, });
- operations/issues.ts:18-24 (schema)Zod schema defining the options for creating an issue (title, body, assignees, etc.). Used in CreateIssueSchema.export const CreateIssueOptionsSchema = z.object({ title: z.string(), body: z.string().optional(), assignees: z.array(z.string()).optional(), milestone: z.number().optional(), labels: z.array(z.string()).optional(), });