create_issue
Create new issues in GitHub repositories to track bugs, features, or tasks. Specify owner, repo, title, and optional details like body, assignees, labels, or milestone.
Instructions
Create a new issue in a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | ||
| repo | Yes | ||
| title | Yes | ||
| body | No | ||
| assignees | No | ||
| milestone | No | ||
| labels | No |
Implementation Reference
- index.ts:267-274 (handler)MCP tool handler for 'create_issue': parses arguments using CreateIssueSchema, extracts owner/repo/options, calls issues.createIssue, and returns JSON-formatted 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:98-102 (registration)Registration of the 'create_issue' tool in the ListTools response, including name, description, and input schema reference.{ name: "create_issue", description: "Create a new issue in a GitHub repository", inputSchema: zodToJsonSchema(issues.CreateIssueSchema), },
- operations/issues.ts:25-29 (schema)Input schema for create_issue tool: combines owner, repo, and CreateIssueOptionsSchema.export const CreateIssueSchema = z.object({ owner: z.string(), repo: z.string(), ...CreateIssueOptionsSchema.shape, });
- operations/issues.ts:71-83 (helper)Core implementation: makes POST request to GitHub Issues API with provided options.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, } ); }
- operations/issues.ts:17-23 (schema)Supporting schema for issue creation options: title, body, assignees, milestone, labels.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(), });