Skip to content

Commit 0f155f9

Browse files
committed
Update documentation and fix linter issues
1 parent d278d45 commit 0f155f9

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,14 @@ The following sets of tools are available (all are on by default):
539539
- `repo`: Repository name (string, required)
540540

541541
- **list_issues** - List issues
542-
- `direction`: Sort direction (string, optional)
542+
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
543+
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
543544
- `labels`: Filter by labels (string[], optional)
545+
- `orderBy`: Order issues by field. If provided, the 'direction' also needs to be provided. (string, optional)
544546
- `owner`: Repository owner (string, required)
545-
- `page`: Page number for pagination (min 1) (number, optional)
546547
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
547548
- `repo`: Repository name (string, required)
548549
- `since`: Filter by date (ISO 8601 timestamp) (string, optional)
549-
- `sort`: Sort order (string, optional)
550550
- `state`: Filter by state (string, optional)
551551

552552
- **list_sub_issues** - List sub-issues

pkg/github/discussions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ func Test_GetDiscussion(t *testing.T) {
484484
assert.ElementsMatch(t, toolDef.InputSchema.Required, []string{"owner", "repo", "discussionNumber"})
485485

486486
// Use exact string query that matches implementation output
487-
qGetDiscussion := "query($discussionNumber:Int!$owner:String!$repo:String!){repository(owner: $owner, name: $repo){discussion(number: $discussionNumber){number,title,body,createdAt,url,category{name}}}}"
487+
qGetDiscussion := "query($discussionNumber:Int!$owner:String!$repo:String!){repository(owner: $owner, name: $repo){discussion(number: $discussionNumber){number,title,body,createdAt,url,category{name}}}}"
488488

489489
vars := map[string]interface{}{
490490
"owner": "owner",

pkg/github/issues.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type IssueFragment struct {
3434
Labels struct {
3535
Nodes []struct {
3636
Name githubv4.String
37-
Id githubv4.String
37+
ID githubv4.String
3838
Description githubv4.String
3939
}
4040
} `graphql:"labels(first: 10)"`
@@ -102,14 +102,16 @@ func (q *ListIssuesQueryTypeWithLabelsWithSince) GetIssueFragment() IssueQueryFr
102102
}
103103

104104
func getIssueQueryType(hasLabels bool, hasSince bool) any {
105-
if hasLabels && hasSince {
105+
switch {
106+
case hasLabels && hasSince:
106107
return &ListIssuesQueryTypeWithLabelsWithSince{}
107-
} else if hasLabels {
108+
case hasLabels:
108109
return &ListIssuesQueryTypeWithLabels{}
109-
} else if hasSince {
110+
case hasSince:
110111
return &ListIssuesQueryWithSince{}
112+
default:
113+
return &ListIssuesQuery{}
111114
}
112-
return &ListIssuesQuery{}
113115
}
114116

115117
func fragmentToIssue(fragment IssueFragment) *github.Issue {
@@ -118,7 +120,7 @@ func fragmentToIssue(fragment IssueFragment) *github.Issue {
118120
for _, labelNode := range fragment.Labels.Nodes {
119121
foundLabels = append(foundLabels, &github.Label{
120122
Name: github.Ptr(string(labelNode.Name)),
121-
NodeID: github.Ptr(string(labelNode.Id)),
123+
NodeID: github.Ptr(string(labelNode.ID)),
122124
Description: github.Ptr(string(labelNode.Description)),
123125
})
124126
}
@@ -900,7 +902,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
900902
return mcp.NewToolResultError(err.Error()), nil
901903
}
902904

903-
//If the state has a value, cast into an array of strings
905+
// If the state has a value, cast into an array of strings
904906
var states []githubv4.IssueState
905907
if state != "" {
906908
states = append(states, githubv4.IssueState(state))
@@ -914,7 +916,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
914916
return mcp.NewToolResultError(err.Error()), nil
915917
}
916918

917-
//If labels is empty, default to nil for gql query
919+
// If labels is empty, default to nil for gql query
918920
if len(labels) == 0 {
919921
labels = nil
920922
}
@@ -923,7 +925,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
923925
if err != nil {
924926
return mcp.NewToolResultError(err.Error()), nil
925927
}
926-
//If orderBy is empty, default to CREATED_AT
928+
// If orderBy is empty, default to CREATED_AT
927929
if orderBy == "" {
928930
orderBy = "CREATED_AT"
929931
}
@@ -932,7 +934,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
932934
if err != nil {
933935
return mcp.NewToolResultError(err.Error()), nil
934936
}
935-
//If direction is empty, default to DESC
937+
// If direction is empty, default to DESC
936938
if direction == "" {
937939
direction = "DESC"
938940
}

0 commit comments

Comments
 (0)