Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

list_issue_comments

Retrieve all comments from a GitHub issue to track discussions and gather feedback for project management.

Instructions

List all comments on a GitHub issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueNumberYes
perPageNo

Implementation Reference

  • The core handler function that executes the tool logic by calling the GitHub API to list comments for a specific issue.
    async listIssueComments(data: {
      issueNumber: number;
      perPage?: number;
    }): Promise<Array<{ id: number; body: string; user: string; createdAt: string; updatedAt: string }>> {
      try {
        const octokit = this.factory.getOctokit();
        const config = this.factory.getConfig();
    
        const response = await octokit.rest.issues.listComments({
          owner: config.owner,
          repo: config.repo,
          issue_number: data.issueNumber,
          per_page: data.perPage || 100
        });
    
        return response.data.map(comment => ({
          id: comment.id,
          body: comment.body || '',
          user: comment.user?.login || 'unknown',
          createdAt: comment.created_at,
          updatedAt: comment.updated_at
        }));
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Tool definition including name, description, input schema, and usage examples.
    export const listIssueCommentsTool: ToolDefinition<ListIssueCommentsArgs> = {
      name: "list_issue_comments",
      description: "List all comments on a GitHub issue",
      schema: listIssueCommentsSchema as unknown as ToolSchema<ListIssueCommentsArgs>,
      examples: [
        {
          name: "Get all comments",
          description: "Retrieve all comments for an issue",
          args: {
            issueNumber: 42
          }
        },
        {
          name: "Get recent comments",
          description: "Retrieve the 20 most recent comments",
          args: {
            issueNumber: 42,
            perPage: 20
          }
        }
      ]
    };
  • Zod schema for input validation defining required issueNumber and optional perPage.
    export const listIssueCommentsSchema = z.object({
      issueNumber: z.number().int().positive("Issue number must be a positive integer"),
      perPage: z.number().int().positive().max(100).default(100).optional(),
    });
    
    export type ListIssueCommentsArgs = z.infer<typeof listIssueCommentsSchema>;
  • Registration of the listIssueCommentsTool in the central ToolRegistry singleton.
    this.registerTool(listIssueCommentsTool);
  • MCP server request handler that dispatches tool calls to the ProjectManagementService.
    case "list_issue_comments":
      return await this.service.listIssueComments(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