Skip to content

Add missing enum constraints #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/github/code_scanning.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHel
mcp.Description("The Git reference for the results you want to list."),
),
mcp.WithString("state",
mcp.Description("State of the code scanning alerts to list. Set to closed to list only closed code scanning alerts. Default: open"),
mcp.Description("Filter code scanning alerts by state. Defaults to open"),
mcp.DefaultString("open"),
mcp.Enum("open", "closed", "dismissed", "fixed"),
),
mcp.WithString("severity",
mcp.Description("Only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error."),
mcp.Description("Filter code scanning alerts by severity"),
mcp.Enum("critical", "high", "medium", "low", "warning", "note", "error"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
Expand Down
14 changes: 7 additions & 7 deletions pkg/github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc
),
mcp.WithString("body",
mcp.Required(),
mcp.Description("Comment text"),
mcp.Description("Comment content"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
Expand Down Expand Up @@ -151,7 +151,7 @@ func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (
mcp.Description("Search query using GitHub issues search syntax"),
),
mcp.WithString("sort",
mcp.Description("Sort field (comments, reactions, created, etc.)"),
mcp.Description("Sort field by number of matches of categories, defaults to best match"),
mcp.Enum(
"comments",
"reactions",
Expand All @@ -167,7 +167,7 @@ func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (
),
),
mcp.WithString("order",
mcp.Description("Sort order ('asc' or 'desc')"),
mcp.Description("Sort order"),
mcp.Enum("asc", "desc"),
),
WithPagination(),
Expand Down Expand Up @@ -357,7 +357,7 @@ func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (to
mcp.Description("Repository name"),
),
mcp.WithString("state",
mcp.Description("Filter by state ('open', 'closed', 'all')"),
mcp.Description("Filter by state"),
mcp.Enum("open", "closed", "all"),
),
mcp.WithArray("labels",
Expand All @@ -369,11 +369,11 @@ func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (to
),
),
mcp.WithString("sort",
mcp.Description("Sort by ('created', 'updated', 'comments')"),
mcp.Description("Sort order"),
mcp.Enum("created", "updated", "comments"),
),
mcp.WithString("direction",
mcp.Description("Sort direction ('asc', 'desc')"),
mcp.Description("Sort direction"),
mcp.Enum("asc", "desc"),
),
mcp.WithString("since",
Expand Down Expand Up @@ -485,7 +485,7 @@ func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
mcp.Description("New description"),
),
mcp.WithString("state",
mcp.Description("New state ('open' or 'closed')"),
mcp.Description("New state"),
mcp.Enum("open", "closed"),
),
mcp.WithArray("labels",
Expand Down
23 changes: 14 additions & 9 deletions pkg/github/pullrequests.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFu
mcp.Description("New description"),
),
mcp.WithString("state",
mcp.Description("New state ('open' or 'closed')"),
mcp.Description("New state"),
mcp.Enum("open", "closed"),
),
mcp.WithString("base",
Expand Down Expand Up @@ -201,7 +201,8 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun
mcp.Description("Repository name"),
),
mcp.WithString("state",
mcp.Description("Filter by state ('open', 'closed', 'all')"),
mcp.Description("Filter by state"),
mcp.Enum("open", "closed", "all"),
),
mcp.WithString("head",
mcp.Description("Filter by head user/org and branch"),
Expand All @@ -210,10 +211,12 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun
mcp.Description("Filter by base branch"),
),
mcp.WithString("sort",
mcp.Description("Sort by ('created', 'updated', 'popularity', 'long-running')"),
mcp.Description("Sort by"),
mcp.Enum("created", "updated", "popularity", "long-running"),
),
mcp.WithString("direction",
mcp.Description("Sort direction ('asc', 'desc')"),
mcp.Description("Sort direction"),
mcp.Enum("asc", "desc"),
),
WithPagination(),
),
Expand Down Expand Up @@ -313,7 +316,8 @@ func MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFun
mcp.Description("Extra detail for merge commit"),
),
mcp.WithString("merge_method",
mcp.Description("Merge method ('merge', 'squash', 'rebase')"),
mcp.Description("Merge method"),
mcp.Enum("merge", "squash", "rebase"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
Expand Down Expand Up @@ -671,21 +675,21 @@ func AddPullRequestReviewComment(getClient GetClientFn, t translations.Translati
mcp.Description("The relative path to the file that necessitates a comment. Required unless in_reply_to is specified."),
),
mcp.WithString("subject_type",
mcp.Description("The level at which the comment is targeted, 'line' or 'file'"),
mcp.Description("The level at which the comment is targeted"),
mcp.Enum("line", "file"),
),
mcp.WithNumber("line",
mcp.Description("The line of the blob in the pull request diff that the comment applies to. For multi-line comments, the last line of the range"),
),
mcp.WithString("side",
mcp.Description("The side of the diff to comment on. Can be LEFT or RIGHT"),
mcp.Description("The side of the diff to comment on"),
mcp.Enum("LEFT", "RIGHT"),
),
mcp.WithNumber("start_line",
mcp.Description("For multi-line comments, the first line of the range that the comment applies to"),
),
mcp.WithString("start_side",
mcp.Description("For multi-line comments, the starting side of the diff that the comment applies to. Can be LEFT or RIGHT"),
mcp.Description("For multi-line comments, the starting side of the diff that the comment applies to"),
mcp.Enum("LEFT", "RIGHT"),
),
mcp.WithNumber("in_reply_to",
Expand Down Expand Up @@ -893,7 +897,8 @@ func CreatePullRequestReview(getClient GetClientFn, t translations.TranslationHe
),
mcp.WithString("event",
mcp.Required(),
mcp.Description("Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')"),
mcp.Description("Review action to perform"),
mcp.Enum("APPROVE", "REQUEST_CHANGES", "COMMENT"),
),
mcp.WithString("commitId",
mcp.Description("SHA of commit to review"),
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (t
mcp.Description("Repository name"),
),
mcp.WithString("sha",
mcp.Description("Branch name"),
mcp.Description("SHA or Branch name"),
),
WithPagination(),
),
Expand Down
6 changes: 3 additions & 3 deletions pkg/github/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (to
mcp.Description("Sort field ('indexed' only)"),
),
mcp.WithString("order",
mcp.Description("Sort order ('asc' or 'desc')"),
mcp.Description("Sort order"),
mcp.Enum("asc", "desc"),
),
WithPagination(),
Expand Down Expand Up @@ -147,11 +147,11 @@ func SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (t
mcp.Description("Search query using GitHub users search syntax"),
),
mcp.WithString("sort",
mcp.Description("Sort field (followers, repositories, joined)"),
mcp.Description("Sort field by category"),
mcp.Enum("followers", "repositories", "joined"),
),
mcp.WithString("order",
mcp.Description("Sort order ('asc' or 'desc')"),
mcp.Description("Sort order"),
mcp.Enum("asc", "desc"),
),
WithPagination(),
Expand Down
Loading