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

Function CreatePullRequest

pkg/github/pullrequests.go:624–831  ·  view source on GitHub ↗

CreatePullRequest creates a tool to create a new pull request.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

622
623// CreatePullRequest creates a tool to create a new pull request.
624func CreatePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool {
625 return NewTool(
626 ToolsetMetadataPullRequests,
627 mcp.Tool{
628 Name: "create_pull_request",
629 Description: t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository."),
630 Annotations: &mcp.ToolAnnotations{
631 Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"),
632 ReadOnlyHint: false,
633 },
634 Meta: mcp.Meta{
635 "ui": map[string]any{
636 "resourceUri": PullRequestWriteUIResourceURI,
637 "visibility": []string{"model", "app"},
638 },
639 },
640 InputSchema: &jsonschema.Schema{
641 Type: "object",
642 Properties: map[string]*jsonschema.Schema{
643 "owner": {
644 Type: "string",
645 Description: "Repository owner",
646 },
647 "repo": {
648 Type: "string",
649 Description: "Repository name",
650 },
651 "title": {
652 Type: "string",
653 Description: "PR title",
654 },
655 "body": {
656 Type: "string",
657 Description: "PR description",
658 },
659 "head": {
660 Type: "string",
661 Description: "Branch containing changes",
662 },
663 "base": {
664 Type: "string",
665 Description: "Branch to merge into",
666 },
667 "draft": {
668 Type: "boolean",
669 Description: "Create as draft PR",
670 },
671 "maintainer_can_modify": {
672 Type: "boolean",
673 Description: "Allow maintainer edits",
674 },
675 "reviewers": {
676 Type: "array",
677 Description: "GitHub usernames or ORG/team-slug team reviewers to request reviews from",
678 Items: &jsonschema.Schema{
679 Type: "string",
680 },
681 },

Calls 11

NewToolResultErrorFunction · 0.92
NewToolResultTextFunction · 0.92
NewToolFunction · 0.85
shouldDeferToFormFunction · 0.85
OptionalStringArrayParamFunction · 0.85
CloseMethod · 0.80
GetClientMethod · 0.65
ErrorMethod · 0.45