Skip to content

Commit 29969a8

Browse files
committed
Add missing enum constraints
1 parent ff3036d commit 29969a8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pkg/github/code_scanning.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHel
8686
mcp.Description("The Git reference for the results you want to list."),
8787
),
8888
mcp.WithString("state",
89-
mcp.Description("State of the code scanning alerts to list. Set to closed to list only closed code scanning alerts. Default: open"),
89+
mcp.Description("Filter code scanning alerts by state ('open', 'closed', 'dismissed', 'fixed'). Default: open"),
9090
mcp.DefaultString("open"),
91+
mcp.Enum("open", "closed", "dismissed", "fixed"),
9192
),
9293
mcp.WithString("severity",
93-
mcp.Description("Only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error."),
94+
mcp.Description("If provided, filter code scanning alerts by severity ('critical', 'high', 'medium', 'low', 'warning', 'note', 'error')"),
95+
mcp.Enum("critical", "high", "medium", "low", "warning", "note", "error"),
9496
),
9597
),
9698
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {

pkg/github/pullrequests.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun
202202
),
203203
mcp.WithString("state",
204204
mcp.Description("Filter by state ('open', 'closed', 'all')"),
205+
mcp.Enum("open", "closed", "all"),
205206
),
206207
mcp.WithString("head",
207208
mcp.Description("Filter by head user/org and branch"),
@@ -211,6 +212,7 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun
211212
),
212213
mcp.WithString("sort",
213214
mcp.Description("Sort by ('created', 'updated', 'popularity', 'long-running')"),
215+
mcp.Enum("created", "updated", "popularity", "long-running"),
214216
),
215217
mcp.WithString("direction",
216218
mcp.Description("Sort direction ('asc', 'desc')"),
@@ -314,6 +316,7 @@ func MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFun
314316
),
315317
mcp.WithString("merge_method",
316318
mcp.Description("Merge method ('merge', 'squash', 'rebase')"),
319+
mcp.Enum("merge", "squash", "rebase"),
317320
),
318321
),
319322
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
@@ -671,21 +674,21 @@ func AddPullRequestReviewComment(getClient GetClientFn, t translations.Translati
671674
mcp.Description("The relative path to the file that necessitates a comment. Required unless in_reply_to is specified."),
672675
),
673676
mcp.WithString("subject_type",
674-
mcp.Description("The level at which the comment is targeted, 'line' or 'file'"),
677+
mcp.Description("The level at which the comment is targeted ('line', 'file')"),
675678
mcp.Enum("line", "file"),
676679
),
677680
mcp.WithNumber("line",
678681
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"),
679682
),
680683
mcp.WithString("side",
681-
mcp.Description("The side of the diff to comment on. Can be LEFT or RIGHT"),
684+
mcp.Description("The side of the diff to comment on ('LEFT', 'RIGHT')"),
682685
mcp.Enum("LEFT", "RIGHT"),
683686
),
684687
mcp.WithNumber("start_line",
685688
mcp.Description("For multi-line comments, the first line of the range that the comment applies to"),
686689
),
687690
mcp.WithString("start_side",
688-
mcp.Description("For multi-line comments, the starting side of the diff that the comment applies to. Can be LEFT or RIGHT"),
691+
mcp.Description("For multi-line comments, the starting side of the diff that the comment applies to ('LEFT', 'RIGHT')"),
689692
mcp.Enum("LEFT", "RIGHT"),
690693
),
691694
mcp.WithNumber("in_reply_to",
@@ -894,6 +897,7 @@ func CreatePullRequestReview(getClient GetClientFn, t translations.TranslationHe
894897
mcp.WithString("event",
895898
mcp.Required(),
896899
mcp.Description("Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')"),
900+
mcp.Enum("APPROVE", "REQUEST_CHANGES", "COMMENT"),
897901
),
898902
mcp.WithString("commitId",
899903
mcp.Description("SHA of commit to review"),

0 commit comments

Comments
 (0)