delete_comment
Remove a specific comment from a Jira issue by providing the issue key and comment ID.
Instructions
Delete a comment from a Jira issue
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | The issue key containing the comment | |
| commentId | Yes | The ID of the comment to delete |
Implementation Reference
- src/tools/comments.ts:209-220 (handler)The handler case in handleCommentTool that validates args with deleteCommentSchema, calls jiraClient.deleteComment(), and returns a success message with the comment ID.
case 'delete_comment': { const validatedArgs = await deleteCommentSchema.validate(args); const _result = await jiraClient.deleteComment(validatedArgs); return { content: [ { type: 'text', text: `Comment ${validatedArgs.commentId} deleted successfully`, }, ], }; } - src/tools/comments.ts:110-128 (registration)Registration of the 'delete_comment' tool in createCommentTools, with its name, description, and inputSchema (requires issueKey and commentId).
{ name: 'delete_comment', description: 'Delete a comment from a Jira issue', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'The issue key containing the comment', }, commentId: { type: 'string', description: 'The ID of the comment to delete', }, }, required: ['issueKey', 'commentId'], }, }, ]; - src/schemas/index.ts:189-193 (schema)Yup validation schema for delete_comment: requires 'issueKey' and 'commentId' as strings.
// Schema for deleting comment export const deleteCommentSchema = yup.object({ issueKey: yup.string().required('Issue key is required'), commentId: yup.string().required('Comment ID is required'), }); - src/jira-client.ts:404-415 (helper)The JiraClient.deleteComment method that calls the Jira API issueComments.deleteComment() with the issue key and comment ID.
// Delete comment async deleteComment(input: DeleteCommentInput) { try { const response = await this.jira.issueComments.deleteComment({ issueIdOrKey: input.issueKey, id: input.commentId, }); return response; } catch (error) { throw new Error(`Failed to delete comment: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/index.ts:78-84 (registration)Routing in the MCP server: when the tool name starts with 'delete_comment', it dispatches to handleCommentTool.
} else if ( name.startsWith('create_comment') || name.startsWith('get_comments') || name.startsWith('update_comment') || name.startsWith('delete_comment') ) { return await handleCommentTool(name, args || {}, this.jiraClient);