Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

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
NameRequiredDescriptionDefault
commentIdYes

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
          }
        }
      ]
    };
  • 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);
  • 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);
Install Server

Other Tools

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/kunwarVivek/mcp-github-project-manager'

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