Content-Length: 5763 | pFad | http://github.com/github/github-mcp-server/pull/658.patch

thub.com From 82addb7e44ae13bc656d8613a4d290db5eac7e21 Mon Sep 17 00:00:00 2001 From: tommaso-moro Date: Thu, 10 Jul 2025 17:16:09 +0100 Subject: [PATCH 1/4] adjust tool description --- pkg/github/pullrequests.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index bad822b13..9fc96da04 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -330,7 +330,7 @@ func UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFu // ListPullRequests creates a tool to list and filter repository pull requests. func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) { return mcp.NewTool("list_pull_requests", - mcp.WithDescription(t("TOOL_LIST_PULL_REQUESTS_DESCRIPTION", "List pull requests in a GitHub repository.")), + mcp.WithDescription(t("TOOL_LIST_PULL_REQUESTS_DESCRIPTION", "List pull requests in a GitHub repository. If the user specifies an author, then DO NOT use this tool, use the search_pull_requests tool instead.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_PULL_REQUESTS_USER_TITLE", "List pull requests"), ReadOnlyHint: ToBoolPtr(true), @@ -361,6 +361,10 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun mcp.Description("Sort direction"), mcp.Enum("asc", "desc"), ), + mcp.WithString("author", + mcp.Description("Filter by author username."), + ), + WithPagination(), ), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -392,11 +396,13 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun if err != nil { return mcp.NewToolResultError(err.Error()), nil } + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } pagination, err := OptionalPaginationParams(request) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - opts := &github.PullRequestListOptions{ State: state, Head: head, From b8de02abd4f5bede32df21c3c454551390e187d4 Mon Sep 17 00:00:00 2001 From: tommaso-moro Date: Thu, 10 Jul 2025 17:25:59 +0100 Subject: [PATCH 2/4] removed dead code --- pkg/github/pullrequests.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index 9fc96da04..a4970b353 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -361,10 +361,6 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun mcp.Description("Sort direction"), mcp.Enum("asc", "desc"), ), - mcp.WithString("author", - mcp.Description("Filter by author username."), - ), - WithPagination(), ), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -396,9 +392,6 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun if err != nil { return mcp.NewToolResultError(err.Error()), nil } - if err != nil { - return mcp.NewToolResultError(err.Error()), nil - } pagination, err := OptionalPaginationParams(request) if err != nil { return mcp.NewToolResultError(err.Error()), nil From 202c5b3d5b6d9e2adf920801f14762cfb5f8061a Mon Sep 17 00:00:00 2001 From: tommaso-moro Date: Thu, 10 Jul 2025 17:28:04 +0100 Subject: [PATCH 3/4] improve desription --- pkg/github/pullrequests.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index a4970b353..32c7e850c 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -330,7 +330,7 @@ func UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFu // ListPullRequests creates a tool to list and filter repository pull requests. func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) { return mcp.NewTool("list_pull_requests", - mcp.WithDescription(t("TOOL_LIST_PULL_REQUESTS_DESCRIPTION", "List pull requests in a GitHub repository. If the user specifies an author, then DO NOT use this tool, use the search_pull_requests tool instead.")), + mcp.WithDescription(t("TOOL_LIST_PULL_REQUESTS_DESCRIPTION", "List pull requests in a GitHub repository. If the user specifies an author, then DO NOT use this tool and use the search_pull_requests tool instead.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_PULL_REQUESTS_USER_TITLE", "List pull requests"), ReadOnlyHint: ToBoolPtr(true), From 5ed6b069b640d0d0826e8de1ba5a346c1f43d7ad Mon Sep 17 00:00:00 2001 From: tommaso-moro Date: Thu, 10 Jul 2025 17:59:53 +0100 Subject: [PATCH 4/4] update description for tests --- pkg/github/__toolsnaps__/list_pull_requests.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/github/__toolsnaps__/list_pull_requests.snap b/pkg/github/__toolsnaps__/list_pull_requests.snap index b8369784d..fee7e2ff1 100644 --- a/pkg/github/__toolsnaps__/list_pull_requests.snap +++ b/pkg/github/__toolsnaps__/list_pull_requests.snap @@ -3,7 +3,7 @@ "title": "List pull requests", "readOnlyHint": true }, - "description": "List pull requests in a GitHub repository.", + "description": "List pull requests in a GitHub repository. If the user specifies an author, then DO NOT use this tool and use the search_pull_requests tool instead.", "inputSchema": { "properties": { "base": {








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/github-mcp-server/pull/658.patch

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy