create_issue
Create a new issue in a GitLab project by specifying project ID, title, description, labels, assignees, and milestone to track tasks and bugs.
Instructions
Create a new issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignee_ids | No | Array of user IDs to assign | |
| description | No | Issue description | |
| labels | No | Comma-separated list of labels | |
| milestone_id | No | Milestone ID | |
| project_id | Yes | Project ID or path | |
| title | Yes | Issue title |
Implementation Reference
- src/handlers/issues.ts:48-68 (handler)The main handler function that implements the create_issue tool logic by posting to the GitLab API to create a new issue.async createIssue(args: CreateIssueParams) { const requestData: any = { title: args.title, }; if (args.description) requestData.description = args.description; if (args.labels) requestData.labels = args.labels; if (args.assignee_ids) requestData.assignee_ids = args.assignee_ids; if (args.milestone_id) requestData.milestone_id = args.milestone_id; const data = await this.client.post(`/projects/${encodeURIComponent(args.project_id)}/issues`, requestData); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/issues.ts:69-103 (registration)Tool registration definition including name, description, and input schema for 'create_issue'.{ name: 'create_issue', description: 'Create a new issue', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, title: { type: 'string', description: 'Issue title', }, description: { type: 'string', description: 'Issue description', }, labels: { type: 'string', description: 'Comma-separated list of labels', }, assignee_ids: { type: 'array', items: { type: 'number' }, description: 'Array of user IDs to assign', }, milestone_id: { type: 'number', description: 'Milestone ID', }, }, required: ['project_id', 'title'], }, },
- src/types.ts:231-238 (schema)TypeScript interface defining the parameters for creating an issue, used in handler and tool schema.export interface CreateIssueParams { project_id: string; title: string; description?: string; labels?: string; assignee_ids?: number[]; milestone_id?: number; }
- src/server.ts:171-174 (registration)Dispatch/registration in the main server switch statement that routes 'create_issue' calls to the handler.case "create_issue": return await this.issueHandlers.createIssue( args as unknown as CreateIssueParams );