Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:(github) get_issue_comment #557

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

monkeydaichan
Copy link
Contributor

GitHub Server: Add Get Issue Comment Feature

Description

Implemented a new feature to retrieve GitHub Issue Comments. This feature enables fetching individual comments from issues and pull requests using unique comment IDs.

Server Details

  • Server: github
  • Changes to: tools (New tool addition)

Motivation and Context

  • There was a need for functionality to individually retrieve comments from GitHub Issues and Pull Requests
  • Direct comment retrieval using comment IDs enables more granular operations
  • Contributes to automation of issue management and workflow improvements

How Has This Been Tested?

  • Tested against actual GitHub repositories with following scenarios:
    • Retrieving existing comments
    • Error handling with invalid comment IDs
    • Comment retrieval across different repositories

Breaking Changes

  • No breaking changes as this is a new feature addition that doesn't affect existing functionality
  • No changes required to user MCP configurations

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

Implementation Details

  1. Added New Schema (operations/issues.ts)

    • GetIssueCommentSchema - Defines parameters required for comment retrieval
    • Includes required fields: owner, repo, comment_id
  2. New Function Implementation

    • Added getIssueComment function to handle GitHub API communication
    • Endpoint: GET /repos/{owner}/{repo}/issues/comments/{comment_id}
  3. Main Server Integration

    • Added tool definition and handler
    • Implemented appropriate error handling

args.repo,
args.comment_id
);
return { toolResult: comment };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not following the mcp schema https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json#L80

it should be something like

        return {
          content: [{ type: "text", text: JSON.stringify(comment, null, 2) }],
        };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants