Documentation
¶
Index ¶
- Constants
- Variables
- func AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func AddPullRequestReviewCommentToPendingReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func AssignCopilotToIssue(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func CreateAndSubmitPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func CreateBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func CreateOrUpdateFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func CreateRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func DeleteFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func DeletePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func DismissNotification(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func EnableToolset(s *server.MCPServer, toolsetGroup *toolsets.ToolsetGroup, ...) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ForkRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetCodeScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetCommit(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetFileContents(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetIssueComments(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetNotificationDetails(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetPullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func GetPullRequestComments(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func GetPullRequestDiff(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func GetPullRequestFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func GetPullRequestReviews(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func GetPullRequestStatus(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func GetRepositoryResourceBranchContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
- func GetRepositoryResourceCommitContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
- func GetRepositoryResourceContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
- func GetRepositoryResourcePrContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
- func GetRepositoryResourceTagContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
- func GetSecretScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetTag(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetToolsetsTools(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func InitContextToolset(getClient GetClientFn, t translations.TranslationHelperFunc) *toolsets.Toolset
- func InitDynamicToolset(s *server.MCPServer, tsg *toolsets.ToolsetGroup, ...) *toolsets.Toolset
- func InitToolsets(passedToolsets []string, readOnly bool, getClient GetClientFn, ...) (*toolsets.ToolsetGroup, error)
- func ListAvailableToolsets(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListBranches(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListNotifications(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func ListSecretScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListTags(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ManageNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ManageRepositoryNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func MarkAllNotificationsRead(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func NewServer(version string, opts ...server.ServerOption) *server.MCPServer
- func OptionalIntParam(r mcp.CallToolRequest, p string) (int, error)
- func OptionalIntParamWithDefault(r mcp.CallToolRequest, p string, d int) (int, error)
- func OptionalParam[T any](r mcp.CallToolRequest, p string) (T, error)
- func OptionalParamOK[T any](r mcp.CallToolRequest, p string) (value T, ok bool, err error)
- func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error)
- func PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func RegisterResources(s *server.MCPServer, getClient GetClientFn, ...)
- func RepositoryResourceContentsHandler(getClient GetClientFn) ...
- func RequestCopilotReview(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func RequiredInt(r mcp.CallToolRequest, p string) (int, error)
- func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func SearchRepositories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func SubmitPendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func ToolsetEnum(toolsetGroup *toolsets.ToolsetGroup) mcp.PropertyOption
- func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func UpdatePullRequestBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
- func WithPagination() mcp.ToolOption
- type GetClientFn
- type GetGQLClientFn
- type PaginationParams
- type ReplaceActorsForAssignableInput
Constants ¶
const ( FilterDefault = "default" FilterIncludeRead = "include_read_notifications" FilterOnlyParticipating = "only_participating" )
const ( NotificationActionIgnore = "ignore" NotificationActionWatch = "watch" NotificationActionDelete = "delete" )
Enum values for ManageNotificationSubscription action
const ( RepositorySubscriptionActionWatch = "watch" RepositorySubscriptionActionIgnore = "ignore" RepositorySubscriptionActionDelete = "delete" )
Variables ¶
var DefaultTools = []string{"all"}
Functions ¶
func AddIssueComment ¶
func AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
AddIssueComment creates a tool to add a comment to an issue.
func AddPullRequestReviewCommentToPendingReview ¶
func AddPullRequestReviewCommentToPendingReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
AddPullRequestReviewCommentToPendingReview creates a tool to add a comment to a pull request review.
func AssignCopilotToIssue ¶
func AssignCopilotToIssue(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
func CreateAndSubmitPullRequestReview ¶
func CreateAndSubmitPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
func CreateBranch ¶
func CreateBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
CreateBranch creates a tool to create a new branch.
func CreateIssue ¶
func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
CreateIssue creates a tool to create a new issue in a GitHub repository.
func CreateOrUpdateFile ¶
func CreateOrUpdateFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
CreateOrUpdateFile creates a tool to create or update a file in a GitHub repository.
func CreatePendingPullRequestReview ¶
func CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
CreatePendingPullRequestReview creates a tool to create a pending review on a pull request.
func CreatePullRequest ¶
func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
CreatePullRequest creates a tool to create a new pull request.
func CreateRepository ¶
func CreateRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
CreateRepository creates a tool to create a new GitHub repository.
func DeleteFile ¶
func DeleteFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
DeleteFile creates a tool to delete a file in a GitHub repository. This tool uses a more roundabout way of deleting a file than just using the client.Repositories.DeleteFile. This is because REST file deletion endpoint (and client.Repositories.DeleteFile) don't add commit signing to the deletion commit, unlike how the endpoint backing the create_or_update_files tool does. This appears to be a quirk of the API. The approach implemented here gets automatic commit signing when used with either the github-actions user or as an app, both of which suit an LLM well.
func DeletePendingPullRequestReview ¶
func DeletePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
func DismissNotification ¶
func DismissNotification(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
DismissNotification creates a tool to mark a notification as read/done.
func EnableToolset ¶
func EnableToolset(s *server.MCPServer, toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func ForkRepository ¶
func ForkRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ForkRepository creates a tool to fork a repository.
func GetCodeScanningAlert ¶
func GetCodeScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func GetCommit ¶
func GetCommit(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func GetFileContents ¶
func GetFileContents(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetFileContents creates a tool to get the contents of a file or directory from a GitHub repository.
func GetIssue ¶
func GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetIssue creates a tool to get details of a specific issue in a GitHub repository.
func GetIssueComments ¶
func GetIssueComments(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetIssueComments creates a tool to get comments for a GitHub issue.
func GetMe ¶
func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetMe creates a tool to get details of the authenticated user.
func GetNotificationDetails ¶
func GetNotificationDetails(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetNotificationDetails creates a tool to get details for a specific notification.
func GetPullRequest ¶
func GetPullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
GetPullRequest creates a tool to get details of a specific pull request.
func GetPullRequestComments ¶
func GetPullRequestComments(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
GetPullRequestComments creates a tool to get the review comments on a pull request.
func GetPullRequestDiff ¶
func GetPullRequestDiff(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
func GetPullRequestFiles ¶
func GetPullRequestFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
GetPullRequestFiles creates a tool to get the list of files changed in a pull request.
func GetPullRequestReviews ¶
func GetPullRequestReviews(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
GetPullRequestReviews creates a tool to get the reviews on a pull request.
func GetPullRequestStatus ¶
func GetPullRequestStatus(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
GetPullRequestStatus creates a tool to get the combined status of all status checks for a pull request.
func GetRepositoryResourceBranchContent ¶
func GetRepositoryResourceBranchContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
GetRepositoryResourceBranchContent defines the resource template and handler for getting repository content for a branch.
func GetRepositoryResourceCommitContent ¶
func GetRepositoryResourceCommitContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
GetRepositoryResourceCommitContent defines the resource template and handler for getting repository content for a commit.
func GetRepositoryResourceContent ¶
func GetRepositoryResourceContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
GetRepositoryResourceContent defines the resource template and handler for getting repository content.
func GetRepositoryResourcePrContent ¶
func GetRepositoryResourcePrContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
GetRepositoryResourcePrContent defines the resource template and handler for getting repository content for a pull request.
func GetRepositoryResourceTagContent ¶
func GetRepositoryResourceTagContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)
GetRepositoryResourceTagContent defines the resource template and handler for getting repository content for a tag.
func GetSecretScanningAlert ¶
func GetSecretScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func GetTag ¶
func GetTag(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetTag creates a tool to get details about a specific tag in a GitHub repository.
func GetToolsetsTools ¶
func GetToolsetsTools(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func InitContextToolset ¶
func InitContextToolset(getClient GetClientFn, t translations.TranslationHelperFunc) *toolsets.Toolset
func InitDynamicToolset ¶
func InitDynamicToolset(s *server.MCPServer, tsg *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) *toolsets.Toolset
InitDynamicToolset creates a dynamic toolset that can be used to enable other toolsets, and so requires the server and toolset group as arguments
func InitToolsets ¶
func InitToolsets(passedToolsets []string, readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (*toolsets.ToolsetGroup, error)
func ListAvailableToolsets ¶
func ListAvailableToolsets(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func ListBranches ¶
func ListBranches(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListBranches creates a tool to list branches in a GitHub repository.
func ListCodeScanningAlerts ¶
func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func ListCommits ¶
func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListCommits creates a tool to get commits of a branch in a repository.
func ListIssues ¶
func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListIssues creates a tool to list and filter repository issues
func ListNotifications ¶
func ListNotifications(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListNotifications creates a tool to list notifications for the current user.
func ListPullRequests ¶
func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
ListPullRequests creates a tool to list and filter repository pull requests.
func ListSecretScanningAlerts ¶
func ListSecretScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
func ListTags ¶
func ListTags(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListTags creates a tool to list tags in a GitHub repository.
func ManageNotificationSubscription ¶
func ManageNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ManageNotificationSubscription creates a tool to manage a notification subscription (ignore, watch, delete)
func ManageRepositoryNotificationSubscription ¶
func ManageRepositoryNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
ManageRepositoryNotificationSubscription creates a tool to manage a repository notification subscription (ignore, watch, delete)
func MarkAllNotificationsRead ¶
func MarkAllNotificationsRead(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
MarkAllNotificationsRead creates a tool to mark all notifications as read.
func MergePullRequest ¶
func MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
MergePullRequest creates a tool to merge a pull request.
func OptionalIntParam ¶
func OptionalIntParam(r mcp.CallToolRequest, p string) (int, error)
OptionalIntParam is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request, if not, it returns its zero-value 2. If it is present, it checks if the parameter is of the expected type and returns it
func OptionalIntParamWithDefault ¶
OptionalIntParamWithDefault is a helper function that can be used to fetch a requested parameter from the request similar to optionalIntParam, but it also takes a default value.
func OptionalParam ¶
func OptionalParam[T any](r mcp.CallToolRequest, p string) (T, error)
OptionalParam is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request, if not, it returns its zero-value 2. If it is present, it checks if the parameter is of the expected type and returns it
func OptionalParamOK ¶
OptionalParamOK is a helper function that can be used to fetch a requested parameter from the request. It returns the value, a boolean indicating if the parameter was present, and an error if the type is wrong.
func OptionalStringArrayParam ¶
func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error)
OptionalStringArrayParam is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request, if not, it returns its zero-value 2. If it is present, iterates the elements and checks each is a string
func PushFiles ¶
func PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
PushFiles creates a tool to push multiple files in a single commit to a GitHub repository.
func RegisterResources ¶
func RegisterResources(s *server.MCPServer, getClient GetClientFn, t translations.TranslationHelperFunc)
func RepositoryResourceContentsHandler ¶
func RepositoryResourceContentsHandler(getClient GetClientFn) func(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)
RepositoryResourceContentsHandler returns a handler function for repository content requests.
func RequestCopilotReview ¶
func RequestCopilotReview(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
RequestCopilotReview creates a tool to request a Copilot review for a pull request. Note that this tool will not work on GHES where this feature is unsupported. In future, we should not expose this tool if the configured host does not support it.
func RequiredInt ¶
func RequiredInt(r mcp.CallToolRequest, p string) (int, error)
RequiredInt is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request. 2. Checks if the parameter is of the expected type. 3. Checks if the parameter is not empty, i.e: non-zero value
func SearchCode ¶
func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
SearchCode creates a tool to search for code across GitHub repositories.
func SearchIssues ¶
func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
SearchIssues creates a tool to search for issues and pull requests.
func SearchRepositories ¶
func SearchRepositories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
SearchRepositories creates a tool to search for GitHub repositories.
func SearchUsers ¶
func SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
SearchUsers creates a tool to search for GitHub users.
func SubmitPendingPullRequestReview ¶
func SubmitPendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
SubmitPendingPullRequestReview creates a tool to submit a pull request review.
func ToolsetEnum ¶
func ToolsetEnum(toolsetGroup *toolsets.ToolsetGroup) mcp.PropertyOption
func UpdateIssue ¶
func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)
UpdateIssue creates a tool to update an existing issue in a GitHub repository.
func UpdatePullRequest ¶
func UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
UpdatePullRequest creates a tool to update an existing pull request.
func UpdatePullRequestBranch ¶
func UpdatePullRequestBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)
UpdatePullRequestBranch creates a tool to update a pull request branch with the latest changes from the base branch.
func WithPagination ¶
func WithPagination() mcp.ToolOption
WithPagination returns a ToolOption that adds "page" and "perPage" parameters to the tool. The "page" parameter is optional, min 1. The "perPage" parameter is optional, min 1, max 100.
Types ¶
type PaginationParams ¶
type PaginationParams struct {
// contains filtered or unexported fields
}
func OptionalPaginationParams ¶
func OptionalPaginationParams(r mcp.CallToolRequest) (PaginationParams, error)
OptionalPaginationParams returns the "page" and "perPage" parameters from the request, or their default values if not present, "page" default is 1, "perPage" default is 30. In future, we may want to make the default values configurable, or even have this function returned from `withPagination`, where the defaults are provided alongside the min/max values.