Skip to content

feat: add GitHub notifications tools for managing user notifications #225

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

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

Conversation

sridharavinash
Copy link

@sridharavinash sridharavinash commented Apr 11, 2025

GitHub Notifications Tooling

This PR adds support for managing GitHub notifications

Features Added

New Tools

  • get_notifications: Retrieve a list of notifications for the authenticated GitHub user with filtering options for read/unread status, participation, and time ranges
  • mark_notification_read: Mark a specific notification thread as read
  • mark_notification_done: Mark a specific notification thread as done
  • mark_all_notifications_read: Mark all notifications as read with an optional timestamp
  • get_notification_thread: Fetch details of a specific notification thread

Technical Implementation

  • Implements proper error handling and status code validation
  • Provides RFC3339/ISO8601 timestamp parsing for time-related parameters
  • Integrates with the existing GitHub API client infrastructure
  • Respects read-only mode settings for mutating operations

@sridharavinash sridharavinash marked this pull request as ready for review April 14, 2025 18:16
@Copilot Copilot AI review requested due to automatic review settings April 14, 2025 18:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces new GitHub notifications management tooling to allow users to retrieve notifications, mark them as read (individually or in bulk), and fetch detailed thread information.

  • Added notifications tools to the server initialization in pkg/github/server.go.
  • Implemented functions in pkg/github/notifications.go for handling notification retrieval and state updates with appropriate error handling and time parsing.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/github/server.go Added notifications tools and helper functions for optional params.
pkg/github/notifications.go Implements API integrations for GitHub notifications management.
Comments suppressed due to low confidence (2)

pkg/github/server.go:262

  • The condition unconditionally returns the default value when v is false, which means an explicit false value from the user is ignored. Consider checking for the presence of the parameter instead of evaluating its boolean value directly.
if !v { return d, nil }

pkg/github/notifications.go:130

  • [nitpick] The parameter name 'getclient' is inconsistent with other functions that use 'getClient'. Consider renaming it to 'getClient' for consistency.
func MarkNotificationRead(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {

@sridharavinash sridharavinash requested a review from a team as a code owner April 18, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants