create_issue
Create new issues in GitLab projects to track bugs, tasks, or feature requests with titles, descriptions, assignees, labels, and milestones.
Instructions
Create a new issue in a GitLab project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or URL-encoded path | |
| title | Yes | Issue title | |
| description | No | Issue description | |
| assignee_ids | No | Array of user IDs to assign | |
| labels | No | Array of label names | |
| milestone_id | No | Milestone ID to assign |
Implementation Reference
- src/api/issues.ts:79-98 (handler)The implementation of the 'createIssue' function, which handles sending the POST request to the GitLab API to create an issue.
export async function createIssue(projectId: string, options: CreateIssueOptions): Promise<GitLabIssue> { if (!projectId?.trim()) { throw new Error("Project ID is required"); } if (!options?.title?.trim()) { throw new Error("Issue title is required"); } const endpoint = `/projects/${encodeProjectId(projectId)}/issues`; const issue = await gitlabPost<GitLabIssue>(endpoint, { title: options.title, description: options.description, assignee_ids: options.assignee_ids, milestone_id: options.milestone_id, labels: options.labels?.join(",") }); return GitLabIssueSchema.parse(issue); } - src/schemas.ts:263-271 (schema)The schema definition for the 'create_issue' tool's input arguments.
export const CreateIssueSchema = ProjectParamsSchema.extend({ title: z.string().describe("Issue title"), description: z.string().optional().describe("Issue description"), assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign"), labels: z.array(z.string()).optional().describe("Array of label names"), milestone_id: z.number().optional().describe("Milestone ID to assign") }); export const CreateMergeRequestSchema = ProjectParamsSchema.extend({ - src/server.ts:89-97 (registration)Tool registration for 'create_issue' in the server implementation.
{ name: "create_issue", description: "Create a new issue in a GitLab project", inputSchema: zodToJsonSchema(CreateIssueSchema) }, { name: "create_merge_request", description: "Create a new merge request in a GitLab project", inputSchema: zodToJsonSchema(CreateMergeRequestSchema)