Skip to main content
Glama

gitlab_create_issue

Create new issues in GitLab projects to track bugs, tasks, or feature requests. Specify project path, title, description, labels, and assignees.

Instructions

Creates a new issue in a GitLab project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesThe path of the GitLab project.
titleYesThe title of the issue.
descriptionNoThe description of the issue.
labelsNoLabels to assign to the issue.
assigneeIdsNoUser IDs to assign the issue to.

Implementation Reference

  • Core handler function that executes the GitLab API call to create an issue.
    async createIssue(projectPath: string, title: string, description?: string, labels?: string[], assigneeIds?: number[]): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); const body: any = { title }; if (description) body.description = description; if (labels && labels.length > 0) body.labels = labels.join(','); if (assigneeIds && assigneeIds.length > 0) body.assignee_ids = assigneeIds; return this.callGitLabApi<any>( `projects/${encodedProjectPath}/issues`, 'POST', body, ); }
  • src/index.ts:865-896 (registration)
    Tool registration including name, description, and input schema.
    { name: 'gitlab_create_issue', description: 'Creates a new issue in a GitLab project.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project.', }, title: { type: 'string', description: 'The title of the issue.', }, description: { type: 'string', description: 'The description of the issue.', }, labels: { type: 'array', items: { type: 'string' }, description: 'Labels to assign to the issue.', }, assigneeIds: { type: 'array', items: { type: 'number' }, description: 'User IDs to assign the issue to.', }, }, required: ['projectPath', 'title'], }, },
  • MCP server request handler that processes calls to 'gitlab_create_issue' and delegates to GitLabService.
    case 'gitlab_create_issue': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, title, description, labels, assigneeIds } = args as { projectPath: string; title: string; description?: string; labels?: string[]; assigneeIds?: number[] }; const result = await gitlabService.createIssue(projectPath, title, description, labels, assigneeIds); return { content: [ { type: 'text', text: `Issue created successfully: ${JSON.stringify(result, null, 2)}`, }, ], }; }
  • Type definitions for the createIssue method parameters.
    async createIssue(projectPath: string, title: string, description?: string, labels?: string[], assigneeIds?: number[]): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); const body: any = { title }; if (description) body.description = description; if (labels && labels.length > 0) body.labels = labels.join(','); if (assigneeIds && assigneeIds.length > 0) body.assignee_ids = assigneeIds; return this.callGitLabApi<any>( `projects/${encodedProjectPath}/issues`, 'POST', body, ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HainanZhao/mcp-gitlab-jira'

If you have feedback or need assistance with the MCP directory API, please join our Discord server