create_issue
Create new issues in GitLab projects by specifying project ID, title, description, labels, assignees, and milestones to track development tasks.
Instructions
Create a new issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| title | Yes | Issue title | |
| description | No | Issue description | |
| labels | No | Comma-separated list of labels | |
| assignee_ids | No | Array of user IDs to assign | |
| milestone_id | No | Milestone ID |
Implementation Reference
- src/handlers/issues.ts:48-68 (handler)The main handler function that executes the create_issue tool by constructing the request data and calling the GitLab API to create a new issue in the specified project.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/server.ts:171-174 (registration)Registers the create_issue tool handler by dispatching tool calls in the MCP server's CallToolRequestSchema handler via a switch statement.case "create_issue": return await this.issueHandlers.createIssue( args as unknown as CreateIssueParams );
- src/tools/issues.ts:72-102 (schema)Defines the input schema for the create_issue tool, specifying parameters, types, descriptions, and required fields for validation.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/tools/issues.ts:69-103 (registration)Registers the create_issue tool in the issueTools array, which is used by the MCP server to list available tools.{ 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 the create_issue handler, used for type checking.export interface CreateIssueParams { project_id: string; title: string; description?: string; labels?: string; assignee_ids?: number[]; milestone_id?: number; }