create_issue
Create new GitHub issues to track tasks, bugs, or features with assignees, labels, and descriptions for project management.
Instructions
Create a new GitHub issue
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| description | Yes | ||
| milestoneId | No | ||
| assignees | Yes | ||
| labels | Yes | ||
| priority | No | ||
| type | No |
Input Schema (JSON Schema)
{
"properties": {
"assignees": {
"type": "string"
},
"description": {
"type": "string"
},
"labels": {
"type": "string"
},
"milestoneId": {
"type": "string"
},
"priority": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"title",
"description",
"assignees",
"labels"
],
"type": "object"
}
Implementation Reference
- Core handler function that executes the create_issue tool logic: processes args, generates labels from priority/type, creates CreateIssue object, and calls GitHubIssueRepository.create to make the API call.async createIssue(data: { title: string; description: string; milestoneId?: string; assignees?: string[]; labels?: string[]; priority?: string; type?: string; }): Promise<Issue> { try { // Create labels based on priority and type if provided const labels = data.labels || []; if (data.priority) { labels.push(`priority:${data.priority}`); } if (data.type) { labels.push(`type:${data.type}`); } const issueData: CreateIssue = { title: data.title, description: data.description, assignees: data.assignees || [], labels, milestoneId: data.milestoneId, }; return await this.issueRepo.create(issueData); } catch (error) { throw this.mapErrorToMCPError(error); } }
- Zod schema definition for validating input arguments to the create_issue tool, including title, description, milestone, assignees, labels, priority, and type.// Schema for create_issue tool export const createIssueSchema = z.object({ title: z.string().min(1, "Issue title is required"), description: z.string().min(1, "Issue description is required"), milestoneId: z.string().optional(), assignees: z.array(z.string()).default([]), labels: z.array(z.string()).default([]), priority: z.enum(["high", "medium", "low"]).default("medium").optional(), type: z.enum(["bug", "feature", "enhancement", "documentation"]).default("feature").optional(), }); export type CreateIssueArgs = z.infer<typeof createIssueSchema>;
- src/infrastructure/tools/ToolRegistry.ts:154-158 (registration)Registers the createIssueTool (imported from ToolSchemas) in the central ToolRegistry singleton.// Register issue tools this.registerTool(createIssueTool); this.registerTool(listIssuesTool); this.registerTool(getIssueTool); this.registerTool(updateIssueTool);
- src/index.ts:275-276 (handler)MCP tool dispatch handler in executeToolHandler switch statement that routes create_issue calls to ProjectManagementService.createIssue.case "create_issue": return await this.service.createIssue(args);
- ToolDefinition object for create_issue, including name, description, schema reference, and usage examples.export const createIssueTool: ToolDefinition<CreateIssueArgs> = { name: "create_issue", description: "Create a new GitHub issue", schema: createIssueSchema as unknown as ToolSchema<CreateIssueArgs>, examples: [ { name: "Create bug issue", description: "Create a bug issue with high priority", args: { title: "Fix authentication bug", description: "Users cannot log in with social media accounts", priority: "high", type: "bug", assignees: ["developer1"], labels: ["bug", "authentication"] } } ] };