Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tommy/(Bug-fix): adjust tool description to account for author in prompt#658

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

tommaso-moro
Copy link
Contributor

@tommaso-morotommaso-moro commentedJul 10, 2025
edited
Loading

Overview

This PR fixes a buggy behaviour which occurs when the user uses the Github MCP to query PRs by author (e.g. by asking "show me my last 10 PRs in repo xyz") and the MCP uses thelist_pull_requests tool, which does not support author-specific queries due to constraints in the Github API (see official APIdocs).

To fix this issue, this PR changes thelist_pull_requests tool description to ensure that thesearch_pull_requests tool is selected when the user requests PRs by author.

Testing

This solution seems to work as expected across all models. The only caveat is that o4-mini sometimes doesn't seem to always use theget_me tool to get the user information before using thesearch_pull_requests tool (it does sometimes, as shown in the last screenshot). This behaviour should be investigated further but I don't believe it's specific to this PR.

Demo - Claude 4
Screenshot 2025-07-10 at 17 14 46

Demo - ChatGTP 4.1
Screenshot 2025-07-10 at 17 42 09

Demo - ChatGPT 4.0
Screenshot 2025-07-10 at 17 43 03

Demo - ChatGPT o4-mini (without get-me)
Screenshot 2025-07-10 at 17 54 01

Demo - ChatGPT o4-mini (with get-me)
Screenshot 2025-07-10 at 17 42 38

@tommaso-morotommaso-moro marked this pull request as ready for reviewJuly 10, 2025 17:05
@CopilotCopilotAI review requested due to automatic review settingsJuly 10, 2025 17:05
@tommaso-morotommaso-moro requested a review froma team as acode ownerJuly 10, 2025 17:05
Copy link
Contributor

@CopilotCopilotAI 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 fixes a bug where thelist_pull_requests tool was being selected for author-specific queries, despite not supporting author filtering due to GitHub API constraints. The fix updates the tool description to explicitly direct models to usesearch_pull_requests instead when an author is specified.

Key Changes:

  • Updated tool description to include explicit guidance against using this tool for author-specific queries
  • Removed an unnecessary blank line for code cleanliness
  • Updated corresponding test snapshot to reflect the description change

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
pkg/github/pullrequests.goUpdated tool description to redirect author queries to search_pull_requests tool
pkg/github/toolsnaps/list_pull_requests.snapUpdated test snapshot to match new tool description

Copy link
Contributor

@LuluBeatsonLuluBeatson 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!

Copilot is even able to skipget_me and useauthor:@me in the search query!

Screenshot
List my last 5 PRs in github/github-mcp-server
image

@tommaso-morotommaso-moro merged commit42e5ce9 intogithub:mainJul 11, 2025
10 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@LuluBeatsonLuluBeatsonLuluBeatson approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@tommaso-moro@LuluBeatson

[8]ページ先頭

©2009-2025 Movatter.jp