Skip to content

Add support for org-level discussions in list_discussions tool #775

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

Merged
merged 5 commits into from
Jul 29, 2025

Conversation

tommaso-moro
Copy link
Contributor

@tommaso-moro tommaso-moro commented Jul 28, 2025

Overview

This PR adds support for org-level discussions to the list_discussions, thus closing issue #671

For the sake of not bloating the MCP with too many (similar) tools, I made the design decision to update the existing list_discussions tool to add support for org-level discussions: if a repo is provided, the repo-level discussions are queried, otherwise the org-level discussions are.

Changes

  • The repo parameter is made optional. When it is not passed, repo will be set to .github which will query discussions at the organisation level. (This is because organization discussions appear to be stored in a special .github repository within the organization).
  • The tool descriptions are updated to accommodate for the above change
  • The tests are updated to test for the scenario where the tool is used to query org-level discussions

Screenshots
Screenshot 2025-07-28 at 16 44 41
Screenshot 2025-07-28 at 16 45 02
Screenshot 2025-07-28 at 16 47 09
Screenshot 2025-07-28 at 18 15 54
Screenshot 2025-07-28 at 18 16 18

@tommaso-moro tommaso-moro marked this pull request as ready for review July 29, 2025 11:00
@Copilot Copilot AI review requested due to automatic review settings July 29, 2025 11:00
@tommaso-moro tommaso-moro requested a review from a team as a code owner July 29, 2025 11:00
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 adds support for organization-level discussions to the existing list_discussions tool by making the repo parameter optional and defaulting to .github when not provided.

  • Made the repo parameter optional in the list_discussions tool
  • Updated tool descriptions to reflect support for both repository and organization-level discussions
  • Added comprehensive test coverage for organization-level discussion scenarios

Reviewed Changes

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

File Description
pkg/github/discussions.go Made repo parameter optional and added logic to default to .github for org-level discussions
pkg/github/discussions_test.go Added test data and test case for organization-level discussions
README.md Updated documentation to reflect the optional nature of the repo parameter

@tommaso-moro tommaso-moro marked this pull request as draft July 29, 2025 11:01
Copy link
Contributor

@LuluBeatson LuluBeatson left a comment

Choose a reason for hiding this comment

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

Nice one! Good to add this functionality to the existing list_discussions tool.

Example
List discussions in the modelcontextprotocol org. Get the last 5 sorted by updated time
image

@tommaso-moro tommaso-moro merged commit 89e3afd into github:main Jul 29, 2025
10 checks passed
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