@@ -834,7 +834,6 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
834
834
mcp .Description ("Repository name" ),
835
835
),
836
836
mcp .WithString ("state" ,
837
- mcp .Required (),
838
837
mcp .Description ("Filter by state" ),
839
838
mcp .Enum ("OPEN" , "CLOSED" ),
840
839
),
@@ -870,11 +869,19 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
870
869
}
871
870
872
871
// Set optional parameters if provided
873
- state , err := RequiredParam [string ](request , "state" )
872
+ state , err := OptionalParam [string ](request , "state" )
874
873
if err != nil {
875
874
return mcp .NewToolResultError (err .Error ()), nil
876
875
}
877
876
877
+ //If the state has a value, cast into an array of strings
878
+ var states []githubv4.IssueState
879
+ if state != "" {
880
+ states = append (states , githubv4 .IssueState (state ))
881
+ } else {
882
+ states = []githubv4.IssueState {githubv4 .IssueStateOpen , githubv4 .IssueStateClosed }
883
+ }
884
+
878
885
// Get labels
879
886
labels , err := OptionalStringArrayParam (request , "labels" )
880
887
if err != nil {
@@ -951,7 +958,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
951
958
vars := map [string ]interface {}{
952
959
"owner" : githubv4 .String (owner ),
953
960
"repo" : githubv4 .String (repo ),
954
- "states" : []githubv4. IssueState { githubv4 . IssueState ( state )} ,
961
+ "states" : states ,
955
962
"orderBy" : githubv4 .IssueOrderField (orderBy ),
956
963
"direction" : githubv4 .OrderDirection (direction ),
957
964
"first" : githubv4 .Int (* paginationParams .First ),
0 commit comments