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 1 commit
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 ('open', 'closed', 'dismissed', 'fixed'). Default: 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("If provided, filter code scanning alerts by severity ('critical', 'high', 'medium', 'low', 'warning', 'note', 'error')"),
mcp.Enum("critical", "high", "medium", "low", "warning", "note", "error"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
Expand Down
10 changes: 7 additions & 3 deletions pkg/github/pullrequests.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun
),
mcp.WithString("state",
mcp.Description("Filter by state ('open', 'closed', 'all')"),
mcp.Enum("open", "closed", "all"),
),
mcp.WithString("head",
mcp.Description("Filter by head user/org and branch"),
Expand All @@ -211,6 +212,7 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun
),
mcp.WithString("sort",
mcp.Description("Sort by ('created', 'updated', 'popularity', 'long-running')"),
mcp.Enum("created", "updated", "popularity", "long-running"),
),
mcp.WithString("direction",
mcp.Description("Sort direction ('asc', 'desc')"),
Expand Down Expand Up @@ -314,6 +316,7 @@ func MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFun
),
mcp.WithString("merge_method",
mcp.Description("Merge method ('merge', 'squash', 'rebase')"),
mcp.Enum("merge", "squash", "rebase"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
Expand Down Expand Up @@ -671,21 +674,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 ('line', 'file')"),
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 ('LEFT', 'RIGHT')"),
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 ('LEFT', 'RIGHT')"),
mcp.Enum("LEFT", "RIGHT"),
),
mcp.WithNumber("in_reply_to",
Expand Down Expand Up @@ -894,6 +897,7 @@ func CreatePullRequestReview(getClient GetClientFn, t translations.TranslationHe
mcp.WithString("event",
mcp.Required(),
mcp.Description("Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')"),
mcp.Enum("APPROVE", "REQUEST_CHANGES", "COMMENT"),
),
mcp.WithString("commitId",
mcp.Description("SHA of commit to review"),
Expand Down