MCPcopy Index your code
hub / github.com/github/github-mcp-server / GranularResolveReviewThread

Function GranularResolveReviewThread

pkg/github/pullrequests_granular.go:674–715  ·  view source on GitHub ↗

GranularResolveReviewThread creates a tool to resolve a review thread.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

672
673// GranularResolveReviewThread creates a tool to resolve a review thread.
674func GranularResolveReviewThread(t translations.TranslationHelperFunc) inventory.ServerTool {
675 st := NewTool(
676 ToolsetMetadataPullRequests,
677 mcp.Tool{
678 Name: "resolve_review_thread",
679 Description: t("TOOL_RESOLVE_REVIEW_THREAD_DESCRIPTION", "Resolve a review thread on a pull request. Resolving an already-resolved thread is a no-op."),
680 Annotations: &mcp.ToolAnnotations{
681 Title: t("TOOL_RESOLVE_REVIEW_THREAD_USER_TITLE", "Resolve Review Thread"),
682 ReadOnlyHint: false,
683 DestructiveHint: jsonschema.Ptr(false),
684 OpenWorldHint: jsonschema.Ptr(true),
685 },
686 InputSchema: &jsonschema.Schema{
687 Type: "object",
688 Properties: map[string]*jsonschema.Schema{
689 "threadID": {
690 Type: "string",
691 Description: "The node ID of the review thread to resolve (e.g., PRRT_kwDOxxx)",
692 },
693 },
694 Required: []string{"threadID"},
695 },
696 },
697 []scopes.Scope{scopes.Repo},
698 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
699 threadID, err := RequiredParam[string](args, "threadID")
700 if err != nil {
701 return utils.NewToolResultError(err.Error()), nil, nil
702 }
703
704 gqlClient, err := deps.GetGQLClient(ctx)
705 if err != nil {
706 return utils.NewToolResultErrorFromErr("failed to get GitHub GraphQL client", err), nil, nil
707 }
708
709 result, err := ResolveReviewThread(ctx, gqlClient, threadID, true)
710 return result, nil, err
711 },
712 )
713 st.FeatureFlagEnable = FeatureFlagPullRequestsGranular
714 return st
715}
716
717// GranularUnresolveReviewThread creates a tool to unresolve a review thread.
718func GranularUnresolveReviewThread(t translations.TranslationHelperFunc) inventory.ServerTool {

Callers 2

AllToolsFunction · 0.85

Calls 6

NewToolResultErrorFunction · 0.92
NewToolFunction · 0.85
ResolveReviewThreadFunction · 0.85
GetGQLClientMethod · 0.65
ErrorMethod · 0.45

Tested by 1