gitlab_update_issue
Modify GitLab issue details including title, description, labels, assignees, and state to keep project tracking current.
Instructions
Updates an existing GitLab issue.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project. | |
| issueIid | Yes | The internal ID of the issue. | |
| updates | Yes | Fields to update. |
Implementation Reference
- src/gitlab.service.ts:678-699 (handler)Core implementation of the gitlab_update_issue tool. This method constructs the update payload and makes the PUT request to the GitLab API to update the specified issue.async updateIssue(projectPath: string, issueIid: number, updates: { title?: string; description?: string; labels?: string[]; assigneeIds?: number[]; state?: 'close' | 'reopen'; }): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); const body: any = {}; if (updates.title) body.title = updates.title; if (updates.description) body.description = updates.description; if (updates.labels) body.labels = updates.labels.join(','); if (updates.assigneeIds) body.assignee_ids = updates.assigneeIds; if (updates.state) body.state_event = updates.state; return this.callGitLabApi<any>( `projects/${encodedProjectPath}/issues/${issueIid}`, 'PUT', body, ); }
- src/index.ts:897-925 (registration)Registers the 'gitlab_update_issue' tool in the MCP server, defining its name, description, and input schema.{ name: 'gitlab_update_issue', description: 'Updates an existing GitLab issue.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project.', }, issueIid: { type: 'number', description: 'The internal ID of the issue.', }, updates: { type: 'object', properties: { title: { type: 'string' }, description: { type: 'string' }, labels: { type: 'array', items: { type: 'string' } }, assigneeIds: { type: 'array', items: { type: 'number' } }, state: { type: 'string', enum: ['close', 'reopen'] }, }, description: 'Fields to update.', }, }, required: ['projectPath', 'issueIid', 'updates'], }, },
- src/index.ts:2008-2032 (handler)MCP tool call handler that extracts parameters from the request and delegates to GitLabService.updateIssue, returning the result.case 'gitlab_update_issue': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, issueIid, updates } = args as { projectPath: string; issueIid: number; updates: { title?: string; description?: string; labels?: string[]; assigneeIds?: number[]; state?: 'close' | 'reopen'; }; }; const result = await gitlabService.updateIssue(projectPath, issueIid, updates); return { content: [ { type: 'text', text: `Issue updated successfully: ${JSON.stringify(result, null, 2)}`, }, ], }; }