Documentation
¶
Overview ¶
deprecated_tool_aliases.go
Index ¶
- Constants
- Variables
- func ActionsGet(t translations.TranslationHelperFunc) inventory.ServerTool
- func ActionsGetJobLogs(t translations.TranslationHelperFunc) inventory.ServerTool
- func ActionsList(t translations.TranslationHelperFunc) inventory.ServerTool
- func ActionsRunTrigger(t translations.TranslationHelperFunc) inventory.ServerTool
- func AddCommentToPendingReview(t translations.TranslationHelperFunc) inventory.ServerTool
- func AddDefaultToolset(result []string) []string
- func AddIssueComment(t translations.TranslationHelperFunc) inventory.ServerTool
- func AddReplyToPullRequestComment(t translations.TranslationHelperFunc) inventory.ServerTool
- func AddSubIssue(ctx context.Context, client *github.Client, owner string, repo string, ...) (*mcp.CallToolResult, error)
- func AllPrompts(t translations.TranslationHelperFunc) []inventory.ServerPrompt
- func AllResources(t translations.TranslationHelperFunc) []inventory.ServerResourceTemplate
- func AllTools(t translations.TranslationHelperFunc) []inventory.ServerTool
- func AssignCodingAgentPrompt(t translations.TranslationHelperFunc) inventory.ServerPrompt
- func AssignCopilotToIssue(t translations.TranslationHelperFunc) inventory.ServerTool
- func CleanTools(toolNames []string) []string
- func CompletionsHandler(getClient GetClientFn) ...
- func ContainsToolset(tools []string, toCheck string) bool
- func ContextWithDeps(ctx context.Context, deps ToolDependencies) context.Context
- func ContextWithPollConfig(ctx context.Context, config PollConfig) context.Context
- func CreateBranch(t translations.TranslationHelperFunc) inventory.ServerTool
- func CreateGist(t translations.TranslationHelperFunc) inventory.ServerTool
- func CreateIssue(ctx context.Context, client *github.Client, owner string, repo string, ...) (*mcp.CallToolResult, error)
- func CreateOrUpdateFile(t translations.TranslationHelperFunc) inventory.ServerTool
- func CreatePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
- func CreatePullRequestReview(ctx context.Context, client *githubv4.Client, ...) (*mcp.CallToolResult, error)
- func CreateRepository(t translations.TranslationHelperFunc) inventory.ServerTool
- func CreateToolScopeFilter(tokenScopes []string) inventory.ToolFilter
- func DeleteFile(t translations.TranslationHelperFunc) inventory.ServerTool
- func DeletePendingPullRequestReview(ctx context.Context, client *githubv4.Client, ...) (*mcp.CallToolResult, error)
- func DismissNotification(t translations.TranslationHelperFunc) inventory.ServerTool
- func DynamicTools(r *inventory.Inventory) []inventory.ServerTool
- func EnableToolset(r *inventory.Inventory) inventory.ServerTool
- func ForkRepository(t translations.TranslationHelperFunc) inventory.ServerTool
- func GenerateToolsetsHelp() string
- func GetCodeScanningAlert(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetCommit(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetDefaultToolsetIDs() []string
- func GetDependabotAlert(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetDiscussion(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetDiscussionComments(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetFileContents(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetGist(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetGlobalSecurityAdvisory(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetIssue(ctx context.Context, client *github.Client, deps ToolDependencies, ...) (*mcp.CallToolResult, error)
- func GetIssueComments(ctx context.Context, client *github.Client, deps ToolDependencies, ...) (*mcp.CallToolResult, error)
- func GetIssueLabels(ctx context.Context, client *githubv4.Client, owner string, repo string, ...) (*mcp.CallToolResult, error)
- func GetLabel(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetLabelForLabelsToolset(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetLatestRelease(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetMe(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetNotificationDetails(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetPullRequest(ctx context.Context, client *github.Client, deps ToolDependencies, ...) (*mcp.CallToolResult, error)
- func GetPullRequestDiff(ctx context.Context, client *github.Client, owner, repo string, pullNumber int) (*mcp.CallToolResult, error)
- func GetPullRequestFiles(ctx context.Context, client *github.Client, owner, repo string, pullNumber int, ...) (*mcp.CallToolResult, error)
- func GetPullRequestReviewComments(ctx context.Context, gqlClient *githubv4.Client, deps ToolDependencies, ...) (*mcp.CallToolResult, error)
- func GetPullRequestReviews(ctx context.Context, client *github.Client, deps ToolDependencies, ...) (*mcp.CallToolResult, error)
- func GetPullRequestStatus(ctx context.Context, client *github.Client, owner, repo string, pullNumber int) (*mcp.CallToolResult, error)
- func GetReleaseByTag(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetRepositoryResourceBranchContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
- func GetRepositoryResourceCommitContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
- func GetRepositoryResourceContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
- func GetRepositoryResourcePrContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
- func GetRepositoryResourceTagContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
- func GetRepositoryTree(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetSecretScanningAlert(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetSubIssues(ctx context.Context, client *github.Client, deps ToolDependencies, ...) (*mcp.CallToolResult, error)
- func GetTag(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetTeamMembers(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetTeams(t translations.TranslationHelperFunc) inventory.ServerTool
- func GetToolsetsTools(r *inventory.Inventory) inventory.ServerTool
- func GetUIAsset(name string) (string, error)
- func InjectDepsMiddleware(deps ToolDependencies) mcp.Middleware
- func InjectGitDepsMiddleware(deps ToolDependencies) mcp.Middleware
- func IssueCommentWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func IssueRead(t translations.TranslationHelperFunc) inventory.ServerTool
- func IssueToFixWorkflowPrompt(t translations.TranslationHelperFunc) inventory.ServerPrompt
- func IssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func LabelWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListAvailableToolsets() inventory.ServerTool
- func ListBranches(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListCodeScanningAlerts(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListCommits(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListDependabotAlerts(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListDiscussionCategories(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListDiscussions(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListGists(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListGlobalSecurityAdvisories(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListIssueTypes(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListIssues(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListLabels(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListNotifications(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListOrgRepositorySecurityAdvisories(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListPullRequests(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListReleases(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListRepositorySecurityAdvisories(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListSecretScanningAlerts(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListStarredRepositories(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListTags(t translations.TranslationHelperFunc) inventory.ServerTool
- func ManageNotificationSubscription(t translations.TranslationHelperFunc) inventory.ServerTool
- func ManageRepositoryNotificationSubscription(t translations.TranslationHelperFunc) inventory.ServerTool
- func MarkAllNotificationsRead(t translations.TranslationHelperFunc) inventory.ServerTool
- func MarshalledTextResult(v any) *mcp.CallToolResult
- func MergePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
- func MustGetUIAsset(name string) string
- func NewDynamicTool(toolset inventory.ToolsetMetadata, tool mcp.Tool, ...) inventory.ServerTool
- func NewInventory(t translations.TranslationHelperFunc) *inventory.Builder
- func NewMCPServer(ctx context.Context, cfg *MCPServerConfig, deps ToolDependencies, ...) (*mcp.Server, error)
- func NewServer(version string, opts *mcp.ServerOptions) *mcp.Server
- func NewTool[In, Out any](toolset inventory.ToolsetMetadata, tool mcp.Tool, ...) inventory.ServerTool
- func NewToolFromHandler(toolset inventory.ToolsetMetadata, tool mcp.Tool, ...) inventory.ServerTool
- func OptionalBigIntArrayParam(args map[string]any, p string) ([]int64, error)
- func OptionalBoolParamWithDefault(args map[string]any, p string, d bool) (bool, error)
- func OptionalIntParam(args map[string]any, p string) (int, error)
- func OptionalIntParamWithDefault(args map[string]any, p string, d int) (int, error)
- func OptionalParam[T any](args map[string]any, p string) (T, error)
- func OptionalParamOK[T any, A map[string]any](args A, p string) (value T, ok bool, err error)
- func OptionalStringArrayParam(args map[string]any, p string) ([]string, error)
- func ProjectsGet(t translations.TranslationHelperFunc) inventory.ServerTool
- func ProjectsList(t translations.TranslationHelperFunc) inventory.ServerTool
- func ProjectsWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func PullRequestCommentWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func PullRequestRead(t translations.TranslationHelperFunc) inventory.ServerTool
- func PullRequestReviewWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func PushFiles(t translations.TranslationHelperFunc) inventory.ServerTool
- func RegisterUIResources(s *mcp.Server)
- func RemoteOnlyToolsets() []inventory.ToolsetMetadata
- func RemoveSubIssue(ctx context.Context, client *github.Client, owner string, repo string, ...) (*mcp.CallToolResult, error)
- func RemoveToolset(tools []string, toRemove string) []string
- func RepositoryResourceCompletionHandler(getClient GetClientFn) ...
- func RepositoryResourceContentsHandler(resourceURITemplate *uritemplate.Template) mcp.ResourceHandler
- func ReprioritizeSubIssue(ctx context.Context, client *github.Client, owner string, repo string, ...) (*mcp.CallToolResult, error)
- func RequestCopilotReview(t translations.TranslationHelperFunc) inventory.ServerTool
- func RequiredBigInt(args map[string]any, p string) (int64, error)
- func RequiredInt(args map[string]any, p string) (int, error)
- func RequiredParam[T comparable](args map[string]any, p string) (T, error)
- func ResolvedEnabledToolsets(dynamicToolsets bool, enabledToolsets []string, enabledTools []string) []string
- func SearchCode(t translations.TranslationHelperFunc) inventory.ServerTool
- func SearchIssues(t translations.TranslationHelperFunc) inventory.ServerTool
- func SearchOrgs(t translations.TranslationHelperFunc) inventory.ServerTool
- func SearchPullRequests(t translations.TranslationHelperFunc) inventory.ServerTool
- func SearchRepositories(t translations.TranslationHelperFunc) inventory.ServerTool
- func SearchUsers(t translations.TranslationHelperFunc) inventory.ServerTool
- func StarRepository(t translations.TranslationHelperFunc) inventory.ServerTool
- func SubIssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool
- func SubmitPendingPullRequestReview(ctx context.Context, client *githubv4.Client, ...) (*mcp.CallToolResult, error)
- func ToBoolPtr(b bool) *bool
- func ToStringPtr(s string) *string
- func UIAssetsAvailable() bool
- func UnstarRepository(t translations.TranslationHelperFunc) inventory.ServerTool
- func UpdateGist(t translations.TranslationHelperFunc) inventory.ServerTool
- func UpdateIssue(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (*mcp.CallToolResult, error)
- func UpdatePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
- func UpdatePullRequestBranch(t translations.TranslationHelperFunc) inventory.ServerTool
- func WithCursorPagination(schema *jsonschema.Schema) *jsonschema.Schema
- func WithPagination(schema *jsonschema.Schema) *jsonschema.Schema
- func WithUnifiedPagination(schema *jsonschema.Schema) *jsonschema.Schema
- type AgentAssignmentInput
- type BaseDeps
- func (d BaseDeps) GetClient(_ context.Context) (*gogithub.Client, error)
- func (d BaseDeps) GetContentWindowSize() int
- func (d BaseDeps) GetFlags(_ context.Context) FeatureFlags
- func (d BaseDeps) GetGQLClient(_ context.Context) (*githubv4.Client, error)
- func (d BaseDeps) GetGitOps() gitops.GitOperations
- func (d BaseDeps) GetRawClient(_ context.Context) (*raw.Client, error)
- func (d BaseDeps) GetRepoAccessCache(_ context.Context) (*lockdown.RepoAccessCache, error)
- func (d BaseDeps) GetRepoPaths() []string
- func (d BaseDeps) GetT() translations.TranslationHelperFunc
- func (d BaseDeps) IsFeatureEnabled(ctx context.Context, flagName string) bool
- type BasicNoOrder
- type BasicWithOrder
- type CloseIssueInput
- type CompleteHandler
- type CreateProjectV2StatusUpdateInput
- type CursorPaginationParams
- type DiscussionFragment
- type DiscussionQueryResult
- type DynamicToolDependencies
- type FeatureFlags
- type GetClientFn
- type GetGQLClientFn
- type GraphQLPaginationParams
- type IssueClosedStateReason
- type IssueFragment
- type IssueQueryFragment
- type IssueQueryResult
- type ListIssuesQuery
- type ListIssuesQueryTypeWithLabels
- type ListIssuesQueryTypeWithLabelsWithSince
- type ListIssuesQueryWithSince
- type MCPServerConfig
- type MCPServerOption
- type MinimalBranch
- type MinimalCommit
- type MinimalCommitAuthor
- type MinimalCommitFile
- type MinimalCommitInfo
- type MinimalCommitStats
- type MinimalFileCommit
- type MinimalFileContent
- type MinimalFileContentResponse
- type MinimalIssue
- type MinimalIssueComment
- type MinimalPRBranch
- type MinimalPRBranchRepo
- type MinimalProject
- type MinimalProjectStatusUpdate
- type MinimalPullRequest
- type MinimalReactions
- type MinimalRelease
- type MinimalRepository
- type MinimalResponse
- type MinimalSearchRepositoriesResult
- type MinimalSearchUsersResult
- type MinimalUser
- type NodeFragment
- type OrganizationTeams
- type PageInfoFragment
- type PaginationParams
- type PollConfig
- type PullRequestReviewWriteParams
- type ReplaceActorsForAssignableInput
- type RequestDeps
- func (d *RequestDeps) GetClient(ctx context.Context) (*gogithub.Client, error)
- func (d *RequestDeps) GetContentWindowSize() int
- func (d *RequestDeps) GetFlags(ctx context.Context) FeatureFlags
- func (d *RequestDeps) GetGQLClient(ctx context.Context) (*githubv4.Client, error)
- func (d *RequestDeps) GetGitOps() gitops.GitOperations
- func (d *RequestDeps) GetRawClient(ctx context.Context) (*raw.Client, error)
- func (d *RequestDeps) GetRepoAccessCache(ctx context.Context) (*lockdown.RepoAccessCache, error)
- func (d *RequestDeps) GetRepoPaths() []string
- func (d *RequestDeps) GetT() translations.TranslationHelperFunc
- func (d *RequestDeps) IsFeatureEnabled(ctx context.Context, flagName string) bool
- type TeamInfo
- type ToolDependencies
- type TreeEntryResponse
- type TreeResponse
- type UpdateIssueInput
- type UserDetails
- type WithCategoryAndOrder
- type WithCategoryNoOrder
Constants ¶
const ( DescriptionRepositoryOwner = "Repository owner" DescriptionRepositoryName = "Repository name" )
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" )
const ( ProjectUpdateFailedError = "failed to update a project item" ProjectAddFailedError = "failed to add a project item" ProjectDeleteFailedError = "failed to delete a project item" ProjectListFailedError = "failed to list project items" ProjectStatusUpdateListFailedError = "failed to list project status updates" ProjectStatusUpdateGetFailedError = "failed to get project status update" ProjectStatusUpdateCreateFailedError = "failed to create project status update" ProjectResolveIDFailedError = "failed to resolve project ID" MaxProjectsPerPage = 50 )
const DefaultGraphQLPageSize = 30
const GetMeUIResourceURI = "ui://omnigit-mcp/get-me"
GetMeUIResourceURI is the URI for the get_me tool's MCP App UI resource.
const IssueWriteUIResourceURI = "ui://omnigit-mcp/issue-write"
IssueWrite creates a tool to create a new or update an existing issue in a GitHub repository. IssueWriteUIResourceURI is the URI for the issue_write tool's MCP App UI resource.
const PullRequestWriteUIResourceURI = "ui://omnigit-mcp/pr-write"
PullRequestWriteUIResourceURI is the URI for the create_pull_request tool's MCP App UI resource.
Variables ¶
var ( ToolsetMetadataAll = inventory.ToolsetMetadata{ ID: "all", Description: "Special toolset that enables all available toolsets", Icon: "apps", } ToolsetMetadataDefault = inventory.ToolsetMetadata{ ID: "default", Description: "Special toolset that enables the default toolset configuration. When no toolsets are specified, this is the set that is enabled", Icon: "check-circle", } ToolsetMetadataContext = inventory.ToolsetMetadata{ ID: "context", Description: "Tools that provide context about the current user and GitHub context you are operating in", Default: true, Icon: "person", InstructionsFunc: generateContextToolsetInstructions, } ToolsetMetadataRepos = inventory.ToolsetMetadata{ ID: "repos", Description: "GitHub Repository related tools", Default: true, Icon: "repo", } ToolsetMetadataGit = inventory.ToolsetMetadata{ ID: "git", Description: "GitHub Git API related tools for low-level Git operations", Icon: "git-branch", } ToolsetMetadataIssues = inventory.ToolsetMetadata{ ID: "issues", Description: "GitHub Issues related tools", Default: true, Icon: "issue-opened", InstructionsFunc: generateIssuesToolsetInstructions, } ToolsetMetadataPullRequests = inventory.ToolsetMetadata{ ID: "pull_requests", Description: "GitHub Pull Request related tools", Default: true, Icon: "git-pull-request", InstructionsFunc: generatePullRequestsToolsetInstructions, } ToolsetMetadataUsers = inventory.ToolsetMetadata{ ID: "users", Description: "GitHub User related tools", Default: true, Icon: "people", } ToolsetMetadataOrgs = inventory.ToolsetMetadata{ ID: "orgs", Description: "GitHub Organization related tools", Icon: "organization", } ToolsetMetadataActions = inventory.ToolsetMetadata{ ID: "actions", Description: "GitHub Actions workflows and CI/CD operations", Icon: "workflow", } ToolsetMetadataCodeSecurity = inventory.ToolsetMetadata{ ID: "code_security", Description: "Code security related tools, such as GitHub Code Scanning", Icon: "codescan", } ToolsetMetadataSecretProtection = inventory.ToolsetMetadata{ ID: "secret_protection", Description: "Secret protection related tools, such as GitHub Secret Scanning", Icon: "shield-lock", } ToolsetMetadataDependabot = inventory.ToolsetMetadata{ ID: "dependabot", Description: "Dependabot tools", Icon: "dependabot", } ToolsetMetadataNotifications = inventory.ToolsetMetadata{ ID: "notifications", Description: "GitHub Notifications related tools", Icon: "bell", } ToolsetMetadataDiscussions = inventory.ToolsetMetadata{ ID: "discussions", Description: "GitHub Discussions related tools", Icon: "comment-discussion", InstructionsFunc: generateDiscussionsToolsetInstructions, } ToolsetMetadataGists = inventory.ToolsetMetadata{ ID: "gists", Description: "GitHub Gist related tools", Icon: "logo-gist", } ToolsetMetadataSecurityAdvisories = inventory.ToolsetMetadata{ ID: "security_advisories", Description: "Security advisories related tools", Icon: "shield", } ToolsetMetadataProjects = inventory.ToolsetMetadata{ ID: "projects", Description: "GitHub Projects related tools", Icon: "project", InstructionsFunc: generateProjectsToolsetInstructions, } ToolsetMetadataStargazers = inventory.ToolsetMetadata{ ID: "stargazers", Description: "GitHub Stargazers related tools", Icon: "star", } ToolsetMetadataDynamic = inventory.ToolsetMetadata{ ID: "dynamic", Description: "Discover GitHub MCP tools that can help achieve tasks by enabling additional sets of tools, you can control the enablement of any toolset to access its tools when this toolset is enabled.", Icon: "tools", } ToolsetLabels = inventory.ToolsetMetadata{ ID: "labels", Description: "GitHub Labels related tools", Icon: "tag", } // Remote-only toolsets - these are only available in the remote MCP server // but are documented here for consistency and to enable automated documentation. ToolsetMetadataCopilot = inventory.ToolsetMetadata{ ID: "copilot", Description: "Copilot related tools", Icon: "copilot", } ToolsetMetadataCopilotSpaces = inventory.ToolsetMetadata{ ID: "copilot_spaces", Description: "Copilot Spaces tools", Icon: "copilot", } ToolsetMetadataSupportSearch = inventory.ToolsetMetadata{ ID: "github_support_docs_search", Description: "Retrieve documentation to answer GitHub product and support questions. Topics include: GitHub Actions Workflows, Authentication, ...", Icon: "book", } )
Toolset metadata constants - these define all available toolsets and their descriptions. Tools use these constants to declare which toolset they belong to. Icons are Octicon names from https://primer.style/foundations/icons
var DeprecatedToolAliases = map[string]string{
"list_workflows": "actions_list",
"list_workflow_runs": "actions_list",
"list_workflow_jobs": "actions_list",
"list_workflow_run_artifacts": "actions_list",
"get_workflow": "actions_get",
"get_workflow_run": "actions_get",
"get_workflow_job": "actions_get",
"get_workflow_run_usage": "actions_get",
"get_workflow_run_logs": "actions_get",
"get_workflow_job_logs": "actions_get",
"download_workflow_run_artifact": "actions_get",
"run_workflow": "actions_run_trigger",
"rerun_workflow_run": "actions_run_trigger",
"rerun_failed_jobs": "actions_run_trigger",
"cancel_workflow_run": "actions_run_trigger",
"delete_workflow_run_logs": "actions_run_trigger",
"list_projects": "projects_list",
"list_project_fields": "projects_list",
"list_project_items": "projects_list",
"get_project": "projects_get",
"get_project_field": "projects_get",
"get_project_item": "projects_get",
"add_project_item": "projects_write",
"update_project_item": "projects_write",
"delete_project_item": "projects_write",
}
DeprecatedToolAliases maps old tool names to their new canonical names. When tools are renamed, add an entry here to maintain backward compatibility. Users referencing the old name will receive the new tool with a deprecation warning.
Example:
"get_issue": "issue_read", "create_pr": "pull_request_create",
var ErrDepsNotInContext = errors.New("ToolDependencies not found in context; use ContextWithDeps to inject")
ErrDepsNotInContext is returned when ToolDependencies is not found in context.
var RepositoryResourceArgumentResolvers = map[string]CompleteHandler{
"owner": completeOwner,
"repo": completeRepo,
"branch": completeBranch,
"sha": completeSHA,
"tag": completeTag,
"prNumber": completePRNumber,
"path": completePath,
}
RepositoryResourceArgumentResolvers is a map of argument names to their completion handlers
var UIAssets embed.FS
UIAssets embeds the built MCP App UI HTML files. These files are generated by running `script/build-ui` which compiles the React/Primer components in the ui/ directory.
Functions ¶
func ActionsGet ¶
func ActionsGet(t translations.TranslationHelperFunc) inventory.ServerTool
ActionsGet returns the tool and handler for getting GitHub Actions resources.
func ActionsGetJobLogs ¶
func ActionsGetJobLogs(t translations.TranslationHelperFunc) inventory.ServerTool
ActionsGetJobLogs returns the tool and handler for getting workflow job logs.
func ActionsList ¶
func ActionsList(t translations.TranslationHelperFunc) inventory.ServerTool
ActionsList returns the tool and handler for listing GitHub Actions resources.
func ActionsRunTrigger ¶
func ActionsRunTrigger(t translations.TranslationHelperFunc) inventory.ServerTool
ActionsRunTrigger returns the tool and handler for triggering GitHub Actions workflows.
func AddCommentToPendingReview ¶
func AddCommentToPendingReview(t translations.TranslationHelperFunc) inventory.ServerTool
AddCommentToPendingReview creates a tool to add a comment to a pull request review.
func AddDefaultToolset ¶
AddDefaultToolset removes the default toolset and expands it to the actual default toolset IDs
func AddIssueComment ¶
func AddIssueComment(t translations.TranslationHelperFunc) inventory.ServerTool
AddIssueComment creates a tool to add a comment to an issue.
func AddReplyToPullRequestComment ¶
func AddReplyToPullRequestComment(t translations.TranslationHelperFunc) inventory.ServerTool
AddReplyToPullRequestComment creates a tool to add a reply to an existing pull request comment.
func AddSubIssue ¶
func AllPrompts ¶
func AllPrompts(t translations.TranslationHelperFunc) []inventory.ServerPrompt
AllPrompts returns all prompts with their embedded toolset metadata. Prompt functions return ServerPrompt directly with toolset info.
func AllResources ¶
func AllResources(t translations.TranslationHelperFunc) []inventory.ServerResourceTemplate
AllResources returns all resource templates with their embedded toolset metadata. Resource definitions are stateless - handlers are generated on-demand during registration.
func AllTools ¶
func AllTools(t translations.TranslationHelperFunc) []inventory.ServerTool
AllTools returns all tools with their embedded toolset metadata. Tool functions return ServerTool directly with toolset info.
func AssignCodingAgentPrompt ¶
func AssignCodingAgentPrompt(t translations.TranslationHelperFunc) inventory.ServerPrompt
func AssignCopilotToIssue ¶
func AssignCopilotToIssue(t translations.TranslationHelperFunc) inventory.ServerTool
func CleanTools ¶
CleanTools cleans tool names by removing duplicates and trimming whitespace. Validation of tool existence is done during registration.
func CompletionsHandler ¶
func CompletionsHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error)
func ContainsToolset ¶
func ContextWithDeps ¶
func ContextWithDeps(ctx context.Context, deps ToolDependencies) context.Context
ContextWithDeps returns a new context with the ToolDependencies stored in it. This is used to inject dependencies at request time rather than at registration time, avoiding expensive closure creation during server initialization.
For the local server, this is called once at startup since deps don't change. For the remote server, this is called per-request with request-specific deps.
func ContextWithPollConfig ¶
func ContextWithPollConfig(ctx context.Context, config PollConfig) context.Context
ContextWithPollConfig returns a context with polling configuration. Use this in tests to reduce or disable polling.
func CreateBranch ¶
func CreateBranch(t translations.TranslationHelperFunc) inventory.ServerTool
CreateBranch creates a tool to create a new branch.
func CreateGist ¶
func CreateGist(t translations.TranslationHelperFunc) inventory.ServerTool
CreateGist creates a tool to create a new gist
func CreateIssue ¶
func CreateOrUpdateFile ¶
func CreateOrUpdateFile(t translations.TranslationHelperFunc) inventory.ServerTool
CreateOrUpdateFile creates a tool to create or update a file in a GitHub repository.
func CreatePullRequest ¶
func CreatePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
CreatePullRequest creates a tool to create a new pull request.
func CreatePullRequestReview ¶
func CreatePullRequestReview(ctx context.Context, client *githubv4.Client, params PullRequestReviewWriteParams) (*mcp.CallToolResult, error)
func CreateRepository ¶
func CreateRepository(t translations.TranslationHelperFunc) inventory.ServerTool
CreateRepository creates a tool to create a new GitHub repository.
func CreateToolScopeFilter ¶
func CreateToolScopeFilter(tokenScopes []string) inventory.ToolFilter
CreateToolScopeFilter creates an inventory.ToolFilter that filters tools based on the token's OAuth scopes.
For PATs (Personal Access Tokens), we cannot issue OAuth scope challenges like we can with OAuth apps. Instead, we hide tools that require scopes the token doesn't have.
This is the recommended way to filter tools for stdio servers where the token is known at startup and won't change during the session.
The filter returns true (include tool) if:
- The tool has no scope requirements (AcceptedScopes is empty)
- The tool is read-only and only requires repo/public_repo scopes (works on public repos)
- The token has at least one of the tool's accepted scopes
Example usage:
tokenScopes, err := scopes.FetchTokenScopes(ctx, token)
if err != nil {
// Handle error - maybe skip filtering
}
filter := github.CreateToolScopeFilter(tokenScopes)
inventory := github.NewInventory(t).WithFilter(filter).Build()
func DeleteFile ¶
func DeleteFile(t translations.TranslationHelperFunc) inventory.ServerTool
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(ctx context.Context, client *githubv4.Client, params PullRequestReviewWriteParams) (*mcp.CallToolResult, error)
func DismissNotification ¶
func DismissNotification(t translations.TranslationHelperFunc) inventory.ServerTool
DismissNotification creates a tool to mark a notification as read/done.
func DynamicTools ¶
func DynamicTools(r *inventory.Inventory) []inventory.ServerTool
DynamicTools returns the tools for dynamic toolset management. These tools allow runtime discovery and enablement of inventory. The r parameter provides the available toolset IDs for JSON Schema enums.
func EnableToolset ¶
func EnableToolset(r *inventory.Inventory) inventory.ServerTool
EnableToolset creates a tool that enables a toolset at runtime.
func ForkRepository ¶
func ForkRepository(t translations.TranslationHelperFunc) inventory.ServerTool
ForkRepository creates a tool to fork a repository.
func GenerateToolsetsHelp ¶
func GenerateToolsetsHelp() string
GenerateToolsetsHelp generates the help text for the toolsets flag
func GetCodeScanningAlert ¶
func GetCodeScanningAlert(t translations.TranslationHelperFunc) inventory.ServerTool
func GetCommit ¶
func GetCommit(t translations.TranslationHelperFunc) inventory.ServerTool
func GetDefaultToolsetIDs ¶
func GetDefaultToolsetIDs() []string
GetDefaultToolsetIDs returns the IDs of toolsets marked as Default. This is a convenience function that builds an inventory to determine defaults.
func GetDependabotAlert ¶
func GetDependabotAlert(t translations.TranslationHelperFunc) inventory.ServerTool
func GetDiscussion ¶
func GetDiscussion(t translations.TranslationHelperFunc) inventory.ServerTool
func GetDiscussionComments ¶
func GetDiscussionComments(t translations.TranslationHelperFunc) inventory.ServerTool
func GetFileContents ¶
func GetFileContents(t translations.TranslationHelperFunc) inventory.ServerTool
GetFileContents creates a tool to get the contents of a file or directory from a GitHub repository.
func GetGist ¶
func GetGist(t translations.TranslationHelperFunc) inventory.ServerTool
GetGist creates a tool to get the content of a gist
func GetGlobalSecurityAdvisory ¶
func GetGlobalSecurityAdvisory(t translations.TranslationHelperFunc) inventory.ServerTool
func GetIssueComments ¶
func GetIssueComments(ctx context.Context, client *github.Client, deps ToolDependencies, owner string, repo string, issueNumber int, pagination PaginationParams) (*mcp.CallToolResult, error)
func GetIssueLabels ¶
func GetLabel ¶
func GetLabel(t translations.TranslationHelperFunc) inventory.ServerTool
GetLabel retrieves a specific label by name from a GitHub repository
func GetLabelForLabelsToolset ¶
func GetLabelForLabelsToolset(t translations.TranslationHelperFunc) inventory.ServerTool
GetLabelForLabelsToolset returns the same GetLabel tool but registered in the labels toolset. This provides conformance with the original behavior where get_label was in both toolsets.
func GetLatestRelease ¶
func GetLatestRelease(t translations.TranslationHelperFunc) inventory.ServerTool
GetLatestRelease creates a tool to get the latest release in a GitHub repository.
func GetMe ¶
func GetMe(t translations.TranslationHelperFunc) inventory.ServerTool
GetMe creates a tool to get details of the authenticated user.
func GetNotificationDetails ¶
func GetNotificationDetails(t translations.TranslationHelperFunc) inventory.ServerTool
GetNotificationDetails creates a tool to get details for a specific notification.
func GetPullRequest ¶
func GetPullRequest(ctx context.Context, client *github.Client, deps ToolDependencies, owner, repo string, pullNumber int) (*mcp.CallToolResult, error)
func GetPullRequestDiff ¶
func GetPullRequestFiles ¶
func GetPullRequestFiles(ctx context.Context, client *github.Client, owner, repo string, pullNumber int, pagination PaginationParams) (*mcp.CallToolResult, error)
func GetPullRequestReviewComments ¶
func GetPullRequestReviewComments(ctx context.Context, gqlClient *githubv4.Client, deps ToolDependencies, owner, repo string, pullNumber int, pagination CursorPaginationParams) (*mcp.CallToolResult, error)
func GetPullRequestReviews ¶
func GetPullRequestReviews(ctx context.Context, client *github.Client, deps ToolDependencies, owner, repo string, pullNumber int) (*mcp.CallToolResult, error)
func GetPullRequestStatus ¶
func GetReleaseByTag ¶
func GetReleaseByTag(t translations.TranslationHelperFunc) inventory.ServerTool
func GetRepositoryResourceBranchContent ¶
func GetRepositoryResourceBranchContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
GetRepositoryResourceBranchContent defines the resource template for getting repository content for a branch.
func GetRepositoryResourceCommitContent ¶
func GetRepositoryResourceCommitContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
GetRepositoryResourceCommitContent defines the resource template for getting repository content for a commit.
func GetRepositoryResourceContent ¶
func GetRepositoryResourceContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
GetRepositoryResourceContent defines the resource template for getting repository content.
func GetRepositoryResourcePrContent ¶
func GetRepositoryResourcePrContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
GetRepositoryResourcePrContent defines the resource template for getting repository content for a pull request.
func GetRepositoryResourceTagContent ¶
func GetRepositoryResourceTagContent(t translations.TranslationHelperFunc) inventory.ServerResourceTemplate
GetRepositoryResourceTagContent defines the resource template for getting repository content for a tag.
func GetRepositoryTree ¶
func GetRepositoryTree(t translations.TranslationHelperFunc) inventory.ServerTool
GetRepositoryTree creates a tool to get the tree structure of a GitHub repository.
func GetSecretScanningAlert ¶
func GetSecretScanningAlert(t translations.TranslationHelperFunc) inventory.ServerTool
func GetSubIssues ¶
func GetSubIssues(ctx context.Context, client *github.Client, deps ToolDependencies, owner string, repo string, issueNumber int, pagination PaginationParams) (*mcp.CallToolResult, error)
func GetTag ¶
func GetTag(t translations.TranslationHelperFunc) inventory.ServerTool
GetTag creates a tool to get details about a specific tag in a GitHub repository.
func GetTeamMembers ¶
func GetTeamMembers(t translations.TranslationHelperFunc) inventory.ServerTool
func GetTeams ¶
func GetTeams(t translations.TranslationHelperFunc) inventory.ServerTool
func GetToolsetsTools ¶
func GetToolsetsTools(r *inventory.Inventory) inventory.ServerTool
GetToolsetsTools creates a tool that lists all tools in a specific toolset.
func GetUIAsset ¶
GetUIAsset reads a UI asset from the embedded filesystem. The name should be just the filename (e.g., "get-me.html").
func InjectDepsMiddleware ¶
func InjectDepsMiddleware(deps ToolDependencies) mcp.Middleware
func InjectGitDepsMiddleware ¶
func InjectGitDepsMiddleware(deps ToolDependencies) mcp.Middleware
InjectGitDepsMiddleware creates a middleware that injects git.ToolDependencies into the context. This allows git tools to retrieve their dependencies from context at call time.
func IssueCommentWrite ¶
func IssueCommentWrite(t translations.TranslationHelperFunc) inventory.ServerTool
IssueCommentWrite creates a tool to update or delete an issue comment.
func IssueRead ¶
func IssueRead(t translations.TranslationHelperFunc) inventory.ServerTool
IssueRead creates a tool to get details of a specific issue in a GitHub repository.
func IssueToFixWorkflowPrompt ¶
func IssueToFixWorkflowPrompt(t translations.TranslationHelperFunc) inventory.ServerPrompt
IssueToFixWorkflowPrompt provides a guided workflow for creating an issue and then generating a PR to fix it
func IssueWrite ¶
func IssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool
func LabelWrite ¶
func LabelWrite(t translations.TranslationHelperFunc) inventory.ServerTool
LabelWrite handles create, update, and delete operations for GitHub labels
func ListAvailableToolsets ¶
func ListAvailableToolsets() inventory.ServerTool
ListAvailableToolsets creates a tool that lists all available inventory.
func ListBranches ¶
func ListBranches(t translations.TranslationHelperFunc) inventory.ServerTool
ListBranches creates a tool to list branches in a GitHub repository.
func ListCodeScanningAlerts ¶
func ListCodeScanningAlerts(t translations.TranslationHelperFunc) inventory.ServerTool
func ListCommits ¶
func ListCommits(t translations.TranslationHelperFunc) inventory.ServerTool
ListCommits creates a tool to get commits of a branch in a repository.
func ListDependabotAlerts ¶
func ListDependabotAlerts(t translations.TranslationHelperFunc) inventory.ServerTool
func ListDiscussionCategories ¶
func ListDiscussionCategories(t translations.TranslationHelperFunc) inventory.ServerTool
func ListDiscussions ¶
func ListDiscussions(t translations.TranslationHelperFunc) inventory.ServerTool
func ListGists ¶
func ListGists(t translations.TranslationHelperFunc) inventory.ServerTool
ListGists creates a tool to list gists for a user
func ListGlobalSecurityAdvisories ¶
func ListGlobalSecurityAdvisories(t translations.TranslationHelperFunc) inventory.ServerTool
func ListIssueTypes ¶
func ListIssueTypes(t translations.TranslationHelperFunc) inventory.ServerTool
ListIssueTypes creates a tool to list defined issue types for an organization. This can be used to understand supported issue type values for creating or updating issues.
func ListIssues ¶
func ListIssues(t translations.TranslationHelperFunc) inventory.ServerTool
ListIssues creates a tool to list and filter repository issues
func ListLabels ¶
func ListLabels(t translations.TranslationHelperFunc) inventory.ServerTool
ListLabels lists labels from a repository
func ListNotifications ¶
func ListNotifications(t translations.TranslationHelperFunc) inventory.ServerTool
ListNotifications creates a tool to list notifications for the current user.
func ListOrgRepositorySecurityAdvisories ¶
func ListOrgRepositorySecurityAdvisories(t translations.TranslationHelperFunc) inventory.ServerTool
func ListPullRequests ¶
func ListPullRequests(t translations.TranslationHelperFunc) inventory.ServerTool
ListPullRequests creates a tool to list and filter repository pull requests.
func ListReleases ¶
func ListReleases(t translations.TranslationHelperFunc) inventory.ServerTool
ListReleases creates a tool to list releases in a GitHub repository.
func ListRepositorySecurityAdvisories ¶
func ListRepositorySecurityAdvisories(t translations.TranslationHelperFunc) inventory.ServerTool
func ListSecretScanningAlerts ¶
func ListSecretScanningAlerts(t translations.TranslationHelperFunc) inventory.ServerTool
func ListStarredRepositories ¶
func ListStarredRepositories(t translations.TranslationHelperFunc) inventory.ServerTool
ListStarredRepositories creates a tool to list starred repositories for the authenticated user or a specified user.
func ListTags ¶
func ListTags(t translations.TranslationHelperFunc) inventory.ServerTool
ListTags creates a tool to list tags in a GitHub repository.
func ManageNotificationSubscription ¶
func ManageNotificationSubscription(t translations.TranslationHelperFunc) inventory.ServerTool
ManageNotificationSubscription creates a tool to manage a notification subscription (ignore, watch, delete)
func ManageRepositoryNotificationSubscription ¶
func ManageRepositoryNotificationSubscription(t translations.TranslationHelperFunc) inventory.ServerTool
ManageRepositoryNotificationSubscription creates a tool to manage a repository notification subscription (ignore, watch, delete)
func MarkAllNotificationsRead ¶
func MarkAllNotificationsRead(t translations.TranslationHelperFunc) inventory.ServerTool
MarkAllNotificationsRead creates a tool to mark all notifications as read.
func MarshalledTextResult ¶
func MarshalledTextResult(v any) *mcp.CallToolResult
func MergePullRequest ¶
func MergePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
MergePullRequest creates a tool to merge a pull request.
func MustGetUIAsset ¶
MustGetUIAsset reads a UI asset and panics if it fails. Use this when the asset is required for server operation.
func NewDynamicTool ¶
func NewDynamicTool(toolset inventory.ToolsetMetadata, tool mcp.Tool, handler func(deps DynamicToolDependencies) mcp.ToolHandlerFor[map[string]any, any]) inventory.ServerTool
NewDynamicTool creates a ServerTool with fully-typed DynamicToolDependencies. Dynamic tools use a different dependency structure (DynamicToolDependencies) than regular tools (ToolDependencies), so they intentionally use the closure pattern.
func NewInventory ¶
func NewInventory(t translations.TranslationHelperFunc) *inventory.Builder
NewInventory creates an Inventory with all available tools, resources, and prompts. Tools, resources, and prompts are self-describing with their toolset metadata embedded. This function is stateless - no dependencies are captured. Handlers are generated on-demand during registration via RegisterAll(ctx, server, deps). The "default" keyword in WithToolsets will expand to toolsets marked with Default: true.
func NewMCPServer ¶
func NewMCPServer(ctx context.Context, cfg *MCPServerConfig, deps ToolDependencies, inv *inventory.Inventory, middleware ...mcp.Middleware) (*mcp.Server, error)
func NewServer ¶
func NewServer(version string, opts *mcp.ServerOptions) *mcp.Server
NewServer creates a new GitHub MCP server with the specified GH client and logger.
func NewTool ¶
func NewTool[In, Out any]( toolset inventory.ToolsetMetadata, tool mcp.Tool, requiredScopes []scopes.Scope, handler func(ctx context.Context, deps ToolDependencies, req *mcp.CallToolRequest, args In) (*mcp.CallToolResult, Out, error), ) inventory.ServerTool
NewTool creates a ServerTool that retrieves ToolDependencies from context at call time. This avoids creating closures at registration time, which is important for performance in servers that create a new server instance per request (like the remote server).
The handler function receives deps extracted from context via MustDepsFromContext. Ensure ContextWithDeps is called to inject deps before any tool handlers are invoked.
requiredScopes specifies the minimum OAuth scopes needed for this tool. AcceptedScopes are automatically derived using the scope hierarchy (e.g., if public_repo is required, repo is also accepted since repo grants public_repo).
func NewToolFromHandler ¶
func NewToolFromHandler( toolset inventory.ToolsetMetadata, tool mcp.Tool, requiredScopes []scopes.Scope, handler func(ctx context.Context, deps ToolDependencies, req *mcp.CallToolRequest) (*mcp.CallToolResult, error), ) inventory.ServerTool
NewToolFromHandler creates a ServerTool that retrieves ToolDependencies from context at call time. Use this when you have a handler that conforms to mcp.ToolHandler directly.
The handler function receives deps extracted from context via MustDepsFromContext. Ensure ContextWithDeps is called to inject deps before any tool handlers are invoked.
requiredScopes specifies the minimum OAuth scopes needed for this tool. AcceptedScopes are automatically derived using the scope hierarchy.
func OptionalBigIntArrayParam ¶
OptionalBigIntArrayParam 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 an empty slice 2. If it is present, iterates the elements, checks each is a string, and converts them to int64 values
func OptionalBoolParamWithDefault ¶
OptionalBoolParamWithDefault is a helper function that can be used to fetch a requested parameter from the request similar to optionalBoolParam, but it also takes a default value.
func OptionalIntParam ¶
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 ¶
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 ¶
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 ProjectsGet ¶
func ProjectsGet(t translations.TranslationHelperFunc) inventory.ServerTool
ProjectsGet returns the tool and handler for getting GitHub Projects resources.
func ProjectsList ¶
func ProjectsList(t translations.TranslationHelperFunc) inventory.ServerTool
ProjectsList returns the tool and handler for listing GitHub Projects resources.
func ProjectsWrite ¶
func ProjectsWrite(t translations.TranslationHelperFunc) inventory.ServerTool
ProjectsWrite returns the tool and handler for modifying GitHub Projects resources.
func PullRequestCommentWrite ¶
func PullRequestCommentWrite(t translations.TranslationHelperFunc) inventory.ServerTool
PullRequestCommentWrite creates a tool to update or delete a pull request review comment.
func PullRequestRead ¶
func PullRequestRead(t translations.TranslationHelperFunc) inventory.ServerTool
PullRequestRead creates a tool to get details of a specific pull request.
func PullRequestReviewWrite ¶
func PullRequestReviewWrite(t translations.TranslationHelperFunc) inventory.ServerTool
func PushFiles ¶
func PushFiles(t translations.TranslationHelperFunc) inventory.ServerTool
PushFiles creates a tool to push multiple files in a single commit to a GitHub repository.
func RegisterUIResources ¶
RegisterUIResources registers MCP App UI resources with the server. These are static resources (not templates) that serve HTML content for MCP App-enabled tools. The HTML is built from React/Primer components in the ui/ directory using `script/build-ui`.
func RemoteOnlyToolsets ¶
func RemoteOnlyToolsets() []inventory.ToolsetMetadata
RemoteOnlyToolsets returns toolset metadata for toolsets that are only available in the remote MCP server. These are documented but not registered in the local server.
func RemoveSubIssue ¶
func RemoveToolset ¶
func RepositoryResourceCompletionHandler ¶
func RepositoryResourceCompletionHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error)
RepositoryResourceCompletionHandler returns a CompletionHandlerFunc for repository resource completions.
func RepositoryResourceContentsHandler ¶
func RepositoryResourceContentsHandler(resourceURITemplate *uritemplate.Template) mcp.ResourceHandler
RepositoryResourceContentsHandler returns a handler function for repository content requests. It retrieves ToolDependencies from the context at call time via MustDepsFromContext.
func ReprioritizeSubIssue ¶
func RequestCopilotReview ¶
func RequestCopilotReview(t translations.TranslationHelperFunc) inventory.ServerTool
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 RequiredBigInt ¶
RequiredBigInt 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 (float64). 3. Checks if the parameter is not empty, i.e: non-zero value. 4. Validates that the float64 value can be safely converted to int64 without truncation.
func RequiredInt ¶
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 RequiredParam ¶
func RequiredParam[T comparable](args map[string]any, p string) (T, error)
RequiredParam 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 ResolvedEnabledToolsets ¶
func ResolvedEnabledToolsets(dynamicToolsets bool, enabledToolsets []string, enabledTools []string) []string
ResolvedEnabledToolsets determines which toolsets should be enabled based on config. Returns nil for "use defaults", empty slice for "none", or explicit list.
func SearchCode ¶
func SearchCode(t translations.TranslationHelperFunc) inventory.ServerTool
SearchCode creates a tool to search for code across GitHub repositories.
func SearchIssues ¶
func SearchIssues(t translations.TranslationHelperFunc) inventory.ServerTool
SearchIssues creates a tool to search for issues.
func SearchOrgs ¶
func SearchOrgs(t translations.TranslationHelperFunc) inventory.ServerTool
SearchOrgs creates a tool to search for GitHub organizations.
func SearchPullRequests ¶
func SearchPullRequests(t translations.TranslationHelperFunc) inventory.ServerTool
SearchPullRequests creates a tool to search for pull requests.
func SearchRepositories ¶
func SearchRepositories(t translations.TranslationHelperFunc) inventory.ServerTool
SearchRepositories creates a tool to search for GitHub repositories.
func SearchUsers ¶
func SearchUsers(t translations.TranslationHelperFunc) inventory.ServerTool
SearchUsers creates a tool to search for GitHub users.
func StarRepository ¶
func StarRepository(t translations.TranslationHelperFunc) inventory.ServerTool
StarRepository creates a tool to star a repository.
func SubIssueWrite ¶
func SubIssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool
SubIssueWrite creates a tool to add a sub-issue to a parent issue.
func SubmitPendingPullRequestReview ¶
func SubmitPendingPullRequestReview(ctx context.Context, client *githubv4.Client, params PullRequestReviewWriteParams) (*mcp.CallToolResult, error)
func ToStringPtr ¶
ToStringPtr converts a string to a *string pointer. Returns nil if the string is empty.
func UIAssetsAvailable ¶
func UIAssetsAvailable() bool
UIAssetsAvailable returns true if the MCP App UI assets have been built. This checks for a known UI asset file to determine if `script/build-ui` has been run. Use this to gracefully skip UI registration when assets aren't available, allowing Insiders mode to work for non-UI features without requiring a UI build.
func UnstarRepository ¶
func UnstarRepository(t translations.TranslationHelperFunc) inventory.ServerTool
UnstarRepository creates a tool to unstar a repository.
func UpdateGist ¶
func UpdateGist(t translations.TranslationHelperFunc) inventory.ServerTool
UpdateGist creates a tool to edit an existing gist
func UpdateIssue ¶
func UpdateIssue(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, owner string, repo string, issueNumber int, title string, body string, assignees []string, labels []string, milestoneNum int, issueType string, state string, stateReason string, duplicateOf int) (*mcp.CallToolResult, error)
func UpdatePullRequest ¶
func UpdatePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
UpdatePullRequest creates a tool to update an existing pull request.
func UpdatePullRequestBranch ¶
func UpdatePullRequestBranch(t translations.TranslationHelperFunc) inventory.ServerTool
UpdatePullRequestBranch creates a tool to update a pull request branch with the latest changes from the base branch.
func WithCursorPagination ¶
func WithCursorPagination(schema *jsonschema.Schema) *jsonschema.Schema
WithCursorPagination adds only cursor-based pagination parameters to a tool (no page parameter).
func WithPagination ¶
func WithPagination(schema *jsonschema.Schema) *jsonschema.Schema
WithPagination adds REST API pagination parameters to a tool. https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api
func WithUnifiedPagination ¶
func WithUnifiedPagination(schema *jsonschema.Schema) *jsonschema.Schema
WithUnifiedPagination adds REST API pagination parameters to a tool. GraphQL tools will use this and convert page/perPage to GraphQL cursor parameters internally.
Types ¶
type AgentAssignmentInput ¶
type AgentAssignmentInput struct {
BaseRef *githubv4.String `json:"baseRef,omitempty"`
CustomAgent *githubv4.String `json:"customAgent,omitempty"`
CustomInstructions *githubv4.String `json:"customInstructions,omitempty"`
TargetRepositoryID githubv4.ID `json:"targetRepositoryId"`
}
AgentAssignmentInput represents the input for assigning an agent to an issue.
type BaseDeps ¶
type BaseDeps struct {
// Pre-created clients
Client *gogithub.Client
GQLClient *githubv4.Client
RawClient *raw.Client
// Static dependencies
RepoAccessCache *lockdown.RepoAccessCache
T translations.TranslationHelperFunc
Flags FeatureFlags
ContentWindowSize int
// Local git operations
GitOps gitops.GitOperations
RepoPaths []string
// contains filtered or unexported fields
}
BaseDeps is the standard implementation of ToolDependencies for the local server. It stores pre-created clients. The remote server can create its own struct implementing ToolDependencies with different client creation strategies.
func NewBaseDeps ¶
func NewBaseDeps( client *gogithub.Client, gqlClient *githubv4.Client, rawClient *raw.Client, repoAccessCache *lockdown.RepoAccessCache, t translations.TranslationHelperFunc, flags FeatureFlags, contentWindowSize int, featureChecker inventory.FeatureFlagChecker, gitOps gitops.GitOperations, repoPaths []string, ) *BaseDeps
NewBaseDeps creates a BaseDeps with the provided clients and configuration.
func (BaseDeps) GetContentWindowSize ¶
GetContentWindowSize implements ToolDependencies.
func (BaseDeps) GetFlags ¶
func (d BaseDeps) GetFlags(_ context.Context) FeatureFlags
GetFlags implements ToolDependencies.
func (BaseDeps) GetGQLClient ¶
GetGQLClient implements ToolDependencies.
func (BaseDeps) GetGitOps ¶
func (d BaseDeps) GetGitOps() gitops.GitOperations
GetGitOps implements ToolDependencies.
func (BaseDeps) GetRawClient ¶
GetRawClient implements ToolDependencies.
func (BaseDeps) GetRepoAccessCache ¶
GetRepoAccessCache implements ToolDependencies.
func (BaseDeps) GetRepoPaths ¶
GetRepoPaths implements ToolDependencies.
func (BaseDeps) GetT ¶
func (d BaseDeps) GetT() translations.TranslationHelperFunc
GetT implements ToolDependencies.
func (BaseDeps) IsFeatureEnabled ¶
IsFeatureEnabled checks if a feature flag is enabled. Returns false if the feature checker is nil, flag name is empty, or an error occurs. This allows tools to conditionally change behavior based on feature flags.
type BasicNoOrder ¶
type BasicNoOrder struct {
Repository struct {
Discussions DiscussionFragment `graphql:"discussions(first: $first, after: $after)"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}
func (*BasicNoOrder) GetDiscussionFragment ¶
func (q *BasicNoOrder) GetDiscussionFragment() DiscussionFragment
Implement the interface for all query types
type BasicWithOrder ¶
type BasicWithOrder struct {
Repository struct {
Discussions DiscussionFragment `graphql:"discussions(first: $first, after: $after, orderBy: { field: $orderByField, direction: $orderByDirection })"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}
func (*BasicWithOrder) GetDiscussionFragment ¶
func (q *BasicWithOrder) GetDiscussionFragment() DiscussionFragment
type CloseIssueInput ¶
type CloseIssueInput struct {
IssueID githubv4.ID `json:"issueId"`
ClientMutationID *githubv4.String `json:"clientMutationId,omitempty"`
StateReason *IssueClosedStateReason `json:"stateReason,omitempty"`
DuplicateIssueID *githubv4.ID `json:"duplicateIssueId,omitempty"`
}
CloseIssueInput represents the input for closing an issue via the GraphQL API. Used to extend the functionality of the githubv4 library to support closing issues as duplicates.
type CompleteHandler ¶
type CompleteHandler func(ctx context.Context, client *github.Client, resolved map[string]string, argValue string) ([]string, error)
CompleteHandler defines function signature for completion handlers
type CreateProjectV2StatusUpdateInput ¶
type CreateProjectV2StatusUpdateInput struct {
ProjectID githubv4.ID `json:"projectId"`
Body *githubv4.String `json:"body,omitempty"`
Status *githubv4.String `json:"status,omitempty"`
StartDate *githubv4.String `json:"startDate,omitempty"`
TargetDate *githubv4.String `json:"targetDate,omitempty"`
ClientMutationID *githubv4.String `json:"clientMutationId,omitempty"`
}
CreateProjectV2StatusUpdateInput is the input for the createProjectV2StatusUpdate mutation. Defined locally because the shurcooL/githubv4 library does not include this type.
type CursorPaginationParams ¶
func OptionalCursorPaginationParams ¶
func OptionalCursorPaginationParams(args map[string]any) (CursorPaginationParams, error)
OptionalCursorPaginationParams returns the "perPage" and "after" parameters from the request, without the "page" parameter, suitable for cursor-based pagination only.
func (CursorPaginationParams) ToGraphQLParams ¶
func (p CursorPaginationParams) ToGraphQLParams() (*GraphQLPaginationParams, error)
ToGraphQLParams converts cursor pagination parameters to GraphQL-specific parameters.
type DiscussionFragment ¶
type DiscussionFragment struct {
Nodes []NodeFragment
PageInfo PageInfoFragment
TotalCount githubv4.Int
}
type DiscussionQueryResult ¶
type DiscussionQueryResult interface {
GetDiscussionFragment() DiscussionFragment
}
Common interface for all discussion query types
type DynamicToolDependencies ¶
type DynamicToolDependencies struct {
// Server is the MCP server to register tools with
Server *mcp.Server
// Inventory contains all available tools, resources and prompts that can be enabled dynamically
Inventory *inventory.Inventory
// ToolDeps are the dependencies passed to tools when they are registered
ToolDeps any
// T is the translation helper function
T translations.TranslationHelperFunc
}
DynamicToolDependencies contains dependencies for dynamic toolset management tools. It includes the managed Inventory, the server for registration, and the deps that will be passed to tools when they are dynamically enabled.
type FeatureFlags ¶
FeatureFlags defines runtime feature toggles that adjust tool behavior.
type GraphQLPaginationParams ¶
type IssueClosedStateReason ¶
type IssueClosedStateReason string
IssueClosedStateReason represents the reason an issue was closed. Used to extend the functionality of the githubv4 library to support closing issues as duplicates.
const ( IssueClosedStateReasonCompleted IssueClosedStateReason = "COMPLETED" IssueClosedStateReasonDuplicate IssueClosedStateReason = "DUPLICATE" IssueClosedStateReasonNotPlanned IssueClosedStateReason = "NOT_PLANNED" )
type IssueFragment ¶
type IssueFragment struct {
Number githubv4.Int
Title githubv4.String
Body githubv4.String
State githubv4.String
DatabaseID int64
Author struct {
Login githubv4.String
}
CreatedAt githubv4.DateTime
UpdatedAt githubv4.DateTime
Labels struct {
Nodes []struct {
Name githubv4.String
ID githubv4.String
Description githubv4.String
}
} `graphql:"labels(first: 100)"`
Comments struct {
TotalCount githubv4.Int
} `graphql:"comments"`
}
IssueFragment represents a fragment of an issue node in the GraphQL API.
type IssueQueryFragment ¶
type IssueQueryResult ¶
type IssueQueryResult interface {
GetIssueFragment() IssueQueryFragment
}
Common interface for all issue query types
type ListIssuesQuery ¶
type ListIssuesQuery struct {
Repository struct {
Issues IssueQueryFragment `graphql:"issues(first: $first, after: $after, states: $states, orderBy: {field: $orderBy, direction: $direction})"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}
ListIssuesQuery is the root query structure for fetching issues with optional label filtering.
func (*ListIssuesQuery) GetIssueFragment ¶
func (q *ListIssuesQuery) GetIssueFragment() IssueQueryFragment
type ListIssuesQueryTypeWithLabels ¶
type ListIssuesQueryTypeWithLabels struct {
Repository struct {
Issues IssueQueryFragment `` /* 131-byte string literal not displayed */
} `graphql:"repository(owner: $owner, name: $repo)"`
}
ListIssuesQueryTypeWithLabels is the query structure for fetching issues with optional label filtering.
func (*ListIssuesQueryTypeWithLabels) GetIssueFragment ¶
func (q *ListIssuesQueryTypeWithLabels) GetIssueFragment() IssueQueryFragment
Implement the interface for all query types
type ListIssuesQueryTypeWithLabelsWithSince ¶
type ListIssuesQueryTypeWithLabelsWithSince struct {
Repository struct {
Issues IssueQueryFragment `` /* 158-byte string literal not displayed */
} `graphql:"repository(owner: $owner, name: $repo)"`
}
ListIssuesQueryTypeWithLabelsWithSince is the query structure for fetching issues with both label and since filtering.
func (*ListIssuesQueryTypeWithLabelsWithSince) GetIssueFragment ¶
func (q *ListIssuesQueryTypeWithLabelsWithSince) GetIssueFragment() IssueQueryFragment
type ListIssuesQueryWithSince ¶
type ListIssuesQueryWithSince struct {
Repository struct {
Issues IssueQueryFragment `` /* 141-byte string literal not displayed */
} `graphql:"repository(owner: $owner, name: $repo)"`
}
ListIssuesQueryWithSince is the query structure for fetching issues without label filtering but with since filtering.
func (*ListIssuesQueryWithSince) GetIssueFragment ¶
func (q *ListIssuesQueryWithSince) GetIssueFragment() IssueQueryFragment
type MCPServerConfig ¶
type MCPServerConfig struct {
// Version of the server
Version string
// GitHub Host to target for API requests (e.g. github.com or github.enterprise.com)
Host string
// GitHub Token to authenticate with the GitHub API
Token string
// EnabledToolsets is a list of toolsets to enable
// See: https://github.com/aifity/omnigit-mcp?tab=readme-ov-file#tool-configuration
EnabledToolsets []string
// EnabledTools is a list of specific tools to enable (additive to toolsets)
// When specified, these tools are registered in addition to any specified toolset tools
EnabledTools []string
// EnabledFeatures is a list of feature flags that are enabled
// Items with FeatureFlagEnable matching an entry in this list will be available
EnabledFeatures []string
// Whether to enable dynamic toolsets
// See: https://github.com/aifity/omnigit-mcp?tab=readme-ov-file#dynamic-tool-discovery
DynamicToolsets bool
// ReadOnly indicates if we should only offer read-only tools
ReadOnly bool
// Translator provides translated text for the server tooling
Translator translations.TranslationHelperFunc
// Content window size
ContentWindowSize int
// LockdownMode indicates if we should enable lockdown mode
LockdownMode bool
// InsidersMode indicates if we should enable experimental features
InsidersMode bool
// Logger is used for logging within the server
Logger *slog.Logger
// RepoAccessTTL overrides the default TTL for repository access cache entries.
RepoAccessTTL *time.Duration
// ExcludeTools is a list of tool names that should be disabled regardless of
// other configuration. These tools will be excluded even if their toolset is enabled
// or they are explicitly listed in EnabledTools.
ExcludeTools []string
// TokenScopes contains the OAuth scopes available to the token.
// When non-nil, tools requiring scopes not in this list will be hidden.
// This is used for PAT scope filtering where we can't issue scope challenges.
TokenScopes []string
// Additional server options to apply
ServerOptions []MCPServerOption
}
type MCPServerOption ¶
type MCPServerOption func(*mcp.ServerOptions)
type MinimalBranch ¶
type MinimalBranch struct {
Name string `json:"name"`
SHA string `json:"sha"`
Protected bool `json:"protected"`
}
MinimalBranch is the trimmed output type for branch objects.
type MinimalCommit ¶
type MinimalCommit struct {
SHA string `json:"sha"`
HTMLURL string `json:"html_url"`
Commit *MinimalCommitInfo `json:"commit,omitempty"`
Author *MinimalUser `json:"author,omitempty"`
Committer *MinimalUser `json:"committer,omitempty"`
Stats *MinimalCommitStats `json:"stats,omitempty"`
Files []MinimalCommitFile `json:"files,omitempty"`
}
MinimalCommit is the trimmed output type for commit objects.
type MinimalCommitAuthor ¶
type MinimalCommitAuthor struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
Date string `json:"date,omitempty"`
}
MinimalCommitAuthor represents commit author information.
type MinimalCommitFile ¶
type MinimalCommitFile struct {
Filename string `json:"filename"`
Status string `json:"status,omitempty"`
Additions int `json:"additions,omitempty"`
Deletions int `json:"deletions,omitempty"`
Changes int `json:"changes,omitempty"`
}
MinimalCommitFile represents a file changed in a commit.
type MinimalCommitInfo ¶
type MinimalCommitInfo struct {
Message string `json:"message"`
Author *MinimalCommitAuthor `json:"author,omitempty"`
Committer *MinimalCommitAuthor `json:"committer,omitempty"`
}
MinimalCommitInfo represents core commit information.
type MinimalCommitStats ¶
type MinimalCommitStats struct {
Additions int `json:"additions,omitempty"`
Deletions int `json:"deletions,omitempty"`
Total int `json:"total,omitempty"`
}
MinimalCommitStats represents commit statistics.
type MinimalFileCommit ¶
type MinimalFileCommit struct {
SHA string `json:"sha"`
Message string `json:"message,omitempty"`
HTMLURL string `json:"html_url,omitempty"`
Author *MinimalCommitAuthor `json:"author,omitempty"`
}
MinimalFileCommit is the trimmed commit portion of a file operation response.
type MinimalFileContent ¶
type MinimalFileContent struct {
Name string `json:"name"`
Path string `json:"path"`
SHA string `json:"sha"`
Size int `json:"size,omitempty"`
HTMLURL string `json:"html_url"`
}
MinimalFileContent is the trimmed content portion of a file operation response.
type MinimalFileContentResponse ¶
type MinimalFileContentResponse struct {
Content *MinimalFileContent `json:"content,omitempty"`
Commit *MinimalFileCommit `json:"commit,omitempty"`
}
MinimalFileContentResponse is the trimmed output type for create/update/delete file responses.
type MinimalIssue ¶
type MinimalIssue struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body,omitempty"`
State string `json:"state"`
StateReason string `json:"state_reason,omitempty"`
Draft bool `json:"draft,omitempty"`
Locked bool `json:"locked,omitempty"`
HTMLURL string `json:"html_url"`
User *MinimalUser `json:"user,omitempty"`
AuthorAssociation string `json:"author_association,omitempty"`
Labels []string `json:"labels,omitempty"`
Assignees []string `json:"assignees,omitempty"`
Milestone string `json:"milestone,omitempty"`
Comments int `json:"comments,omitempty"`
Reactions *MinimalReactions `json:"reactions,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
ClosedAt string `json:"closed_at,omitempty"`
ClosedBy string `json:"closed_by,omitempty"`
IssueType string `json:"issue_type,omitempty"`
}
MinimalIssue is the trimmed output type for issue objects to reduce verbosity.
type MinimalIssueComment ¶
type MinimalIssueComment struct {
ID int64 `json:"id"`
Body string `json:"body,omitempty"`
HTMLURL string `json:"html_url"`
User *MinimalUser `json:"user,omitempty"`
AuthorAssociation string `json:"author_association,omitempty"`
Reactions *MinimalReactions `json:"reactions,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
MinimalIssueComment is the trimmed output type for issue comment objects to reduce verbosity.
type MinimalPRBranch ¶
type MinimalPRBranch struct {
Ref string `json:"ref"`
SHA string `json:"sha"`
Repo *MinimalPRBranchRepo `json:"repo,omitempty"`
}
MinimalPRBranch is the trimmed output type for pull request branch references.
type MinimalPRBranchRepo ¶
type MinimalPRBranchRepo struct {
FullName string `json:"full_name"`
Description string `json:"description,omitempty"`
}
MinimalPRBranchRepo is the trimmed repo info nested inside a PR branch.
type MinimalProject ¶
type MinimalProject struct {
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
Owner *MinimalUser `json:"owner,omitempty"`
Creator *MinimalUser `json:"creator,omitempty"`
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty"`
Public *bool `json:"public,omitempty"`
ClosedAt *github.Timestamp `json:"closed_at,omitempty"`
CreatedAt *github.Timestamp `json:"created_at,omitempty"`
UpdatedAt *github.Timestamp `json:"updated_at,omitempty"`
DeletedAt *github.Timestamp `json:"deleted_at,omitempty"`
Number *int `json:"number,omitempty"`
ShortDescription *string `json:"short_description,omitempty"`
DeletedBy *MinimalUser `json:"deleted_by,omitempty"`
OwnerType string `json:"owner_type,omitempty"`
}
type MinimalProjectStatusUpdate ¶
type MinimalProjectStatusUpdate struct {
ID string `json:"id"`
Body string `json:"body,omitempty"`
Status string `json:"status,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
StartDate string `json:"start_date,omitempty"`
TargetDate string `json:"target_date,omitempty"`
Creator *MinimalUser `json:"creator,omitempty"`
}
type MinimalPullRequest ¶
type MinimalPullRequest struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body,omitempty"`
State string `json:"state"`
Draft bool `json:"draft"`
Merged bool `json:"merged"`
MergeableState string `json:"mergeable_state,omitempty"`
HTMLURL string `json:"html_url"`
User *MinimalUser `json:"user,omitempty"`
Labels []string `json:"labels,omitempty"`
Assignees []string `json:"assignees,omitempty"`
RequestedReviewers []string `json:"requested_reviewers,omitempty"`
MergedBy string `json:"merged_by,omitempty"`
Head *MinimalPRBranch `json:"head,omitempty"`
Base *MinimalPRBranch `json:"base,omitempty"`
Additions int `json:"additions,omitempty"`
Deletions int `json:"deletions,omitempty"`
ChangedFiles int `json:"changed_files,omitempty"`
Commits int `json:"commits,omitempty"`
Comments int `json:"comments,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
ClosedAt string `json:"closed_at,omitempty"`
MergedAt string `json:"merged_at,omitempty"`
Milestone string `json:"milestone,omitempty"`
}
MinimalPullRequest is the trimmed output type for pull request objects to reduce verbosity.
type MinimalReactions ¶
type MinimalReactions struct {
TotalCount int `json:"total_count"`
PlusOne int `json:"+1"`
MinusOne int `json:"-1"`
Laugh int `json:"laugh"`
Confused int `json:"confused"`
Heart int `json:"heart"`
Hooray int `json:"hooray"`
Rocket int `json:"rocket"`
Eyes int `json:"eyes"`
}
MinimalReactions is the trimmed output type for reaction summaries, dropping the API URL.
type MinimalRelease ¶
type MinimalRelease struct {
ID int64 `json:"id"`
TagName string `json:"tag_name"`
Name string `json:"name,omitempty"`
Body string `json:"body,omitempty"`
HTMLURL string `json:"html_url"`
PublishedAt string `json:"published_at,omitempty"`
Prerelease bool `json:"prerelease"`
Draft bool `json:"draft"`
Author *MinimalUser `json:"author,omitempty"`
}
MinimalRelease is the trimmed output type for release objects.
type MinimalRepository ¶
type MinimalRepository struct {
ID int64 `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description,omitempty"`
HTMLURL string `json:"html_url"`
Language string `json:"language,omitempty"`
Stars int `json:"stargazers_count"`
Forks int `json:"forks_count"`
OpenIssues int `json:"open_issues_count"`
UpdatedAt string `json:"updated_at,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Topics []string `json:"topics,omitempty"`
Private bool `json:"private"`
Fork bool `json:"fork"`
Archived bool `json:"archived"`
DefaultBranch string `json:"default_branch,omitempty"`
}
MinimalRepository is the trimmed output type for repository objects to reduce verbosity.
type MinimalResponse ¶
MinimalResponse represents a minimal response for all CRUD operations. Success is implicit in the HTTP response status, and all other information can be derived from the URL or fetched separately if needed.
type MinimalSearchRepositoriesResult ¶
type MinimalSearchRepositoriesResult struct {
TotalCount int `json:"total_count"`
IncompleteResults bool `json:"incomplete_results"`
Items []MinimalRepository `json:"items"`
}
MinimalSearchRepositoriesResult is the trimmed output type for repository search results.
type MinimalSearchUsersResult ¶
type MinimalSearchUsersResult struct {
TotalCount int `json:"total_count"`
IncompleteResults bool `json:"incomplete_results"`
Items []MinimalUser `json:"items"`
}
MinimalSearchUsersResult is the trimmed output type for user search results.
type MinimalUser ¶
type MinimalUser struct {
Login string `json:"login"`
ID int64 `json:"id,omitempty"`
ProfileURL string `json:"profile_url,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
Details *UserDetails `json:"details,omitempty"` // Optional field for additional user details
}
MinimalUser is the output type for user and organization search results.
type NodeFragment ¶
type NodeFragment struct {
Number githubv4.Int
Title githubv4.String
CreatedAt githubv4.DateTime
UpdatedAt githubv4.DateTime
Closed githubv4.Boolean
IsAnswered githubv4.Boolean
AnswerChosenAt *githubv4.DateTime
Author struct {
Login githubv4.String
}
Category struct {
Name githubv4.String
} `graphql:"category"`
URL githubv4.String `graphql:"url"`
}
type OrganizationTeams ¶
type PageInfoFragment ¶
type PaginationParams ¶
func OptionalPaginationParams ¶
func OptionalPaginationParams(args map[string]any) (PaginationParams, error)
OptionalPaginationParams returns the "page", "perPage", and "after" 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.
func (PaginationParams) ToGraphQLParams ¶
func (p PaginationParams) ToGraphQLParams() (*GraphQLPaginationParams, error)
ToGraphQLParams converts REST API pagination parameters to GraphQL-specific parameters. This converts page/perPage to first parameter for GraphQL queries. If After is provided, it takes precedence over page-based pagination.
type PollConfig ¶
PollConfig configures the PR polling behavior.
type RequestDeps ¶
type RequestDeps struct {
RepoAccessOpts []lockdown.RepoAccessOption
T translations.TranslationHelperFunc
ContentWindowSize int
// contains filtered or unexported fields
}
func NewRequestDeps ¶
func NewRequestDeps( apiHosts utils.APIHostResolver, version string, lockdownMode bool, repoAccessOpts []lockdown.RepoAccessOption, t translations.TranslationHelperFunc, contentWindowSize int, featureChecker inventory.FeatureFlagChecker, ) *RequestDeps
NewRequestDeps creates a RequestDeps with the provided clients and configuration.
func (*RequestDeps) GetContentWindowSize ¶
func (d *RequestDeps) GetContentWindowSize() int
GetContentWindowSize implements ToolDependencies.
func (*RequestDeps) GetFlags ¶
func (d *RequestDeps) GetFlags(ctx context.Context) FeatureFlags
GetFlags implements ToolDependencies.
func (*RequestDeps) GetGQLClient ¶
GetGQLClient implements ToolDependencies.
func (*RequestDeps) GetGitOps ¶
func (d *RequestDeps) GetGitOps() gitops.GitOperations
GetGitOps implements ToolDependencies. RequestDeps doesn't support git operations - returns nil.
func (*RequestDeps) GetRawClient ¶
GetRawClient implements ToolDependencies.
func (*RequestDeps) GetRepoAccessCache ¶
func (d *RequestDeps) GetRepoAccessCache(ctx context.Context) (*lockdown.RepoAccessCache, error)
GetRepoAccessCache implements ToolDependencies.
func (*RequestDeps) GetRepoPaths ¶
func (d *RequestDeps) GetRepoPaths() []string
GetRepoPaths implements ToolDependencies. RequestDeps doesn't support git operations - returns empty slice.
func (*RequestDeps) GetT ¶
func (d *RequestDeps) GetT() translations.TranslationHelperFunc
GetT implements ToolDependencies.
func (*RequestDeps) IsFeatureEnabled ¶
func (d *RequestDeps) IsFeatureEnabled(ctx context.Context, flagName string) bool
IsFeatureEnabled checks if a feature flag is enabled.
type ToolDependencies ¶
type ToolDependencies interface {
// GetClient returns a GitHub REST API client
GetClient(ctx context.Context) (*gogithub.Client, error)
// GetGQLClient returns a GitHub GraphQL client
GetGQLClient(ctx context.Context) (*githubv4.Client, error)
// GetRawClient returns a raw content client for GitHub
GetRawClient(ctx context.Context) (*raw.Client, error)
// GetRepoAccessCache returns the lockdown mode repo access cache
GetRepoAccessCache(ctx context.Context) (*lockdown.RepoAccessCache, error)
// GetT returns the translation helper function
GetT() translations.TranslationHelperFunc
// GetFlags returns feature flags
GetFlags(ctx context.Context) FeatureFlags
// GetContentWindowSize returns the content window size for log truncation
GetContentWindowSize() int
// IsFeatureEnabled checks if a feature flag is enabled.
IsFeatureEnabled(ctx context.Context, flagName string) bool
// GetGitOps returns the git operations implementation for local git tools
GetGitOps() gitops.GitOperations
// GetRepoPaths returns the list of allowed repository paths for local git operations
GetRepoPaths() []string
}
ToolDependencies defines the interface for dependencies that tool handlers need. This is an interface to allow different implementations:
- Local server: stores closures that create clients on demand
- Remote server: can store pre-created clients per-request for efficiency
The toolsets package uses `any` for deps and tool handlers type-assert to this interface.
func DepsFromContext ¶
func DepsFromContext(ctx context.Context) (ToolDependencies, bool)
DepsFromContext retrieves ToolDependencies from the context. Returns the deps and true if found, or nil and false if not present. Use MustDepsFromContext if you want to panic on missing deps (for handlers that require deps to function).
func MustDepsFromContext ¶
func MustDepsFromContext(ctx context.Context) ToolDependencies
MustDepsFromContext retrieves ToolDependencies from the context. Panics if deps are not found - use this in handlers where deps are required.
type TreeEntryResponse ¶
type TreeEntryResponse struct {
Path string `json:"path"`
Type string `json:"type"`
Size *int `json:"size,omitempty"`
Mode string `json:"mode"`
SHA string `json:"sha"`
URL string `json:"url"`
}
TreeEntryResponse represents a single entry in a Git tree.
type TreeResponse ¶
type TreeResponse struct {
SHA string `json:"sha"`
Truncated bool `json:"truncated"`
Tree []TreeEntryResponse `json:"tree"`
TreeSHA string `json:"tree_sha"`
Owner string `json:"owner"`
Repo string `json:"repo"`
Recursive bool `json:"recursive"`
Count int `json:"count"`
}
TreeResponse represents the response structure for a Git tree.
type UpdateIssueInput ¶
type UpdateIssueInput struct {
ID githubv4.ID `json:"id"`
AssigneeIDs []githubv4.ID `json:"assigneeIds"`
AgentAssignment *AgentAssignmentInput `json:"agentAssignment,omitempty"`
}
UpdateIssueInput represents the input for updating an issue with agent assignment.
type UserDetails ¶
type UserDetails struct {
Name string `json:"name,omitempty"`
Company string `json:"company,omitempty"`
Blog string `json:"blog,omitempty"`
Location string `json:"location,omitempty"`
Email string `json:"email,omitempty"`
Hireable bool `json:"hireable,omitempty"`
Bio string `json:"bio,omitempty"`
TwitterUsername string `json:"twitter_username,omitempty"`
PublicRepos int `json:"public_repos"`
PublicGists int `json:"public_gists"`
Followers int `json:"followers"`
Following int `json:"following"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
PrivateGists int `json:"private_gists,omitempty"`
TotalPrivateRepos int64 `json:"total_private_repos,omitempty"`
OwnedPrivateRepos int64 `json:"owned_private_repos,omitempty"`
}
UserDetails contains additional fields about a GitHub user not already present in MinimalUser. Used by get_me context tool but omitted from search_users.
type WithCategoryAndOrder ¶
type WithCategoryAndOrder struct {
Repository struct {
Discussions DiscussionFragment `` /* 141-byte string literal not displayed */
} `graphql:"repository(owner: $owner, name: $repo)"`
}
func (*WithCategoryAndOrder) GetDiscussionFragment ¶
func (q *WithCategoryAndOrder) GetDiscussionFragment() DiscussionFragment
type WithCategoryNoOrder ¶
type WithCategoryNoOrder struct {
Repository struct {
Discussions DiscussionFragment `graphql:"discussions(first: $first, after: $after, categoryId: $categoryId)"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}
func (*WithCategoryNoOrder) GetDiscussionFragment ¶
func (q *WithCategoryNoOrder) GetDiscussionFragment() DiscussionFragment
Source Files
¶
- actions.go
- code_scanning.go
- context_tools.go
- dependabot.go
- dependencies.go
- deprecated_tool_aliases.go
- discussions.go
- dynamic_tools.go
- feature_flags.go
- gists.go
- git.go
- inventory.go
- issues.go
- labels.go
- minimal_types.go
- notifications.go
- params.go
- projects.go
- prompts.go
- pullrequests.go
- repositories.go
- repositories_helper.go
- repository_resource.go
- repository_resource_completions.go
- resources.go
- scope_filter.go
- search.go
- search_utils.go
- secret_scanning.go
- security_advisories.go
- server.go
- tools.go
- toolset_instructions.go
- ui_capability.go
- ui_embed.go
- ui_resources.go
- workflow_prompts.go