gitlab_add_comment_to_issue
Add comments to GitLab issues to provide updates, ask questions, or share information directly through the MCP server for GitLab and Jira integration.
Instructions
Adds a comment to a 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. | |
| body | Yes | The comment text. |
Implementation Reference
- src/index.ts:2050-2064 (handler)MCP tool handler for gitlab_add_comment_to_issue: extracts arguments, calls GitLabService.addCommentToIssue, and returns success response.case 'gitlab_add_comment_to_issue': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, issueIid, body } = args as { projectPath: string; issueIid: number; body: string }; const result = await gitlabService.addCommentToIssue(projectPath, issueIid, body); return { content: [ { type: 'text', text: `Comment added successfully: ${JSON.stringify(result, null, 2)}`, }, ], }; }
- src/index.ts:944-964 (schema)Tool schema definition and registration in allTools array, including input schema for projectPath, issueIid, and body.{ name: 'gitlab_add_comment_to_issue', description: 'Adds a comment to a 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.', }, body: { type: 'string', description: 'The comment text.', }, }, required: ['projectPath', 'issueIid', 'body'], },
- src/gitlab.service.ts:707-714 (helper)Core implementation in GitLabService: calls GitLab API to POST a note (comment) to the specified issue.async addCommentToIssue(projectPath: string, issueIid: number, body: string): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); return this.callGitLabApi<any>( `projects/${encodedProjectPath}/issues/${issueIid}/notes`, 'POST', { body }, ); }