MCPcopy
hub / github.com/github/github-mcp-server / UpdatePullRequest

Function UpdatePullRequest

pkg/github/pullrequests.go:834–1148  ·  view source on GitHub ↗

UpdatePullRequest creates a tool to update an existing pull request.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

832
833// UpdatePullRequest creates a tool to update an existing pull request.
834func UpdatePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool {
835 schema := &jsonschema.Schema{
836 Type: "object",
837 Properties: map[string]*jsonschema.Schema{
838 "owner": {
839 Type: "string",
840 Description: "Repository owner",
841 },
842 "repo": {
843 Type: "string",
844 Description: "Repository name",
845 },
846 "pullNumber": {
847 Type: "number",
848 Description: "Pull request number to update",
849 },
850 "title": {
851 Type: "string",
852 Description: "New title",
853 },
854 "body": {
855 Type: "string",
856 Description: "New description",
857 },
858 "state": {
859 Type: "string",
860 Description: "New state",
861 Enum: []any{"open", "closed"},
862 },
863 "draft": {
864 Type: "boolean",
865 Description: "Mark pull request as draft (true) or ready for review (false)",
866 },
867 "base": {
868 Type: "string",
869 Description: "New base branch name",
870 },
871 "maintainer_can_modify": {
872 Type: "boolean",
873 Description: "Allow maintainer edits",
874 },
875 "reviewers": {
876 Type: "array",
877 Description: "GitHub usernames or ORG/team-slug team reviewers to request reviews from",
878 Items: &jsonschema.Schema{
879 Type: "string",
880 },
881 },
882 },
883 Required: []string{"owner", "repo", "pullNumber"},
884 }
885
886 st := NewTool(
887 ToolsetMetadataPullRequests,
888 mcp.Tool{
889 Name: "update_pull_request",
890 Description: t("TOOL_UPDATE_PULL_REQUEST_DESCRIPTION", "Update an existing pull request in a GitHub repository."),
891 Annotations: &mcp.ToolAnnotations{

Callers 4

AllToolsFunction · 0.85
Test_UpdatePullRequestFunction · 0.85

Calls 14

NewToolResultErrorFunction · 0.92
NewToolResultTextFunction · 0.92
NewToolFunction · 0.85
RequiredIntFunction · 0.85
shouldDeferToFormFunction · 0.85
OptionalStringArrayParamFunction · 0.85
CloseMethod · 0.80
GetClientMethod · 0.65
GetGQLClientMethod · 0.65