delete_issue_comment
Remove a comment from a GitHub issue by specifying its comment ID. This tool helps manage GitHub project discussions by deleting outdated or incorrect comments.
Instructions
Delete a comment from a GitHub issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commentId | Yes |
Implementation Reference
- The core handler function that executes the delete_issue_comment tool by calling the GitHub Issues API to delete the specified comment using Octokit.async deleteIssueComment(data: { commentId: number; }): Promise<{ success: boolean; message: string }> { try { const octokit = this.factory.getOctokit(); const config = this.factory.getConfig(); await octokit.rest.issues.deleteComment({ owner: config.owner, repo: config.repo, comment_id: data.commentId }); return { success: true, message: `Comment ${data.commentId} deleted successfully` }; } catch (error) { throw this.mapErrorToMCPError(error); }
- Zod schema defining the input parameters for the delete_issue_comment tool: requires a positive integer commentId.// Schema for delete_issue_comment tool export const deleteIssueCommentSchema = z.object({ commentId: z.number().int().positive("Comment ID must be a positive integer"), }); export type DeleteIssueCommentArgs = z.infer<typeof deleteIssueCommentSchema>;
- ToolDefinition object for delete_issue_comment, including name, description, input schema reference, and usage examples.export const deleteIssueCommentTool: ToolDefinition<DeleteIssueCommentArgs> = { name: "delete_issue_comment", description: "Delete a comment from a GitHub issue", schema: deleteIssueCommentSchema as unknown as ToolSchema<DeleteIssueCommentArgs>, examples: [ { name: "Remove outdated comment", description: "Delete a comment that is no longer relevant", args: { commentId: 123456 } } ] };
- src/infrastructure/tools/ToolRegistry.ts:213-217 (registration)Registration of deleteIssueCommentTool (along with related comment tools) in the central ToolRegistry during initialization.// Register issue comment tools this.registerTool(createIssueCommentTool); this.registerTool(updateIssueCommentTool); this.registerTool(deleteIssueCommentTool); this.registerTool(listIssueCommentsTool);
- src/index.ts:326-327 (handler)Top-level MCP tool dispatcher that routes 'delete_issue_comment' calls to the ProjectManagementService handler.case "delete_issue_comment": return await this.service.deleteIssueComment(args);